The integer constant PRIM_OMEGA has the value 32

Used to make the object spin at the specified axis and rate, or retrieve spin settings. See llTargetOmega for specification.

Syntax

integer PRIM_OMEGA = 32;

Usage

[ PRIM_OMEGA, vector axis, float spinrate, float gain ]

vectoraxisarbitrary axis to rotate the object around
floatspinraterate of rotation in radians per second
floatgainalso modulates the final spinrate and disables the rotation behavior if zero

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams

llGetPrimitiveParams([ PRIM_OMEGA ]);

Returns the list [ vector axis, float spinrate, float gain ]

vectoraxisarbitrary axis to rotate the object around
floatspinraterate of rotation in radians per second
floatgainalso modulates the final spinrate and disables the rotation behavior if zero

Caveats

Examples

// Set this prim rotating
llTargetOmega(<1.0,3.0,0.5>, TWO_PI, 1.0);

// Read back this prim's current target omega
list current_omega = llGetPrimitiveParams([PRIM_OMEGA]); // returns [axis, spinrate, gain]
vector axis = llList2Vector(current_omega, 0); // Should be llVecNorm(<1.0,3.0,0.5>)
float spinrate = llList2Float(current_omega, 1); // Should be TWO_PI*llVecMag(<1.0,3.0,0.5>)
float gain = llList2Float(current_omega, 2); // Should be 1.0

// Set all child prims rotating
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_OMEGA, <1.0,3.0,0.5>, TWO_PI, 1.0]);

Also, can use llSetPrimitiveParams for the root prim.

// will need two prims linked together for this script.
default
{
    state_entry()
    {
        // make some sort of rotation angle for the omega...
        vector rotationAngle = <2.3, 5.5, 9.7> * llTan(85); 
        
        // rotate the main prim slowly using the same rotataion angle, rate, and gain...
        llSetPrimitiveParams([ PRIM_OMEGA, rotationAngle * 0.3, 1.0, 1.0 ]);
        
        // rotate the link satellite prim separately around its own axis 
        // it will rotate also around the main prim because the main prim is rotating.
        llSetLinkPrimitiveParams(2, [ PRIM_OMEGA, rotationAngle, 1.0, 1.0 ]);
    }
}

See also

Functions

Deep notes

History