Difference between revisions of "PRIM ROT LOCAL"
Jump to navigation
Jump to search
m (Created page with '<onlyinclude>{{#if: {{#vardefine:rot_local_const|{{LSL Const|PRIM_ROT_LOCAL|integer||c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's local rotation}}}} {{#vardefine:p_rot_de...') |
m |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude>{{#if: | <onlyinclude>{{#if: | ||
{{#vardefine:rot_local_const|{{LSL Const|PRIM_ROT_LOCAL|integer||c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's local rotation}}}} | {{#vardefine:rot_local_const|{{LSL Const|PRIM_ROT_LOCAL|integer|29|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's local rotation}}}} | ||
{{#vardefine: | {{#vardefine:p_rot_local_desc|Any valid rotation}} | ||
<!-- | <!-- | ||
{{#ifeq:{{{1|set}}}|set|{{Issues/SVC-93}}}} | {{#ifeq:{{{1|set}}}|set|{{Issues/SVC-93}}}} | ||
Line 22: | Line 22: | ||
}}{{LSL Constant | }}{{LSL Constant | ||
|inject-2={{LSL PrimitiveParam Categorize|Prim}} | |||
|name=PRIM_ROT_LOCAL | |name=PRIM_ROT_LOCAL | ||
|type=integer | |type=integer | ||
|value= | |value=29 | ||
|desc=PRIM_ROT_LOCAL is used to get or set the prim's local rotation. | |desc=PRIM_ROT_LOCAL is used to get or set the prim's local rotation. | ||
|pa={{LSL Constant/List|i_front=([ {{#var:rot_local_const}}, |i_end= ] | |pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ {{#var:rot_local_const}}, |i_end= ]); | ||
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]] | |text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]] | ||
{{LSL Generic/Caveats|caveats={{#var:caveats-set}}|title=*}} | {{LSL Generic/Caveats|caveats={{#var:caveats-set}}|title=*}} | ||
|toc=llSetPrimitiveParams | |toc=llSetPrimitiveParams | ||
|i1_type=rotation|i1_name=rot | |i1_type=rotation|i1_name=rot_local|i1_disp=rot | ||
}} | }} | ||
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:rot_local_const}}|i_end= ]);| | |pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([ {{#var:rot_local_const}}|i_end= ]);| | ||
Line 36: | Line 37: | ||
|text={{LSL Generic/Caveats|caveats={{#var:caveats-get}}|title=*}} | |text={{LSL Generic/Caveats|caveats={{#var:caveats-get}}|title=*}} | ||
|toc=llGetPrimitiveParams | |toc=llGetPrimitiveParams | ||
|r1_type=rotation|r1_name=rot | |r1_type=rotation|r1_name=rot_local|r1_disp=rot | ||
}} | }} | ||
|examples | |examples=<source lang="lsl2">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] ); | |||
} | |||
} | |||
} | |||
</source> | |||
|constants= | |constants= | ||
<!--{{LSL ConstRow|CHANGED_SHAPE}}--> | <!--{{LSL ConstRow|CHANGED_SHAPE}}--> | ||
Line 55: | Line 84: | ||
<!--{{LSL DefineRow||[[changed]]|}}--> | <!--{{LSL DefineRow||[[changed]]|}}--> | ||
|location | |location | ||
|cat1 | |cat1 | ||
|cat2=Rotation | |cat2=Rotation | ||
|cat3=Movement | |cat3=Movement | ||
|cat4 | |cat4 | ||
}} | }} |
Revision as of 10:16, 28 February 2016
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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 ]);Caveats
Related Articles
Examples
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] );
}
}
}