|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
03-21-2006 10:02
To avoid adding another prim, I am racking my poor AV hollow brain to come up with a way to calculate a rotation that corrects for the linked prim rotations no matter what that might be. What would be great is a script that would take the rotation of the prim and the desired rotation and spit out the value that would be needed for llSitTarget(offset, rotation);. I think it should be simple to do but this moring I cannot seem to get my head to pull together a formula. Any hints or suggestion will be appreciated.
Mod
|
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
03-21-2006 10:38
vector sit_offset = <0.0, 0.0, 0.0>; // This must be a non zero vector or the sit target will be canceled. rotation sit_rotation = <0.0, 0.0, 0.0, 1.0>; // This rotation will be relative to the root prim.
llSitTarget((sit_offset / llGetLocalRot()) * sit_rotation, (ZERO_ROTATION / llGetLocalRot()) * sit_rotation);
That should make both sit_offset and sit_rotation relative to the root prim instead of the child prim you're using for a sit target.
Don't use this in the root prim itself. llGetLocalRot will return the world rotation of the root prim which will cause results to vary depending on the orientation of the object.
|
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Thanks
03-21-2006 11:03
Thanks Richard, You just saved me a ton of fustration. I appreciate it. Mod
|
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Not quite there yet
03-22-2006 10:22
Richard, the suggetion you made improved but did not fully corred the sit. What I want the calculation to do is to sit the VA as if the the child or root prim had ZERO_ROTATION. There has to be a calculation that will do that. Any other ideas?
|