OsSetInertiaAsCylinder

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Added note stating which version of OpenSim introduced this function)
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
|threat_level=None
+
|threat_level=ignored
|function_syntax=
+
|permissions=true
 +
|delay=0
 +
|function_syntax=osSetInertiaAsCylinder(float mass,  float radius, float length, vector centerOfMass, rotation rot)
 
|csharp_syntax=
 
|csharp_syntax=
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
Line 10: Line 12:
 
     state_entry()
 
     state_entry()
 
     {
 
     {
 +
        ...
 +
        osSetInertiaAsCylinder(20.0,  0.5, 2.0, <-0.5, 0.5, 1.0>, ZERO_ROTATION);
 
         ...
 
         ...
 
     }
 
     }
 
}
 
}
 
</source>
 
</source>
|description=...
+
|description=Allows creators to set the link set total mass, center of mass and moment of inertia. Moment of inertia will be the one of a cylinder of radius and length, placed at the center of mass and rotated by rot in the root prim local frame. Call osClearInertia to undo.
 +
 
 
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 
'''Caution !''' Only supported by '''ubOde''' for now
 
'''Caution !''' Only supported by '''ubOde''' for now
 
</div>
 
</div>
|
+
 
 +
===== Arguments: =====
 +
* Mass new total mass of link set
 +
* centerOfMass new location of center of mass relative to root prim in local frame
 +
* radius radius of a cylinder used to calculate the new inertia
 +
* length length of a cylinder used to calculate the new inertia
 +
* rot rotation of the cylinder in the root prim local frame.
 +
 
 +
|additional_info=This function was added in 0.9.0-post-fixes
 
}}
 
}}
 +
 +
'''See Also'''
 +
* [[osClearInertia]]
 +
* [[osSetInertia]]
 +
* [[osSetInertiaAsBox]]
 +
* [[osSetInertiaAsSphere]]

Revision as of 10:57, 15 October 2018

osSetInertiaAsCylinder(float mass, float radius, float length, vector centerOfMass, rotation rot)
Allows creators to set the link set total mass, center of mass and moment of inertia. Moment of inertia will be the one of a cylinder of radius and length, placed at the center of mass and rotated by rot in the root prim local frame. Call osClearInertia to undo.

Caution ! Only supported by ubOde for now

Arguments:
  • Mass new total mass of link set
  • centerOfMass new location of center of mass relative to root prim in local frame
  • radius radius of a cylinder used to calculate the new inertia
  • length length of a cylinder used to calculate the new inertia
  • rot rotation of the cylinder in the root prim local frame.
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
// Example of osSetInertiaAsCylinder
 
default
{
    state_entry()
    {
        ...
        osSetInertiaAsCylinder(20.0,  0.5, 2.0, <-0.5, 0.5, 1.0>, ZERO_ROTATION);
        ...
    }
}
Notes
This function was added in 0.9.0-post-fixes



See Also

Personal tools
General
About This Wiki