|
Cherry Hotaling
Registered User
Join date: 25 Feb 2007
Posts: 86
|
01-30-2009 20:40
Hey there,
I was wondering how you would write something to rotate locally or adjust for avatar position. It seems that Flexi force applies on world rotation and not on local avatar rotation.
so if I wanted it to do the following:
llSetPrimitiveParams([PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 0.0, 1.0, <-0.5, 0, 0>]);
Then do: llSetPrimitiveParams([PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 0.0, 1.0, <0.5, 0, 0>]);
so it changed the force of X from -0.5 to 0.5. How do I make that happen locally no matter what direction the avatar is facing?
Thanks for your time
|
|
Cherry Hotaling
Registered User
Join date: 25 Feb 2007
Posts: 86
|
01-30-2009 21:09
I think I got it with:
rotation rot = llGetRot(); vector eRot = llRot2Euler(rot); rot = llEuler2Rot(eRot);
I then Multiplied the force by rot
Seems to work im going to attach it and see.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-30-2009 21:31
From: Cherry Hotaling I think I got it with:
rotation rot = llGetRot(); vector eRot = llRot2Euler(rot); rot = llEuler2Rot(eRot);
I then Multiplied the force by rot
Seems to work im going to attach it and see. Not sure why you do the extra steps of converting to nasty, evil Euler angles and back. Also note that this will account for the rotation of the AVATAR, but NOT the rotation of the attachment or attach point relative to the avatar, which you'll find is impossible without a lot of guesswork and imperial data collection for the EXACT set and timing of all animations currently playing (wait--actually I should have just stopped at "impossible"  .
|
|
Cherry Hotaling
Registered User
Join date: 25 Feb 2007
Posts: 86
|
01-31-2009 10:43
Yeah I ended up taking the conversion out. I dont remember why I did that. I think it was to set a rotation to 0 in my rez object script I made.
I ended up using: rotation rot = llGetRot();
and multiplied the force by rot.
Seems to work well.
Its not always 100* pinpoint accurate but very close.
|