Difference between revisions of "LlSetRot"

From Second Life Wiki
Jump to navigation Jump to search
(explained llSetRot child prim bug)
Line 5: Line 5:
|sort=SetRot
|sort=SetRot
|caveats=*If the prim is attached, then this function offsets the rotation by the avatars rotation.
|caveats=*If the prim is attached, then this function offsets the rotation by the avatars rotation.
*If the prim is not the root prim it is offset by the roots [[Viewer coordinate frames#Local|local]] rotation.
*If the prim is not the root prim it is offset by the roots [[Viewer coordinate frames#Local|local]] rotation. This is a bug. The work-around is to divide the rotation by the root rotation.
**If you are trying to set the rotation of a child prim relative to the root prim then divide the local rotation by the root rotation.
**If you are trying to set the rotation of a child prim to a global rotation then you need to divide the global rotation by the rot rotation '''twice'''.
**It is better to use [[llSetLocalRot]] to set the rotation of child prims, even if you are setting it to a global rotation (just multiply by the root rotation in that case).
**There is no easy way to get the roots [[Viewer coordinate frames#Local|local]] rotation of an attached object (other then being told by the root).
**There is no easy way to get the roots [[Viewer coordinate frames#Local|local]] rotation of an attached object (other then being told by the root).
|spec
|spec

Revision as of 11:28, 11 April 2007

Summary

Function: llSetRot( rotation rot );

Sets the rotation of the prim to rot.

• rotation rot

Caveats

  • This function causes the script to sleep for 0.2 seconds.
  • If the prim is attached, then this function offsets the rotation by the avatars rotation.
  • If the prim is not the root prim it is offset by the roots local rotation. This is a bug. The work-around is to divide the rotation by the root rotation.
    • If you are trying to set the rotation of a child prim relative to the root prim then divide the local rotation by the root rotation.
    • If you are trying to set the rotation of a child prim to a global rotation then you need to divide the global rotation by the rot rotation twice.
    • It is better to use llSetLocalRot to set the rotation of child prims, even if you are setting it to a global rotation (just multiply by the root rotation in that case).
    • There is no easy way to get the roots local rotation of an attached object (other then being told by the root).
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Functions

•  llGetRot
•  llSetLocalRot

Deep Notes

Search JIRA for related Issues

Signature

function void llSetRot( rotation rot );