Difference between revisions of "PRIM PHYSICS"
Jump to navigation
Jump to search
m |
(added example of setting and getting the Prim Physics) |
||
Line 24: | Line 24: | ||
|toc=llGetPrimitiveParams | |toc=llGetPrimitiveParams | ||
}} | }} | ||
|examples= | |examples=<lsl>default | ||
{ | |||
state_entry() | |||
{ | |||
llSetPrimitiveParams([PRIM_PHYSICS, TRUE]); // makes the prim physical... | |||
if(llGetPrimitiveParams([PRIM_PHYSICS]) == TRUE) | |||
{ | |||
llSetText("Object is Physical", <1, 1, 1>, 1.0); | |||
} | |||
else | |||
{ | |||
llSetText("Object is non-Physical", <1, 1, 1>, 1.0); | |||
} | |||
} | |||
}</lsl> | |||
|caveats= | |caveats= | ||
*calls to set PRIM_PHYSICS in attachments fail silently | *calls to set PRIM_PHYSICS in attachments fail silently |
Revision as of 01:00, 25 November 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_PHYSICS = 3;llSetPrimitiveParams
llSetPrimitiveParams([ PRIM_PHYSICS, integer boolean ]);• integer | boolean | – | TRUE enables, FALSE disables |
The same syntax applies to llSetLinkPrimitiveParams and llSetLinkPrimitiveParamsFast but with an additional prefixed link parameter in the function call.
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_PHYSICS ]);Returns the list [ integer boolean ]
• integer | boolean | – | TRUE enables, FALSE disables |
The same syntax applies to llGetLinkPrimitiveParams, but with an additional prefixed link parameter in the function call.
Caveats
- calls to set PRIM_PHYSICS in attachments fail silently
Related Articles
Constants
• | STATUS_PHYSICS |
Functions
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPrimitiveParams | |||
• | llSetStatus | |||
• | llGetStatus |
Examples
<lsl>default {
state_entry() { llSetPrimitiveParams([PRIM_PHYSICS, TRUE]); // makes the prim physical... if(llGetPrimitiveParams([PRIM_PHYSICS]) == TRUE) { llSetText("Object is Physical", <1, 1, 1>, 1.0); } else { llSetText("Object is non-Physical", <1, 1, 1>, 1.0); } }
}</lsl>