Difference between revisions of "LlSetCOG"

From Second Life Wiki
Jump to navigation Jump to search
(Added first proposal)
 
(Changed the wording about the "local" parameter. It should be possible to set the COG for child prims in a linked set as well as for root prims to simplify construction of machinery with moving parts.)
 
Line 6: Line 6:
|func=llSetCOG
|func=llSetCOG
|p1_type=vector|p1_name=cog|p1_desc=position of the prim's center of gravity
|p1_type=vector|p1_name=cog|p1_desc=position of the prim's center of gravity
|p2_type=integer|p2_name=local|p2_desc=boolean, if {{LSLG|TRUE}} the cog is interpreted as an offset from the geometrical center of the prim along the axis of the [[Viewer coordinate frames#Local|local]] coordinate system, if {{LSLG|FALSE}} the cog is interreted in the [[Viewer coordinate frames#Region|region]] coordinate system.
|p2_type=integer|p2_name=local|p2_desc=boolean, if {{LSLG|TRUE}} '''cog''' is relative to the [[Viewer coordinate frames#Local|local]] coordinate system, if {{LSLG|FALSE}} '''cog''' is relative to the parent coordinate system. If the prim is a single prim or the root prim in a linked set, that means the [[Viewer coordinate frames#Region|region]] coordinate system.
|func_footnote
|func_footnote
|func_desc=Overrides the automatic, volume based, computation of the prim's center of gravity. All rotations will instead be made around the given point. This includes {{LSLG|llSetRot}}, {{LSLG|llSetLocalRot}}, {{LSLG|llTargetOmega}} as well as physics evaluation. In addition, the handles in edit mode will be positioned at the specified point.
|func_desc=Overrides the automatic, volume based, computation of the prim's center of gravity. All rotations will instead be made around the given point. This includes {{LSLG|llSetRot}}, {{LSLG|llSetLocalRot}}, {{LSLG|llTargetOmega}} as well as physics evaluation. In addition, the handles in edit mode will be positioned at the specified point.
 
|examples=
If the function is called in a child prim of a link set, nothing happens and the given COG position is ignored.
|caveats=((TODO: Why is there an error here?))
|examples
|caveats=
|constants
|constants
|helpers
|helpers

Latest revision as of 10:49, 17 October 2007

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llSetCOG( vector cog, integer local );

Overrides the automatic, volume based, computation of the prim's center of gravity. All rotations will instead be made around the given point. This includes llSetRot, llSetLocalRot, llTargetOmega as well as physics evaluation. In addition, the handles in edit mode will be positioned at the specified point.

• vector cog position of the prim's center of gravity
• integer local boolean, if TRUE cog is relative to the local coordinate system, if FALSE cog is relative to the parent coordinate system. If the prim is a single prim or the root prim in a linked set, that means the region coordinate system.

Caveats

Expression error: Unexpected > operator.((TODO: Why is there an error here?))

All Issues ~ Search JIRA for related Bugs

Examples

Notes

A way to reset the COG back to the automatic computation might be useful as well.

Deep Notes

Search JIRA for related Issues

Signature

//function void llSetCOG( vector cog, integer local );