Don't click here unless you want to be banned.

LSL Wiki : llTargetOmega

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl801.us.archive.org
llTargetOmega(vector axis, float spinrate, float gain)

Sets target omega. Makes an object rotate smoothly, without "choppy" steps.

axis is a vector describing the axis the object will rotate around. For example, <0,0,1> will rotate the object around the Z (vertical) axis.¹
spinrate is the rate at which the object will spin (rotate) around the given axis (in radians per second).
gain is the strength of the spin, which only has an effect on physical objects. However, it still must be non-zero for non-physical objects.

NOTE: Currently llTargetOmega() is not performing properly, especially when involved in an avatar attachment. llTargetOmega cannot currently be relied upon to rotate avatar attachments properly, and exhibits inconsistent results on non-attached objects.
--Concerning HUDs, llTargetOmega() works without any problems.

This function can be used in a child link (in which case the child will rotate locally around its own center) or in a root link, in which case the entire linkset will rotate around the root's origin. (As used in the planets thing in the main grid's welcome area here). See also this forum note.

Beginners are often confused about the difference between this function and llSetRot. llTargetOmega makes the object SPIN with the specified angular velocity. llSetRot just turns it ONCE to face in a particular direction.

Notes:


¹: To get a rotation around a specific axis no matter how the prim/object is rotated, use llRot2*(llGetRot()) (where * is "Up", "Fwd", or "Left") for the axis. Note: the llTargetOmega script will have to be recompiled/reset if the prim/object is rotated while running or it will no longer rotate around the specific axis correctly.
²: It seems easy to oddly launch things this way, though. Be careful with this combination.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Dynamics | Rotation
There are 25 comments on this page. [Display comments/form]