Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

"You spin me wrong 'round baby..."

Ilsa Munro
Registered User
Join date: 1 Apr 2008
Posts: 29
03-13-2009 06:15
Sorry, it's late/early and an old song lyric seemed the perfect subject line...

I have a aircraft that I'm working on that I'd like to rotate into a particular position on one axis only when the pilot hops off. Conceptually think of it as an old tail dragger where the plane is parallel to the ground in flight but on the ground the tail end drops down about 15 degrees (not an exact number, just a round one that's easy to deal with). I can and do do this with the vehicle axis reference but a lot of times people don't actually land and taxi, they land and leap from the plane like it's on fire, leaving it sitting somewhat unnaturally with the tail in the air.

The trouble is that rotational math makes my head hurt so I've developed a simply system I use for things like rudders which are linked objects. I align the vehicle at a ZERO_ROTATION, then put a script in the part I want to move that will tell me the local rotation on touch. Get the centered rotation, then move that prim to the desired rotation and get that value. Repeat the process for each position and I've got all of the necessary local rotations for the rudder.

Doesn't seem quite that simple for the entire object though. I tried my system, set the plane to ZERO_ROTATION, got the difference between that and the desired position - I think it was -0.14253 on the Y axis. Then in the changed event when the avatar detaches from the plane I put in something like this:

rotation atRot = llGetRot();
llSetRot(atRot.x, -0.13253, atRot.z, atRot.s);

And it works great!

Ummm... As long as the plane is facing straight east when the pilot stands up. Any variation on that seems to translate into a rotation on the X axis. I assume because this rotation is in relation to the entire world and not a root prim like the rudder.

My current thought is to try and subtract - or add since it's a negative <0.0, -0.14253, 0.0, 0.0> to the current value of atRot but this is when my ears start bleeding.

Any suggestions?

Thanks in advance!
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
03-13-2009 06:34
llSetRot(<0.0, -0.14253, 0.0, 0.0> * llGetRot());
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Ilsa Munro
Registered User
Join date: 1 Apr 2008
Posts: 29
03-13-2009 06:42
From: Argent Stonecutter
llSetRot(<0.0, -0.14253, 0.0, 0.0> * llGetRot());


Okay now I'm a little scared... You mean that I sort of understood what I needed to do with a rotational issue and simply didn't believe that I'd figured it out?

That means I may be starting to understand this and that way lies madness :)

Thanks Argent