Global to root relative transformation script
Revision as of 22:48, 6 June 2007 by Strife Onizuka (talk | contribs)
A script in a child primitive of an object may need to transform a location or other vector from global coordinates to root relative coordinates. The angular transformation for a vector can be done by:
relative_pos = ( global_pos - llGetRootPosition() ) / llGetRootRotation();
Rotations can be similarly transformed.
relative_rot = global_rot / llGetRootRotation();