Difference between revisions of "PRIM ROTATION"

From Second Life Wiki
Jump to: navigation, search
m
m (Giving an example of Prim Rotation)
Line 40: Line 40:
 
|r1_type=rotation|r1_name=rot
 
|r1_type=rotation|r1_name=rot
 
}}
 
}}
|examples
+
|examples=<lsl>default
 +
{
 +
    state_entry()
 +
    {
 +
        /* This is rotates only once and just gradually that once */
 +
        vector rotationAngle = <2.3, 5.5, 9.7>;
 +
        rotation rot = llEuler2Rot( rotationAngle );
 +
        llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]);
 +
    }
 +
}
 +
</lsl>
 
|constants=
 
|constants=
 
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
 
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->

Revision as of 20:18, 21 November 2013

Description

Constant: integer PRIM_ROTATION = 8;

The integer constant PRIM_ROTATION has the value 8

PRIM_ROTATION is used to get or set the prim's rotation.

llSetPrimitiveParams

llSetPrimitiveParams([ PRIM_ROTATION, rotation rot ]);
• rotation rot Any valid rotation

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams All Issues ~ Search JIRA for related Bugs

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_ROTATION ]);

Returns the list [ rotation rot ]

• rotation rot Any valid rotation

Caveats

  • rot is always the global rotation, even if the prim is a child or the root prim of an attachment.
  • PRIM_ROTATION incorrectly reports the avatars rotation when called on the root of an attached object. Use PRIM_ROT_LOCAL for the root prim instead.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   state_entry()
   {
       /* This is rotates only once and just gradually that once */
       vector rotationAngle = <2.3, 5.5, 9.7>; 
       rotation rot = llEuler2Rot( rotationAngle );
       llSetLinkPrimitiveParams(2, [ PRIM_ROTATION, rot ]);
   }

} </lsl>

Deep Notes

All Issues

~ Search JIRA for related Issues
   llSetRot and llSetPrimitiveParams (using PRIM_ROTATION) incorrectly implemented for child prims.

Signature

integer PRIM_ROTATION = 8;