Beatfox Xevious
is THOUSANDS OF PEOPLE
Join date: 1 Jun 2004
Posts: 879
|
03-02-2005 03:17
I've got a nice hollow sphere made with XyObject that's 50m in diameter. I'm trying to create a vehicle that will move along the sphere's inside surface, always "gravitating" toward that surface with "up" being towards the sphere's center. However, I'm having trouble coming up with a setup that actually works. Anyone have any helpful pointers?
I started out trying to use llLookAt to periodically orient the vehicle's Z-axis toward the center, but this caused unwanted rotation about the Z-axis as well. Currently I just have the vehicle as a flat disc, so that it naturally changes orientation as it moves along the inner surface. Unfortunately, it doesn't seem to want to travel in the global Z-direction when it's angled up or down, so it's only moving around on the bottom. "No deflection up" and "limit motor up" are both turned off. What am I doing wrong?
_____________________
My Beatworks: Zephyr Chimes wind chimes, the KanaMaster Japanese kana tutor, and the FREE Invisibility Prim Public. Look for them at the Luskwood General Store in Lusk (144, 165).
"You have been frozen. You cannot move or chat. A pony will contact you via instant message (IM)." - mysterious system message I received after making off with Pony Linden
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
03-02-2005 07:47
You might want to consider not using llLookAt/llRotLookAt with vehicle code. Functions that damp movement really... dont play well with vehicle functions. Try setting your vehicle's reference frame to the rotation you get using this: // AXIS_* constants, represent the unit vector 1 unit on the specified axis. vector AXIS_UP = <0,0,1>; vector AXIS_LEFT = <0,1,0>; vector AXIS_FWD = <1,0,0>; // getRotToPointAxisAt() // Gets the rotation to point the specified axis at the specified position. // @param axis The axis to point. Easiest to just use an AXIS_* constant. // @param target The target, in region-local coordinates, to point the axis at. // @return The rotation necessary to point axis at target. rotation getRotToPointAxisAt(vector axis, vector target) { return llGetRot() * llRotBetween(axis * llGetRot(), target - llGetPos()); }
Since you want to point the z axis at a target, pass AXIS_UP as the first parameter of that function. Now, since your reference frame is set so that "up" is towards the center of the sphere, then the VEHICLE_VERTICAL_ATTRACTION stuff *should* orient your vehicle properly. That is, unless VERTICAL_ATTRACTION totally ignores the reference frame and points it up towards the global z axis reguardless  ==Chris
|
Beatfox Xevious
is THOUSANDS OF PEOPLE
Join date: 1 Jun 2004
Posts: 879
|
03-02-2005 17:57
I tried your suggestion, setting the reference frame every half-second. Unfortunately, not only did it not orient the Z-axis towards the center, it caused the linear movement controls to go all out of whack. Guess something isn't quite right in those calculations.
I did fix the problem with it not moving in the global Z-direction when pitched up or down. Turned out the hover mechanism was interfering, even though the hover timescale was set to 999 (which is supposed to disable hover, according to the docs). After turning on "hover up only" and setting hover height to 0, it started travelling along the local X-axis just fine, regardless of pitch.
_____________________
My Beatworks: Zephyr Chimes wind chimes, the KanaMaster Japanese kana tutor, and the FREE Invisibility Prim Public. Look for them at the Luskwood General Store in Lusk (144, 165).
"You have been frozen. You cannot move or chat. A pony will contact you via instant message (IM)." - mysterious system message I received after making off with Pony Linden
|