PhysicsBody

Engine/source/T3D/physics/physicsBody.h

Simple physics object that represents a single rigid body.

More...

Public Types

enum
_Anonymous_ {
  BF_TRIGGER = BIT( 0 )
  BF_KINEMATIC = BIT( 1 )
  BF_DEBRIS = BIT( 2 )
}

Public Functions

findContact(SceneObject ** contactObject, VectorF * contactNormal, Vector< SceneObject * > * outOverlapObjects)

Returns the collision shape used to create the body.

bool
init(PhysicsCollision * shape, F32 mass, U32 bodyFlags, SceneObject * obj, PhysicsWorld * world)

Initialize the body with a collision shape and basic physics properties.

bool

Returns true if the object is a dynamic rigid body animated by the physics simulation.

bool
setDamping(F32 linear, F32 angular)
setMaterial(F32 restitution, F32 friction, F32 staticFriction)
setSleeping(bool sleeping)
setSleepThreshold(F32 linear, F32 angular)

Detailed Description

Simple physics object that represents a single rigid body.

Public Types

@195

Enumerator

BF_TRIGGER = BIT( 0 )

Marks the body as a trigger object which is only used to get collision events and not get collision response.

BF_KINEMATIC = BIT( 1 )

The body is kinematic and assumed to be moved by the game code via transforms.

BF_DEBRIS = BIT( 2 )

The body responds to contacts but does not push forces into others.

Public Functions

~PhysicsBody()

applyCorrection(const MatrixF & xfm)

Reimplemented by: BtBody, Px3Body

applyForce(const Point3F & force)

Reimplemented by: BtBody, Px3Body

applyImpulse(const Point3F & origin, const Point3F & force)

Reimplemented by: BtBody, Px3Body

applyTorque(const Point3F & torque)

Reimplemented by: BtBody, Px3Body

findContact(SceneObject ** contactObject, VectorF * contactNormal, Vector< SceneObject * > * outOverlapObjects)

Reimplemented by: BtBody, Px3Body

getAngVelocity()

Reimplemented by: BtBody, Px3Body

getCMassPosition()

Reimplemented by: BtBody, Px3Body

getColShape()

Returns the collision shape used to create the body.

Reimplemented by: BtBody, Px3Body

getLinVelocity()

Reimplemented by: BtBody, Px3Body

getMass()

Reimplemented by: BtBody, Px3Body

getState(PhysicsState * outState)

Reimplemented by: BtBody, Px3Body

init(PhysicsCollision * shape, F32 mass, U32 bodyFlags, SceneObject * obj, PhysicsWorld * world)

Initialize the body with a collision shape and basic physics properties.

Reimplemented by: BtBody, Px3Body

isDynamic()

Returns true if the object is a dynamic rigid body animated by the physics simulation.

Kinematics are not considered to be dynamic.

Reimplemented by: BtBody, Px3Body

isValid()

Reimplemented by: BtBody

moveKinematicTo(const MatrixF & xfm)

Reimplemented by: BtBody, Px3Body

setAngVelocity(const Point3F & vel)

Reimplemented by: BtBody, Px3Body

setDamping(F32 linear, F32 angular)

Reimplemented by: BtBody, Px3Body

setLinVelocity(const Point3F & vel)

Reimplemented by: BtBody, Px3Body

setMaterial(F32 restitution, F32 friction, F32 staticFriction)

Reimplemented by: BtBody, Px3Body

setSleeping(bool sleeping)

Reimplemented by: BtBody, Px3Body

setSleepThreshold(F32 linear, F32 angular)

Reimplemented by: BtBody, Px3Body