BulletSim/ScriptFunctions
From OpenSimulator
OpenSimulator => BulletSim => Script Functions
BulletSim Script Functions
Contents |
Physics engines have an extension interface enabling extended functions. BulletSim adds script functions which call the extension interface and add control of physics parameters and new functionality.
This feature requires the mod_invoke feature to be enabled on the region the script is running on.
Information
string physGetEngineType()
string physGetPhysicsParameter(string parameterName)
void physSetPhysicsParameter(string parameterName, string value)
Physics Parameters
void physSetLinksetType(integer linksetTypeCode)
Value | Constant | Description |
---|---|---|
0 | PHYS_LINKSET_TYPE_CONSTRAINT | Links are created with physics constraint objects. Used for flexible objects. Not a good default as it uses more CPU. |
1 | PHYS_LINKSET_TYPE_COMPOUND | Linkset is constructed as a compound object made up of the shapes of all the children. The most efficient linkset implementation and the default. |
2 | PHYS_LINKSET_TYPE_MANUAL | NOT IMPLEMENTED. Linkset is implemented by CPU code that moves each of the object in the linkset independently. |
void physSetCenterOfMass(vector centerOfMassDisplacement)
Value | Constant | Description |
---|---|---|
1234 | PHYS_LINK_TYPE_FIXED | Link is fixed and unmovable. Default. Implemented as a 6 degree-of-freedom constraint with no motion in either the linear or angular directions. |
4 | PHYS_LINK_TYPE_HINGE | |
9 | PHYS_LINK_TYPE_SPRING | |
6 | PHYS_LINK_TYPE_6DOF | |
7 | PHYS_LINK_TYPE_SLIDER |
Extended Linksets
void physChangeLinkParams(integer linkNum, list parms)
Flag | Description | Usage |
---|---|---|
PHYS_PARAM_LINK_TYPE | ||
PHYS_PARAM_FRAMEINA_LOC | ||
PHYS_PARAM_FRAMEINA_ROT | ||
PHYS_PARAM_FRAMEINB_LOC | ||
PHYS_PARAM_FRAMEINA_ROT | ||
PHYS_PARAM_LINEAR_LIMIT_LOW | ||
PHYS_PARAM_LINEAR_LIMIT_HIGH | ||
PHYS_PARAM_ANGULAR_LIMIT_LOW | ||
PHYS_PARAM_ANGULAR_LIMIT_HIGH | ||
PHYS_PARAM_USE_FRAME_OFFSET | ||
PHYS_PARAM_ENABLE_TRANSMOTOR | ||
PHYS_PARAM_TRANSMOTOR_MAXVEL | ||
PHYS_PARAM_USE_LINEAR_FRAMEA | ||
PHYS_PARAM_TRANSMOTOR_MAXFORCE | ||
PHYS_PARAM_CFM | ||
PHYS_PARAM_ERP | ||
PHYS_PARAM_SOLVER_ITERATIONS | ||
PHYS_PARAM_SPRING_AXIS_ENABLE | [PHYS_PARAM_SPRING_AXIS_ENABLE, int axisCode, bool flag] | |
PHYS_PARAM_SPRING_DAMPING | [PHYS_PARAM_SPRING_DAMPING, int axisCode, float damping] | |
PHYS_PARAM_SPRING_STIFFNESS | [PHYS_PARAM_SPRING_STIFFNESS, int axisCode, float stiffness] |
Axis Specification
Some of the parameters specify a constraint axis. The axis values mean:
axisCode | constant | meaning |
---|---|---|
0 | PHYS_AXIS_LINEAR_X | X linear axis |
1 | PHYS_AXIS_LINEAR_Y | Y linear axis |
2 | PHYS_AXIS_LINEAR_Z | Z linear axis |
3 | PHYS_AXIS_ANGULAR_X | X angular axis |
4 | PHYS_AXIS_ANGULAR_Y | Y angular axis |
5 | PHYS_AXIS_ANGULAR_Z | Z angular axis |
-1 | PHYS_AXIS_ALL | (-1) make changes to all axis |
-2 | PHYS_AXIS_LINEAR_ALL | all linear axis (X, Y, Z) |
-3 | PHYS_AXIS_ANGULAR_ALL | all angular axis (X, Y, Z) |