Private Member Functions | |
| proto external void | Destroy () |
| Destroys the physics body. | |
| proto external void | SetInteractionLayer (int mask) |
| proto external void | GetWorldTransform (out vector mat[4]) |
| Returns world space transformation of the physics body (including scale). | |
| proto external void | GetDirectWorldTransform (out vector mat[4]) |
| Returns internal world space transformation of the physics body (excluding scale). | |
| proto external void | SetGeomInteractionLayer (int index, int mask) |
| Sets interaction layer mask of the geometry element. | |
| proto external int | GetInteractionLayer () |
| Returns interaction layer mask of the physics body. | |
| proto external bool | HasInteractionEnabled (int mask) |
| Returns true if the physics body has enabled interaction with other body's layer mask. | |
| proto external int | GetGeomInteractionLayer (int index) |
| Returns interaction layer mask of the geometry element. | |
| proto external void | EnableCCD (float maxMotion, float sphereCastRadius) |
| proto external void | ChangeSimulationState (SimulationState simState) |
| Changes simulation state of the physics body. | |
| proto external SimulationState | GetSimulationState () |
| Returns simulation state of the physics body. | |
| proto external vector | GetCenterOfMass () |
| Returns center of mass offset of the physics body. | |
| proto external void | SetActive (ActiveState act) |
| Changes activation state of the physics body. | |
| proto external bool | IsActive () |
| Returns whether the physics body is being simulated (awake). | |
| proto external bool | IsDynamic () |
| Returns whether the physics body is dynamic (a rigid body). | |
| proto external bool | IsKinematic () |
| Returns whether the physics body is kinematic (animated) | |
| proto external bool | EnableGravity (bool enable) |
| Enables gravity on the physics body. | |
| proto external void | SetDamping (float linearDamping, float angularDamping) |
| Changes damping parameters of the physics body. | |
| proto external float | GetMass () |
| Returns mass of the physics body. | |
| proto external void | SetMass (float mass) |
| Changes mass of the physics body. | |
| proto external void | SetInertiaTensorV (vector v) |
| proto external vector | GetAngularVelocity () |
| Returns angular velocity of the physics body. | |
| proto external vector | GetVelocityAt (vector pos) |
| Returns linear velocity of the physics body at a position (world space coordinates). | |
| proto external void | SetSleepingTreshold (float linearTreshold, float angularTreshold) |
| Changes thresholds used to determine whether the physics body can stop simulation. | |
| proto external void | SetLinearFactor (vector linearFactor) |
| Sets scale factor for all impulses/velocities/forces. Default is <1,1,1>. Zero any axis if you want to do 2D physics. | |
| proto external vector | GetVelocity () |
| Returns linear velocity of the physics body. | |
| proto external void | SetVelocity (vector velocity) |
| Sets linear velocity of the physics body. | |
| proto external void | SetAngularVelocity (vector velocity) |
| Sets angular velocity of the physics body. | |
| proto external void | SetTargetMatrix (vector matrix[4], float timeslice) |
| proto external void | ApplyImpulse (vector impulse) |
| Applies impulse on the physics body. | |
| proto external void | ApplyImpulseAt (vector pos, vector impulse) |
| Applies impulse on the physics body at a position (world space coordinates). | |
| proto external void | ApplyForce (vector force) |
| Applies constant force on the physics body (at origin). | |
| proto external void | ApplyForceAt (vector pos, vector force) |
| Applies constant force on the physics body at a position (world space coordinates). | |
| proto external void | ApplyTorque (vector torque) |
| Applies constant torque on the physics body. | |
| proto external void | ClearForces () |
| Clear forces and torques on the physics body. | |
| proto external vector | GetTotalForce () |
| Returns total force currently applied to the physics body. | |
| proto external vector | GetTotalTorque () |
| Returns total torque currently applied to the physics body. | |
| proto external void | SetResponseIndex (int responseIndex) |
| proto external int | GetResponseIndex () |
| Returns actual index to response matrix. | |
| proto external int | AddGeom (string name, PhysicsGeom geom, vector frame[4], string material, int interactionLayer) |
| proto external int | GetGeom (string name) |
| Finds a geometry by its name and returns its index or -1 if the geometry wasn't found. | |
| proto external int | GetNumGeoms () |
| Returns number of geometries of the entity. | |
| proto external bool | UpdateGeometries (int interactionLayerAnd=0xffffffff, int interactionLayerOr=0) |
| Returns world space transformation of a geometry element. | |
| proto external string | GetGeomName (int index) |
| Returns name of a geometry element. | |
| proto external void | GetGeomWorldTransform (int index, out vector mat[4]) |
| Returns world space transformation of a geometry element. | |
| proto external void | GetGeomTransform (int index, out vector mat[4]) |
| Returns entity space transformation of a geometry element. | |
| proto external void | GetGeomDirectTransform (int index, out vector mat[4]) |
| Returns internal physics space transformation of a geometry element. | |
| proto external vector | GetGeomWorldPosition (int index) |
| Returns world space position of a geometry element. | |
| proto external vector | GetGeomPosition (int index) |
| Returns entity space position of a geometry element. | |
| proto external vector | GetGeomDirectPosition (int index) |
| Returns internal physics space position of a geometry element. | |
| proto external void | GetGeomWorldBounds (int index, out vector min, out vector max) |
| Returns world bounds of a geometry element. | |
| proto external void | GetGeomDirectBounds (int index, out vector min, out vector max) |
| Returns internal physics bounds of a geometry element (at scale 1) | |
| proto external void | GetGeomSurfaces (int index, notnull out array< SurfaceProperties > surfaces) |
| Returns all surface properties of a geometry element. | |
| proto external int | GetNumBones () |
| Returns the number of bones. | |
| proto external Physics | GetBone (int index) |
| Returns the bone at the index. | |
| proto external void | Destroy () |
| Destroys the physics body. | |
| proto external void | SetInteractionLayer (int mask) |
| proto external void | GetWorldTransform (out vector mat[4]) |
| Returns world space transformation of the physics body (including scale). | |
| proto external void | GetDirectWorldTransform (out vector mat[4]) |
| Returns internal world space transformation of the physics body (excluding scale). | |
| proto external void | SetGeomInteractionLayer (int index, int mask) |
| Sets interaction layer mask of the geometry element. | |
| proto external int | GetInteractionLayer () |
| Returns interaction layer mask of the physics body. | |
| proto external bool | HasInteractionEnabled (int mask) |
| Returns true if the physics body has enabled interaction with other body's layer mask. | |
| proto external int | GetGeomInteractionLayer (int index) |
| Returns interaction layer mask of the geometry element. | |
| proto external void | EnableCCD (float maxMotion, float sphereCastRadius) |
| proto external void | ChangeSimulationState (SimulationState simState) |
| Changes simulation state of the physics body. | |
| proto external SimulationState | GetSimulationState () |
| Returns simulation state of the physics body. | |
| proto external vector | GetCenterOfMass () |
| Returns center of mass offset of the physics body. | |
| proto external void | SetActive (ActiveState act) |
| Changes activation state of the physics body. | |
| proto external bool | IsActive () |
| Returns whether the physics body is being simulated (awake). | |
| proto external bool | IsDynamic () |
| Returns whether the physics body is dynamic (a rigid body). | |
| proto external bool | IsKinematic () |
| Returns whether the physics body is kinematic (animated) | |
| proto external bool | EnableGravity (bool enable) |
| Enables gravity on the physics body. | |
| proto external void | SetDamping (float linearDamping, float angularDamping) |
| Changes damping parameters of the physics body. | |
| proto external float | GetMass () |
| Returns mass of the physics body. | |
| proto external void | SetMass (float mass) |
| Changes mass of the physics body. | |
| proto external void | SetInertiaTensorV (vector v) |
| proto external vector | GetAngularVelocity () |
| Returns angular velocity of the physics body. | |
| proto external vector | GetVelocityAt (vector pos) |
| Returns linear velocity of the physics body at a position (world space coordinates). | |
| proto external void | SetSleepingTreshold (float linearTreshold, float angularTreshold) |
| Changes thresholds used to determine whether the physics body can stop simulation. | |
| proto external void | SetLinearFactor (vector linearFactor) |
| Sets scale factor for all impulses/velocities/forces. Default is <1,1,1>. Zero any axis if you want to do 2D physics. | |
| proto external vector | GetVelocity () |
| Returns linear velocity of the physics body. | |
| proto external void | SetVelocity (vector velocity) |
| Sets linear velocity of the physics body. | |
| proto external void | SetAngularVelocity (vector velocity) |
| Sets angular velocity of the physics body. | |
| proto external void | SetTargetMatrix (vector matrix[4], float timeslice) |
| proto external void | ApplyImpulse (vector impulse) |
| Applies impulse on the physics body. | |
| proto external void | ApplyImpulseAt (vector pos, vector impulse) |
| Applies impulse on the physics body at a position (world space coordinates). | |
| proto external void | ApplyForce (vector force) |
| Applies constant force on the physics body (at origin). | |
| proto external void | ApplyForceAt (vector pos, vector force) |
| Applies constant force on the physics body at a position (world space coordinates). | |
| proto external void | ApplyTorque (vector torque) |
| Applies constant torque on the physics body. | |
| proto external void | ClearForces () |
| Clear forces and torques on the physics body. | |
| proto external vector | GetTotalForce () |
| Returns total force currently applied to the physics body. | |
| proto external vector | GetTotalTorque () |
| Returns total torque currently applied to the physics body. | |
| proto external void | SetResponseIndex (int responseIndex) |
| proto external int | GetResponseIndex () |
| Returns actual index to response matrix. | |
| proto external int | AddGeom (string name, PhysicsGeom geom, vector frame[4], string material, int interactionLayer) |
| proto external int | GetGeom (string name) |
| Finds a geometry by its name and returns its index or -1 if the geometry wasn't found. | |
| proto external int | GetNumGeoms () |
| Returns number of geometries of the entity. | |
| proto external bool | UpdateGeometries (int interactionLayerAnd=0xffffffff, int interactionLayerOr=0) |
| Returns world space transformation of a geometry element. | |
| proto external string | GetGeomName (int index) |
| Returns name of a geometry element. | |
| proto external void | GetGeomWorldTransform (int index, out vector mat[4]) |
| Returns world space transformation of a geometry element. | |
| proto external void | GetGeomTransform (int index, out vector mat[4]) |
| Returns entity space transformation of a geometry element. | |
| proto external void | GetGeomDirectTransform (int index, out vector mat[4]) |
| Returns internal physics space transformation of a geometry element. | |
| proto external vector | GetGeomWorldPosition (int index) |
| Returns world space position of a geometry element. | |
| proto external vector | GetGeomPosition (int index) |
| Returns entity space position of a geometry element. | |
| proto external vector | GetGeomDirectPosition (int index) |
| Returns internal physics space position of a geometry element. | |
| proto external void | GetGeomWorldBounds (int index, out vector min, out vector max) |
| Returns world bounds of a geometry element. | |
| proto external void | GetGeomDirectBounds (int index, out vector min, out vector max) |
| Returns internal physics bounds of a geometry element (at scale 1) | |
| proto external void | GetGeomSurfaces (int index, notnull out array< SurfaceProperties > surfaces) |
| Returns all surface properties of a geometry element. | |
| proto external int | GetNumBones () |
| Returns the number of bones. | |
| proto external Physics | GetBone (int index) |
| Returns the bone at the index. | |
Static Private Member Functions | |
| static proto Physics | CreateStatic (notnull IEntity ent, int layerMask=0xffffffff) |
| static proto Physics | CreateStaticEx (notnull IEntity ent, PhysicsGeomDef geoms[]) |
| static proto Physics | CreateDynamic (notnull IEntity ent, float mass, int layerMask=0xffffffff) |
| static proto Physics | CreateDynamicEx (notnull IEntity ent, vector centerOfMass, float mass, PhysicsGeomDef geoms[]) |
| static proto Physics | CreateGhostEx (notnull IEntity ent, PhysicsGeomDef geoms[]) |
| static proto Physics | CreateStatic (notnull IEntity ent, int layerMask=0xffffffff) |
| static proto Physics | CreateStaticEx (notnull IEntity ent, PhysicsGeomDef geoms[]) |
| static proto Physics | CreateDynamic (notnull IEntity ent, float mass, int layerMask=0xffffffff) |
| static proto Physics | CreateDynamicEx (notnull IEntity ent, vector centerOfMass, float mass, PhysicsGeomDef geoms[]) |
| static proto Physics | CreateGhostEx (notnull IEntity ent, PhysicsGeomDef geoms[]) |
Static Private Attributes | |
| static const float | KMH2MS = 1 / 3.6 |
| static const float | MS2KMH = 3.6 |
| static const float | STANDARD_GRAVITY = 9.81 |
| static const vector | VGravity = "0 -9.81 0" |
|
private |
Adds new geometry and returns an index of the geometry or -1 when an error occurred
|
private |
Adds new geometry and returns an index of the geometry or -1 when an error occurred
|
private |
Applies constant force on the physics body (at origin).
|
private |
Applies constant force on the physics body (at origin).
Applies constant force on the physics body at a position (world space coordinates).
Applies constant force on the physics body at a position (world space coordinates).
|
private |
Applies impulse on the physics body.
|
private |
Applies impulse on the physics body.
Applies impulse on the physics body at a position (world space coordinates).
Applies impulse on the physics body at a position (world space coordinates).
|
private |
Applies constant torque on the physics body.
|
private |
Applies constant torque on the physics body.
|
private |
Changes simulation state of the physics body.
|
private |
Changes simulation state of the physics body.
|
private |
Clear forces and torques on the physics body.
|
private |
Clear forces and torques on the physics body.
|
staticprivate |
Creates a dynamic physics body from geometry embedded in attached VObject. If there is not any, false is returned.
| ent | Entity that will be associated with the physics body |
| mass | Body mass |
| layerMask | Bit mask of layers that is ANDed with layers in object geometry. Use 0xffffffff if you want to keep it unmodified |
|
staticprivate |
Creates a dynamic physics body from geometry embedded in attached VObject. If there is not any, false is returned.
| ent | Entity that will be associated with the physics body |
| mass | Body mass |
| layerMask | Bit mask of layers that is ANDed with layers in object geometry. Use 0xffffffff if you want to keep it unmodified |
|
staticprivate |
Creates a dynamic physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| centerOfMass | Offset from object-pivot to center of mass |
| mass | Body mass |
| geoms | Array of custom made geometries |
|
staticprivate |
Creates a dynamic physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| centerOfMass | Offset from object-pivot to center of mass |
| mass | Body mass |
| geoms | Array of custom made geometries |
|
staticprivate |
Creates a ghost physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| geoms | Array of custom made geometries |
|
staticprivate |
Creates a ghost physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| geoms | Array of custom made geometries |
Creates a static physics body from geometry embedded in attached VObject. If there is not any, false is returned.
| ent | Entity that will be associated with the physics body |
| layerMask | Bit mask of layers that is ANDed with layers in object geometry. Use 0xffffffff if you want to keep it unmodified |
Creates a static physics body from geometry embedded in attached VObject. If there is not any, false is returned.
| ent | Entity that will be associated with the physics body |
| layerMask | Bit mask of layers that is ANDed with layers in object geometry. Use 0xffffffff if you want to keep it unmodified |
|
staticprivate |
Creates a static physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| geoms | Array of custom made geometries |
|
staticprivate |
Creates a static physics body from custom made geometries. The geometries are deleted when rigid body is destroyed.
| ent | Entity that will be associated with the physics body |
| geoms | Array of custom made geometries |
|
private |
Destroys the physics body.
|
private |
Destroys the physics body.
Changes state of the continuous collision detection (CCD). If both maxMotion and shapeCastRadius is >=0 then the CCD is enabled. If you want to disable it, use -1.
| maxMotion | Max motion threshold when sphere-cast is performed, to find time of impact. It should be little bit less than size of the geometry to catch the situation when tunneling can happen. |
| sphereCastRadius | The radius of the largest possible sphere, that is completely inside the body geometry. |
Changes state of the continuous collision detection (CCD). If both maxMotion and shapeCastRadius is >=0 then the CCD is enabled. If you want to disable it, use -1.
| maxMotion | Max motion threshold when sphere-cast is performed, to find time of impact. It should be little bit less than size of the geometry to catch the situation when tunneling can happen. |
| sphereCastRadius | The radius of the largest possible sphere, that is completely inside the body geometry. |
|
private |
Returns angular velocity of the physics body.
|
private |
Returns angular velocity of the physics body.
|
private |
Returns center of mass offset of the physics body.
|
private |
Returns center of mass offset of the physics body.
|
private |
Returns internal world space transformation of the physics body (excluding scale).
|
private |
Returns internal world space transformation of the physics body (excluding scale).
Finds a geometry by its name and returns its index or -1 if the geometry wasn't found.
Finds a geometry by its name and returns its index or -1 if the geometry wasn't found.
Returns internal physics bounds of a geometry element (at scale 1)
Returns internal physics bounds of a geometry element (at scale 1)
Returns internal physics space position of a geometry element.
Returns internal physics space position of a geometry element.
Returns internal physics space transformation of a geometry element.
Returns internal physics space transformation of a geometry element.
Returns interaction layer mask of the geometry element.
Returns interaction layer mask of the geometry element.
Returns entity space position of a geometry element.
Returns entity space position of a geometry element.
|
private |
Returns all surface properties of a geometry element.
|
private |
Returns all surface properties of a geometry element.
Returns entity space transformation of a geometry element.
Returns entity space transformation of a geometry element.
Returns world bounds of a geometry element.
Returns world bounds of a geometry element.
Returns world space position of a geometry element.
Returns world space position of a geometry element.
Returns world space transformation of a geometry element.
Returns world space transformation of a geometry element.
|
private |
Returns interaction layer mask of the physics body.
|
private |
Returns interaction layer mask of the physics body.
|
private |
Returns mass of the physics body.
|
private |
Returns mass of the physics body.
|
private |
Returns the number of bones.
|
private |
Returns the number of bones.
|
private |
Returns number of geometries of the entity.
|
private |
Returns number of geometries of the entity.
|
private |
Returns actual index to response matrix.
|
private |
Returns actual index to response matrix.
|
private |
Returns simulation state of the physics body.
|
private |
Returns simulation state of the physics body.
|
private |
Returns total force currently applied to the physics body.
|
private |
Returns total force currently applied to the physics body.
|
private |
Returns total torque currently applied to the physics body.
|
private |
Returns total torque currently applied to the physics body.
|
private |
Returns linear velocity of the physics body.
|
private |
Returns linear velocity of the physics body.
Returns linear velocity of the physics body at a position (world space coordinates).
Returns linear velocity of the physics body at a position (world space coordinates).
|
private |
Returns world space transformation of the physics body (including scale).
|
private |
Returns world space transformation of the physics body (including scale).
Returns true if the physics body has enabled interaction with other body's layer mask.
Returns true if the physics body has enabled interaction with other body's layer mask.
|
private |
Returns whether the physics body is being simulated (awake).
|
private |
Returns whether the physics body is being simulated (awake).
|
private |
Returns whether the physics body is dynamic (a rigid body).
|
private |
Returns whether the physics body is dynamic (a rigid body).
|
private |
Returns whether the physics body is kinematic (animated)
|
private |
Returns whether the physics body is kinematic (animated)
|
private |
Changes activation state of the physics body.
|
private |
Changes activation state of the physics body.
|
private |
Sets angular velocity of the physics body.
|
private |
Sets angular velocity of the physics body.
Changes damping parameters of the physics body.
Changes damping parameters of the physics body.
Sets interaction layer mask of the geometry element.
Sets interaction layer mask of the geometry element.
|
private |
Changes inertia tensor of the physics body.
| v | Diagonal elements of the inertia tensor (a rigid body is aligned with the principle axes of inertia) |
|
private |
Changes inertia tensor of the physics body.
| v | Diagonal elements of the inertia tensor (a rigid body is aligned with the principle axes of inertia) |
|
private |
Sets interaction layer mask of the physics body.
| mask | Bit mask of layers |
|
private |
Sets interaction layer mask of the physics body.
| mask | Bit mask of layers |
|
private |
Sets scale factor for all impulses/velocities/forces. Default is <1,1,1>. Zero any axis if you want to do 2D physics.
|
private |
Sets scale factor for all impulses/velocities/forces. Default is <1,1,1>. Zero any axis if you want to do 2D physics.
|
private |
Changes mass of the physics body.
|
private |
Changes mass of the physics body.
|
private |
Changes index to response matrix, see "project settings/physics/interactions/response matrix". Usually this index is set by physics component property, but can be overriden at runtime.
|
private |
Changes index to response matrix, see "project settings/physics/interactions/response matrix". Usually this index is set by physics component property, but can be overriden at runtime.
Changes thresholds used to determine whether the physics body can stop simulation.
Changes thresholds used to determine whether the physics body can stop simulation.
Sets target transformation. If timeslice == dt (simulation step delta time), it will happen in next step, otherwise in time = timeslice.
Sets target transformation. If timeslice == dt (simulation step delta time), it will happen in next step, otherwise in time = timeslice.
|
private |
Sets linear velocity of the physics body.
|
private |
Sets linear velocity of the physics body.
|
private |
Returns world space transformation of a geometry element.
|
private |
Returns world space transformation of a geometry element.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |