#include <PhysicsRigidBody.h>
Classes | |
struct | Parameters |
Public Member Functions | |
PhysicsCollisionObject::Type | getType () const |
float | getMass () const |
float | getFriction () const |
void | setFriction (float friction) |
float | getRestitution () const |
void | setRestitution (float restitution) |
float | getLinearDamping () const |
float | getAngularDamping () const |
void | setDamping (float linearDamping, float angularDamping) |
Vector3 | getLinearVelocity () const |
void | setLinearVelocity (const Vector3 &velocity) |
void | setLinearVelocity (float x, float y, float z) |
Vector3 | getAngularVelocity () const |
void | setAngularVelocity (const Vector3 &velocity) |
void | setAngularVelocity (float x, float y, float z) |
Vector3 | getAnisotropicFriction () const |
void | setAnisotropicFriction (const Vector3 &friction) |
void | setAnisotropicFriction (float x, float y, float z) |
Vector3 | getGravity () const |
void | setGravity (const Vector3 &gravity) |
void | setGravity (float x, float y, float z) |
Vector3 | getAngularFactor () const |
void | setAngularFactor (const Vector3 &angularFactor) |
void | setAngularFactor (float x, float y, float z) |
Vector3 | getLinearFactor () const |
void | setLinearFactor (const Vector3 &linearFactor) |
void | setLinearFactor (float x, float y, float z) |
void | setKinematic (bool kinematic) |
void | setEnabled (bool enable) |
float | getHeight (float x, float z) const |
bool | isStatic () const |
void | applyForce (const Vector3 &force, const Vector3 *relativePosition=NULL) |
void | applyImpulse (const Vector3 &impulse, const Vector3 *relativePosition=NULL) |
void | applyTorque (const Vector3 &torque) |
void | applyTorqueImpulse (const Vector3 &torque) |
Protected Member Functions | |
btCollisionObject * | getCollisionObject () const |
Defines a class for physics rigid bodies.
A rigid body can receive forces and torque to make your objects react to other collision objects around it.
void gameplay::PhysicsRigidBody::applyForce | ( | const Vector3 & | force, |
const Vector3 * | relativePosition = NULL |
||
) |
Applies the given force to the rigid body (optionally, from the given relative position). Note that the total force applied depends on the duration of the next frame. If you want to apply an "impulse" irrespective of the frame duration, consider using applyImpulse.
force | The force to be applied. |
relativePosition | The relative position from which to apply the force. |
void gameplay::PhysicsRigidBody::applyImpulse | ( | const Vector3 & | impulse, |
const Vector3 * | relativePosition = NULL |
||
) |
Applies the given force impulse to the rigid body (optionally, from the given relative position).
impulse | The force impulse to be applied. |
relativePosition | The relative position from which to apply the force. |
void gameplay::PhysicsRigidBody::applyTorque | ( | const Vector3 & | torque | ) |
Applies the given torque to the rigid body.
torque | The torque to be applied. |
void gameplay::PhysicsRigidBody::applyTorqueImpulse | ( | const Vector3 & | torque | ) |
Applies the given torque impulse to the rigid body.
torque | The torque impulse to be applied. |
float gameplay::PhysicsRigidBody::getAngularDamping | ( | ) | const [inline] |
Gets the rigid body's angular damping.
Vector3 gameplay::PhysicsRigidBody::getAngularFactor | ( | ) | const [inline] |
Gets the rigid body's angular factor.
Vector3 gameplay::PhysicsRigidBody::getAngularVelocity | ( | ) | const [inline] |
Gets the rigid body's angular velocity.
Vector3 gameplay::PhysicsRigidBody::getAnisotropicFriction | ( | ) | const [inline] |
Gets the rigid body's anisotropic friction.
btCollisionObject* gameplay::PhysicsRigidBody::getCollisionObject | ( | ) | const [protected, virtual] |
Implements gameplay::PhysicsCollisionObject.
float gameplay::PhysicsRigidBody::getFriction | ( | ) | const [inline] |
Gets the rigid body's friction.
Vector3 gameplay::PhysicsRigidBody::getGravity | ( | ) | const [inline] |
Gets the gravity that affects the rigid body (this can be different from the global gravity;
float gameplay::PhysicsRigidBody::getHeight | ( | float | x, |
float | z | ||
) | const |
Gets the height at the given point (only for rigid bodies of type HEIGHTFIELD).
x | The x position, in world space. |
z | The z position, in world space. |
float gameplay::PhysicsRigidBody::getLinearDamping | ( | ) | const [inline] |
Gets the rigid body's linear damping.
Vector3 gameplay::PhysicsRigidBody::getLinearFactor | ( | ) | const [inline] |
Gets the rigid body's linear factor.
Vector3 gameplay::PhysicsRigidBody::getLinearVelocity | ( | ) | const [inline] |
Gets the rigid body's linear velocity.
float gameplay::PhysicsRigidBody::getMass | ( | ) | const [inline] |
Gets the rigid body's mass.
float gameplay::PhysicsRigidBody::getRestitution | ( | ) | const [inline] |
Gets the rigid body's restitution.
PhysicsCollisionObject::Type gameplay::PhysicsRigidBody::getType | ( | ) | const [virtual] |
Implements gameplay::PhysicsCollisionObject.
bool gameplay::PhysicsRigidBody::isStatic | ( | ) | const |
Gets whether the rigid body is a static rigid body or not.
Reimplemented from gameplay::PhysicsCollisionObject.
void gameplay::PhysicsRigidBody::setAngularFactor | ( | const Vector3 & | angularFactor | ) | [inline] |
Sets the rigid body's angular factor. x, y, z coordinates correspond to world space rotation along these axes. Use 1.0 to allow or 0.0 to disallow rotation along certain axis.
angularFactor | angular factor vector |
void gameplay::PhysicsRigidBody::setAngularFactor | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's angular factor. x, y, z coordinates correspond to world space rotation along these axes. Use 1.0 to allow or 0.0 to disallow rotation along certain axis.
x | The x coordinate of the angular factor vector. |
y | The y coordinate of the angular factor vector. |
z | The z coordinate of the angular factor vector. |
void gameplay::PhysicsRigidBody::setAngularVelocity | ( | const Vector3 & | velocity | ) | [inline] |
Sets the rigid body's angular velocity.
velocity | The angular velocity. |
void gameplay::PhysicsRigidBody::setAngularVelocity | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's angular velocity.
x | The x coordinate of the angular velocity vector. |
y | The y coordinate of the angular velocity vector. |
z | The z coordinate of the angular velocity vector. |
void gameplay::PhysicsRigidBody::setAnisotropicFriction | ( | const Vector3 & | friction | ) | [inline] |
Sets the rigid body's anisotropic friction.
friction | The anisotropic friction. |
void gameplay::PhysicsRigidBody::setAnisotropicFriction | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's anisotropic friction.
x | The x coordinate of the anisotropic friction. |
y | The y coordinate of the anisotropic friction. |
z | The z coordinate of the anisotropic friction. |
void gameplay::PhysicsRigidBody::setDamping | ( | float | linearDamping, |
float | angularDamping | ||
) | [inline] |
Sets the rigid body's linear and angular damping.
linearDamping | The linear damping; between 0.0 (minimum) and 1.0 (maximum). |
angularDamping | The angular damping; between 0.0 (minimum) and 1.0 (maximum). |
void gameplay::PhysicsRigidBody::setEnabled | ( | bool | enable | ) |
Sets whether the rigid body is enabled or disabled in the physics world.
enable | true enables the collision object, false disables it. |
Reimplemented from gameplay::PhysicsCollisionObject.
void gameplay::PhysicsRigidBody::setFriction | ( | float | friction | ) | [inline] |
Sets the rigid body's friction.
friction | The friction. |
void gameplay::PhysicsRigidBody::setGravity | ( | const Vector3 & | gravity | ) | [inline] |
Sets the rigid body's gravity (this overrides the global gravity for this rigid body).
gravity | The gravity. |
void gameplay::PhysicsRigidBody::setGravity | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's gravity (this overrides the global gravity for this rigid body).
x | The x coordinate of the gravity vector. |
y | The y coordinate of the gravity vector. |
z | The z coordinate of the gravity vector. |
void gameplay::PhysicsRigidBody::setKinematic | ( | bool | kinematic | ) |
Sets whether the rigid body is a kinematic rigid body or not.
kinematic | Whether the rigid body is kinematic or not. |
void gameplay::PhysicsRigidBody::setLinearFactor | ( | const Vector3 & | linearFactor | ) | [inline] |
Sets the rigid body's linear factor. x, y, z coordinates correspond to world space motion along these axes. Use 1.0 to allow or 0.0 to disallow motion along certain axis.
linearFactor | linear factor vector |
void gameplay::PhysicsRigidBody::setLinearFactor | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's linear factor. x, y, z coordinates correspond to world space motion along these axes. Use 1.0 to allow or 0.0 to disallow motion along certain axis.
x | The x coordinate of the linear factor vector. |
y | The y coordinate of the linear factor vector. |
z | The z coordinate of the linear factor vector. |
void gameplay::PhysicsRigidBody::setLinearVelocity | ( | const Vector3 & | velocity | ) | [inline] |
Sets the rigid body's linear velocity.
velocity | The linear velocity. |
void gameplay::PhysicsRigidBody::setLinearVelocity | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the rigid body's linear velocity.
x | The x coordinate of the linear velocity vector. |
y | The y coordinate of the linear velocity vector. |
z | The z coordinate of the linear velocity vector. |
void gameplay::PhysicsRigidBody::setRestitution | ( | float | restitution | ) | [inline] |
Sets the rigid body's restitution (or bounciness).
restitution | The restitution. |