Difference between revisions of "PRIM ROTATION"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
 
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{#if:
<onlyinclude>{{#if:
{{LSL_Constants/PrimitiveParams}}
 
{{#vardefine:rotation_const|{{LSL Const|PRIM_ROTATION|integer|8|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's rotation. See also PRIM_ROT_LOCAL which has a more consistent behavior.}}}}
 
{{#vardefine:p_rot_desc|Any valid rotation}}
 
{{#ifeq:{{{1|set}}}|set|{{Issues/SVC-93}}}}
 
{{#vardefine:caveats-get|{{#var:caveats-get}}
* {{LSLP|rot}} is always the [[Viewer_coordinate_frames#global|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.
}}
 
{{#switch:{{{1|}}}
|get={{#vardefine:caveats|{{#var:caveats}}
{{#var:caveats-get}}{{#vardefine:caveats-get}}}}
|set={{#vardefine:caveats|{{#var:caveats}}
{{#var:caveats-set}}{{#vardefine:caveats-set}}}}
 
}}
 
}}</onlyinclude>{{#if:
 
}}{{LSL Constant
}}{{LSL Constant
|inject-2={{LSL PrimitiveParam Categorize|Prim}}
|name=PRIM_ROTATION
|name=PRIM_ROTATION
|type=integer
|type=integer
|value=8
|value=8
|desc=PRIM_ROTATION is used to get or set the prim's rotation.
|desc=PRIM_ROTATION is used to get or set the prim's rotation.
|pa={{LSL Constant/List|i_front=[&#32;[[PRIM_ROTATION]],&#32;|i_end=&nbsp;]
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([&#32;{{#var:rotation_const}},&#32;|i_end=&nbsp;]);
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
{{LSL Generic/Caveats|caveats={{#var:caveats-set}}|title=*}}
|toc=llSetPrimitiveParams
|i1_type=rotation|i1_name=rot
|i1_type=rotation|i1_name=rot
}}
}}
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;[[PRIM_ROTATION]]|i_end=&nbsp;]);|
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:rotation_const}}|i_end=&nbsp;]);|
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|text
|text={{LSL Generic/Caveats|caveats={{#var:caveats-get}}|title=*}}
|toc=llGetPrimitiveParams
|r1_type=rotation|r1_name=rot
|r1_type=rotation|r1_name=rot
}}
}}
|examples
|examples=<source lang="lsl2">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 ]);
    }
}
</source>
|constants=
|constants=
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
|functions=
|functions=
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}
{{LSL DefineRow||[[llGetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}
Line 26: Line 62:
{{LSL DefineRow||[[llSetLocalRot]]|}}
{{LSL DefineRow||[[llSetLocalRot]]|}}
{{LSL DefineRow||[[llGetLocalRot]]|}}
{{LSL DefineRow||[[llGetLocalRot]]|}}
{{LSL DefineRow||[[llGetRootRotation]]|}}
{{LSL DefineRow||[[llGetObjectDetails]]|}}
{{LSL DefineRow||[[llGetObjectDetails]]|}}
|events=
|events=
<!--{{LSL DefineRow||[[changed]]|}}-->
<!--{{LSL DefineRow||[[changed]]|}}-->
|location
|location
|cat1=Prim
|cat1
|cat2=Rotation
|cat2=Rotation
|cat3
|cat3=Movement
|cat4
|cat4
}}
}}

Latest revision as of 16:52, 23 January 2015

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

All Issues ~ Search JIRA for related Bugs

Examples

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 ]);
    }
}

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;