Difference between revisions of "PRIM PHYSICS"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<onlyinclude>{{#if:
<onlyinclude>{{#if:


{{#vardefine:physics_const|{{LSL Const|=PRIM_PHYSICS|integer|3|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the objects physical status}}}}
{{#vardefine:physics_const|{{LSL Const|PRIM_PHYSICS|integer|3|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the object's physical status}}}}


}}<onlyinclude>{{#if:
}}</onlyinclude>{{#if:


{{LSL_Function/boolean|boolean}}
{{LSL_Function/boolean|boolean}}


}}{{LSL Constant
}}{{LSL Constant
|inject-2={{LSL PrimitiveParam Categorize|Object}}
|name=PRIM_PHYSICS
|name=PRIM_PHYSICS
|type=integer
|type=integer
|value=3
|value=3
|desc=Boolean that sets whether the object responds to SL physics.
|desc=Used to get or set the object's [[STATUS_PHYSICS|physics]] {{LSLGC|Status|status}}. When enabled the object responds to SL physics.
|pa={{LSL Constant/List|i_front=[&#32;{{#var:physics_const}},&#32;|i_end=&nbsp;]
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([&#32;{{#var:physics_const}},&#32;|i_end=&nbsp;]);
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
|text={{LSL Constant/PrimParamText|set}}
|i1_type=integer|i1_name=boolean
|i1_type=integer|i1_subtype=boolean|i1_name=boolean
|toc=llSetPrimitiveParams
}}
}}
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:physics_const}},&#32;|i_end=&nbsp;]);|
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:physics_const}}|i_end=&nbsp;]);|
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
|text
|text={{LSL Constant/PrimParamText|get}}
|r1_type=integer|r1_name=boolean
|r1_type=integer|r1_subtype=boolean|r1_name=boolean
|toc=llGetPrimitiveParams
}}
}}
|examples=
|examples=<source lang="lsl2">default
{
    state_entry()
    {
        llSetPrimitiveParams([PRIM_PHYSICS, TRUE]); // makes the object physical...
       
        integer isPhysical = llList2Integer(llGetPrimitiveParams([PRIM_PHYSICS]), 0);
       
        if( isPhysical == 1 )
        {
            llSetText("Object is Physical", <1, 1, 1>, 1.0);
        }
       
        else
        {
            llSetText("Object is non-Physical", <1, 1, 1>, 1.0);
        }
    }
}</source>
|caveats=
*calls to set PRIM_PHYSICS in attachments fail silently
|constants=
|constants=
{{LSL DefineRow||[[STATUS_PHYSICS]]|}}
|functions=
|functions=
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}
|events=
{{LSL DefineRow||[[llSetStatus]]|}}
{{LSL DefineRow||[[changed]]|}}
{{LSL DefineRow||[[llGetStatus]]|}}
|events
|location
|location
|cat1=Prim
|cat1=Status
|cat2=Status
|cat2=Physics
|cat3
|cat3
|cat4
}}
}}

Latest revision as of 15:48, 23 January 2015

Description

Constant: integer PRIM_PHYSICS = 3;

The integer constant PRIM_PHYSICS has the value 3

Used to get or set the object's physics status. When enabled the object responds to SL physics.

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

Examples

default
{
    state_entry()
    {
        llSetPrimitiveParams([PRIM_PHYSICS, TRUE]); // makes the object physical...
        
        integer isPhysical = llList2Integer(llGetPrimitiveParams([PRIM_PHYSICS]), 0);
        
        if( isPhysical == 1 )
        {
            llSetText("Object is Physical", <1, 1, 1>, 1.0);
        }
        
        else
        {
            llSetText("Object is non-Physical", <1, 1, 1>, 1.0);
        }
    }
}

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_PHYSICS = 3;