class PhysicsImpostor
Name | Type | Description | |
---|---|---|---|
object | IPhysicsEnabledObject | ||
type | number | ||
optional | _options | PhysicsImpostorParameters |
Gets the body that holds this impostor. Either its own, or its parent.
Set the physics body. Used mainly by the physics engine/plugin
this function is executed by the physics engine.
this function is executed by the physics engine.
Legacy collision detection event support
Name | Type | Description | |
---|---|---|---|
e | { body: any } |
Should a new body be generated.
Name | Type | Description | |
---|---|---|---|
updated | boolean |
Force a regeneration of this or the parent's impostor's body.
Use under cautious - This will remove all joints already implemented.
Get a specific parametes from the options parameter.
Name | Type | Description | |
---|---|---|---|
paramName | string |
Sets a specific parameter in the options given to the physics plugin
Name | Type | Description | |
---|---|---|---|
paramName | string | ||
value | number |
Specifically change the body's mass option. Won't recreate the physics body object
Name | Type | Description | |
---|---|---|---|
mass | number |
Name | Type | Description | |
---|---|---|---|
velocity | Nullable<Vector3> |
Name | Type | Description | |
---|---|---|---|
velocity | Nullable<Vector3> |
Execute a function with the physics plugin native code.
Provide a function the will have two variables - the world object and the physics body object.
Name | Type | Description | |||
---|---|---|---|---|---|
func | world | any | |||
physicsBody | any |
Register a function that will be executed before the physics world is stepping forward.
Name | Type | Description | |||
---|---|---|---|---|---|
func | impostor | PhysicsImpostor |
|
Name | Type | Description | |||
---|---|---|---|---|---|
func | impostor | PhysicsImpostor |
|
Register a function that will be executed after the physics step
Name | Type | Description | |||
---|---|---|---|---|---|
func | impostor | PhysicsImpostor |
|
Name | Type | Description | |||
---|---|---|---|---|---|
func | impostor | PhysicsImpostor |
|
register a function that will be executed when this impostor collides against a different body.
Name | Type | Description | |||
---|---|---|---|---|---|
collideAgainst | PhysicsImpostor or Array | ||||
func | collider | PhysicsImpostor | |||
collidedAgainst | PhysicsImpostor |
Name | Type | Description | |||
---|---|---|---|---|---|
collideAgainst | PhysicsImpostor or Array | ||||
func | collider | PhysicsImpostor | |||
collidedAgainst | PhysicsImpostor or Array |
Apply a force
Name | Type | Description | |
---|---|---|---|
force | Vector3 | ||
contactPoint | Vector3 |
Apply an impulse
Name | Type | Description | |
---|---|---|---|
force | Vector3 | ||
contactPoint | Vector3 |
A help function to create a joint.
Name | Type | Description | |
---|---|---|---|
otherImpostor | PhysicsImpostor | ||
jointType | number | ||
jointData | PhysicsJointData |
Add a joint to this impostor with a different impostor.
Name | Type | Description | |
---|---|---|---|
otherImpostor | PhysicsImpostor | ||
joint | PhysicsJoint |
Will keep this body still, in a sleep mode.
Wake the body up.
Name | Type | Description | |
---|---|---|---|
newObject | IPhysicsEnabledObject |
Name | Type | Description | |
---|---|---|---|
position | Vector3 |
Name | Type | Description | |
---|---|---|---|
rotation | Quaternion |
Name | Type | Description | |
---|---|---|---|
result | Vector3 |
Sync a bone with this impostor
Name | Type | Description | |
---|---|---|---|
bone | Bone | The bone to sync to the impostor. | |
boneMesh | AbstractMesh | The mesh that the bone is influencing. | |
jointPivot | Vector3 | The pivot of the joint / bone in local space. | |
optional | distToJoint | number | Optional distance from the impostor to the joint. |
Sync impostor to a bone
Name | Type | Description | |
---|---|---|---|
bone | Bone | The bone that the impostor will be synced to. | |
boneMesh | AbstractMesh | The mesh that the bone is influencing. | |
jointPivot | Vector3 | The pivot of the joint / bone in local space. | |
optional | distToJoint | number | Optional distance from the impostor to the joint. |
optional | adjustRotation | Quaternion | Optional quaternion for adjusting the local rotation of the bone. |