LlTargetOmega: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Strife Onizuka (talk | contribs)
No edit summary
Strife Onizuka (talk | contribs)
mNo edit summary
(14 intermediate revisions by 8 users not shown)
Line 6: Line 6:
|p1_type=vector|p1_name=axis|p1_desc=arbitrary axis to rotate the object around
|p1_type=vector|p1_name=axis|p1_desc=arbitrary axis to rotate the object around
|p2_type=float|p2_name=spinrate|p2_desc=rate of rotation in radians per second
|p2_type=float|p2_name=spinrate|p2_desc=rate of rotation in radians per second
|p3_type=float|p3_name=gain|p3_desc=needs to be non-zero
|p3_type=float|p3_name=gain|p3_desc=also modulates the final spinrate and disables the rotation behavior if zero
|func_footnote
|func_footnote
|func_desc=Rotates the object around '''axis''' at '''spinrate''' * {{LSLG|llVecMag}}('''axis''') in radians per second with strength '''gain'''.
|func_desc=Rotates the object around '''axis''' at '''spinrate''' * [[llVecMag]]('''axis''') in radians per second with strength '''gain'''.
|examples=<pre>//rotates the x axis once per second,
|examples=<lsl>//rotates the x axis once per second,
//  rotates the y axis 3 times per second,  
//  rotates the y axis 3 times per second,  
//  rotates the z axis once every two seconds.
//  rotates the z axis once every two seconds.
//  combined the rate is about 3.20156 revolutions per second
//  combined the rate is about 3.20156 revolutions per second
llTargetOmega(<1.0,3.0,0.5>,TWO_PI,1.0);</pre>
 
llTargetOmega(<1.0,3.0,0.5>,TWO_PI,1.0);</lsl>
|spec=
|spec=
===Physics===
===Physics===
*If the object is not physical then the effect is entirely client side.
*If the object is not physical then the effect is entirely client side. The rotation experienced by the user '''cannot''' be detected or queried by script.
*If the object is physical then the physical representation is updated regularly.
*If the object is physical then the physical representation is updated regularly. The rotation experienced by the user '''can''' be detected or queried by script.
===Link Sets===
===Link Sets===
*If the script is attached to the root prim, the entire object rotates around the [[Viewer coordinate frames#Region|region]] '''axis'''
*If the script is attached to the root prim, the entire object rotates around the [[Viewer coordinate frames#Region|region]] '''axis'''
**If the object is attached then it rotates around the attachment '''axis'''
**If the object is attached then it rotates around the attachment '''axis'''
*If the script is attached to a child prim, the prim rotates around the local '''axis'''
*If the script is attached to a child prim, the prim rotates around the [[Viewer coordinate frames#Local|local]] '''axis'''
**A Child prim can rotate around it's own '''axis''' while the entire object rotates around another '''axis'''.
**A Child prim can rotate around its own '''axis''' while the entire object rotates around another '''axis'''.
|caveats=*If the object is not physical then the rotation is only a client side effect and avatars and objects may move around the object as if it were not rotating at all.
|caveats=*If the object is not physical then the rotation is only a client side effect and it will collide as non-moving geometry.
|constants
|constants
|helpers
|helpers
Line 30: Line 31:
|also_events
|also_events
|also_articles
|also_articles
|notes=Use {{LSLG|llVecNorm}} on '''axis''' so that '''spinrate''' actually represents the rate of rotation.
|also_tests={{LSL DefineRow||[[llTargetOmega test]]|}}
|notes=* Use [[llVecNorm]] on '''axis''' so that '''spinrate''' actually represents the rate of rotation.
* Set the gain to zero to disable and remove the rotation behavior, eg llTargetOmega(ZERO_VECTOR, 0, 0);
** A spinrate of 0 with a nonzero gain causes the object to try to stop all spin, rather than simply clearing a previous llTargetOmega() call. 
|cat1=Physics
|cat1=Physics
|cat2=Effects
|cat2=Effects
|cat3
|cat3=Rotation
|cat4
|cat4=Prim
|cat5=Stop
|cat6
|cat7
|cat8
}}
}}

Revision as of 06:46, 16 April 2009

Summary

Function: llTargetOmega( vector axis, float spinrate, float gain );
0.0 Forced Delay
10.0 Energy

Rotates the object around axis at spinrate * llVecMag(axis) in radians per second with strength gain.

• vector axis arbitrary axis to rotate the object around
• float spinrate rate of rotation in radians per second
• float gain also modulates the final spinrate and disables the rotation behavior if zero

Specification

Physics

  • If the object is not physical then the effect is entirely client side. The rotation experienced by the user cannot be detected or queried by script.
  • If the object is physical then the physical representation is updated regularly. The rotation experienced by the user can be detected or queried by script.

Link Sets

  • If the script is attached to the root prim, the entire object rotates around the region axis
    • If the object is attached then it rotates around the attachment axis
  • If the script is attached to a child prim, the prim rotates around the local axis
    • A Child prim can rotate around its own axis while the entire object rotates around another axis.

Caveats

  • If the object is not physical then the rotation is only a client side effect and it will collide as non-moving geometry.

Examples

<lsl>//rotates the x axis once per second, // rotates the y axis 3 times per second, // rotates the z axis once every two seconds. // combined the rate is about 3.20156 revolutions per second

llTargetOmega(<1.0,3.0,0.5>,TWO_PI,1.0);</lsl>

Notes

  • Use llVecNorm on axis so that spinrate actually represents the rate of rotation.
  • Set the gain to zero to disable and remove the rotation behavior, eg llTargetOmega(ZERO_VECTOR, 0, 0);
    • A spinrate of 0 with a nonzero gain causes the object to try to stop all spin, rather than simply clearing a previous llTargetOmega() call.

Deep Notes

Tests

•  llTargetOmega test

Signature

function void llTargetOmega( vector axis, float spinrate, float gain );