Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation on physical object - help? :)

Zephone Chandrayaan
Registered User
Join date: 23 Nov 2006
Posts: 2
05-29-2007 00:00
I'm working on an automated transport around the parcel I'm working on right now and I've run into an issue I'm not sure how to solve. This is my first time doing this, y'see, and I figured my logic/knowledge of the way LSL "works" would get me through this... however, it's not.

The issue is getting the car to turn on the Z axis by a certain number of degrees when it reaches its destination, then to continue on its path. Basically to create the illusion that it's turning properly.

I've tried 3 different methods of getting it to do just that, but all three completely fail. The script debug I wrote says that the rotation is present and is being passed to it, but the object dos not rotate - it just stays facing the same way, as if I never put the rotation change in there.

Is there something special I need to do? 'cause I've tried llSetRot(<actual rotation coordinates>;), llSetRot(Euler2Rot<vector coordinates>;)) and llSetPrimitiveParams([PRIM_ROTATION, <coordinates>]), which I've noted all do the exact same thing according to all my reading and digging.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
05-29-2007 02:31
If it's a physical object, you probably want to try llApplyRotationalImpulse().
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
05-29-2007 05:38
I run a non-physical vehicle and I have extracted the turning bits.

CODE

rotation glq; // global left turn quaternion
rotation grq; // global right turn quaternion

turn (rotation rot) {
rotation r = llGetRot ();
r *= rot;
llSetRot (r);
}

turnLeft () {
turn (glq);
lastTurn = LEFT;
}

turnRight () {
turn (grq);
lastTurn = RIGHT;
}

default
{
state_entry (){
glq = llEuler2Rot(<0,0,PI/2>);
grq = llEuler2Rot(<0,0,-PI/2>);
}

}


You need to work out whether your vehicle is physical or non-physical. Two different sets of routines apply, depending on which your system is.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
05-29-2007 06:11
Have you looked at llLookAt?
http://rpgstats.com/wiki/index.php?title=LlLookAt

If you're less concerned with specifying an angle, and more concerned with specifying a target to turn to, this may work for you.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
05-29-2007 11:04
llRotTarget is another possibility.
Zephone Chandrayaan
Registered User
Join date: 23 Nov 2006
Posts: 2
Thanks!
05-29-2007 19:20
I'll play around with some of these functions and see how things work out. Maybe... just maybe... I'll get this to work after all.