Difference between revisions of "PRIM ROT LOCAL"

From Second Life Wiki
Jump to: navigation, search
m
m (added example using link set primitive params)
Line 39: Line 39:
 
|r1_type=rotation|r1_name=rot
 
|r1_type=rotation|r1_name=rot
 
}}
 
}}
|examples
+
|examples=<lsl>integer isRotated = FALSE;
 +
vector rotated = <25, 25, 0>;
 +
rotation notRotated = ZERO_ROTATION;
 +
rotation rot;
 +
 
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        rotated *= DEG_TO_RAD;
 +
        rot = llEuler2Rot( rotated );
 +
    }
 +
   
 +
    touch_start(integer total_number)
 +
    {
 +
        if( isRotated )
 +
        {
 +
            llSetLinkPrimitiveParams( 2, [PRIM_ROT_LOCAL, notRotated] );
 +
            isRotated = FALSE;
 +
        }
 +
       
 +
        else if( !isRotated )
 +
        {
 +
            isRotated = TRUE;
 +
            llSetLinkPrimitiveParams( 2, [PRIM_ROT_LOCAL, rot] );
 +
        }
 +
    }
 +
}
 +
</lsl>
 
|constants=
 
|constants=
 
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
 
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->

Revision as of 00:41, 10 January 2014

Description

Constant: integer PRIM_ROT_LOCAL = 29;

The integer constant PRIM_ROT_LOCAL has the value 29

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

llSetPrimitiveParams

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

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

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_ROT_LOCAL ]);

Returns the list [ rotation rot ]

• rotation rot Any valid rotation

All Issues ~ Search JIRA for related Bugs

Examples

<lsl>integer isRotated = FALSE; vector rotated = <25, 25, 0>; rotation notRotated = ZERO_ROTATION; rotation rot;

default {

   state_entry()
   {
       rotated *= DEG_TO_RAD;
       rot = llEuler2Rot( rotated );
   }
   
   touch_start(integer total_number)
   {
       if( isRotated ) 
       {
           llSetLinkPrimitiveParams( 2, [PRIM_ROT_LOCAL, notRotated] );
           isRotated = FALSE;
       }
       
       else if( !isRotated ) 
       {
           isRotated = TRUE;
           llSetLinkPrimitiveParams( 2, [PRIM_ROT_LOCAL, rot] );
       }
   }

} </lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_ROT_LOCAL = 29;