Difference between revisions of "STATUS PHYSICS"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL Constant |name=STATUS_PHYSICS |type=integer |value={{LSL Hex|0x1}} |desc |examples |constants={{LSL Constants/Status|no_wrapper=true}} |functions= {{LSL DefineRow||llSetStatus|}}...)
 
m (Replaced <source> with <syntaxhighlight>)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL Constant
{{Issues/SVC-6549}}{{LSL Constant
|name=STATUS_PHYSICS
|name=STATUS_PHYSICS
|type=integer
|type=integer
|value={{LSL Hex|0x1}}
|value={{LSL Hex|0x1}}
|desc
|desc=This property (set FALSE by default) if set TRUE allows that the object is subject to and can offer physical interactions and forces.
|examples
|examples=Simple script to turn on and off the physics of an object.
|constants={{LSL Constants/Status|no_wrapper=true}}
<syntaxhighlight lang="lsl2">default
{
    state_entry()
    {
        llSetTimerEvent(llFrand(10) + 5.0); // Set a random time in seconds between 5 and 15
    }
    timer()
    {
        if(!llGetStatus(STATUS_PHYSICS)) // Check the physical status is non-phys
        {
            llSetStatus(STATUS_PHYSICS, TRUE); // Set the object physical
            llMoveToTarget(llGetPos() + <0.0,0.0,10.0>, 1.0); // Move to a point 10 meters above the present position
        }
        else // If physical
        {
            llSetStatus(STATUS_PHYSICS, FALSE); // Set the object non-phys
            llSetTimerEvent(0.0); // Stop the timer
        }
    }
}</syntaxhighlight>
|constants=
{{!}}
{{{!}}
{{LSL DefineRow||[[PRIM_PHYSICS]]|}}
{{!}}}
{{LSL Constants/Status|no_default=*}}
|functions=
|functions=
{{LSL DefineRow||[[llSetStatus]]|}}
{{LSL DefineRow||[[llSetStatus]]|}}

Latest revision as of 12:02, 6 October 2024

Description

Constant: integer STATUS_PHYSICS = 0x1;

The integer constant STATUS_PHYSICS has the value 0x1

This property (set FALSE by default) if set TRUE allows that the object is subject to and can offer physical interactions and forces.

Caveats


Related Articles

Constants

•  PRIM_PHYSICS
Constants Value Description
STATUS_PHYSICS 0x001 Object is physical
STATUS_ROTATE_X 0x002 Can turn along this axis (physical objects only)
STATUS_ROTATE_Y 0x004 Can turn along this axis (physical objects only)
STATUS_ROTATE_Z 0x008 Can turn along this axis (physical objects only)
STATUS_PHANTOM 0x010 Object is phantom
STATUS_SANDBOX 0x020 Keep object within 10 meters and in the same region
STATUS_BLOCK_GRAB 0x040 Prevent click-and-drag movement on the root prim
Constants Value Description
STATUS_DIE_AT_EDGE 0x080 Delete and do not return object if it goes off world
STATUS_RETURN_AT_EDGE 0x100 Return object to owner if it goes off world
STATUS_CAST_SHADOWS 0x200 not currently used
STATUS_BLOCK_GRAB_OBJECT 0x400 Prevent click-and-drag movement on all prims in the object
STATUS_DIE_AT_NO_ENTRY 0x800 Delete and do not return object if it cannot enter a parcel

Functions

•  llSetStatus
•  llGetStatus

Examples

Simple script to turn on and off the physics of an object.

default
{
    state_entry()
    {
        llSetTimerEvent(llFrand(10) + 5.0); // Set a random time in seconds between 5 and 15
    }
    timer()
    {
        if(!llGetStatus(STATUS_PHYSICS)) // Check the physical status is non-phys
        {
            llSetStatus(STATUS_PHYSICS, TRUE); // Set the object physical
            llMoveToTarget(llGetPos() + <0.0,0.0,10.0>, 1.0); // Move to a point 10 meters above the present position
        }
        else // If physical
        {
            llSetStatus(STATUS_PHYSICS, FALSE); // Set the object non-phys
            llSetTimerEvent(0.0); // Stop the timer
        }
    }
}

Deep Notes

All Issues

~ Search JIRA for related Issues
   llSetStatus can't change STATUS_PHYSICS of an attachment despite the status being preserved between attach & drop

Signature

integer STATUS_PHYSICS = 0x1;