#include <PhysicsConstraint.h>
Public Member Functions | |
| float | getBreakingImpulse () const |
| void | setBreakingImpulse (float impulse) |
| bool | isEnabled () const |
| void | setEnabled (bool enabled) |
Static Public Member Functions | |
| static Vector3 | centerOfMassMidpoint (const Node *a, const Node *b) |
| static Quaternion | getRotationOffset (const Node *node, const Vector3 &point) |
| static Vector3 | getTranslationOffset (const Node *node, const Vector3 &point) |
Protected Member Functions | |
| PhysicsConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b) | |
| virtual | ~PhysicsConstraint () |
Static Protected Member Functions | |
| static btTransform | getTransformOffset (const Node *node, const Vector3 &origin) |
| static Vector3 | getWorldCenterOfMass (const Node *node) |
| static Vector3 | offsetByCenterOfMass (const Node *node, const Vector3 &v) |
Protected Attributes | |
| PhysicsRigidBody * | _a |
| PhysicsRigidBody * | _b |
| btTypedConstraint * | _constraint |
Defines the base class for physics constraints.
| gameplay::PhysicsConstraint::PhysicsConstraint | ( | PhysicsRigidBody * | a, |
| PhysicsRigidBody * | b | ||
| ) | [protected] |
Constructor.
| virtual gameplay::PhysicsConstraint::~PhysicsConstraint | ( | ) | [protected, virtual] |
Destructor.
| static Vector3 gameplay::PhysicsConstraint::centerOfMassMidpoint | ( | const Node * | a, |
| const Node * | b | ||
| ) | [static] |
Calculates the midpoint between the given nodes' centers of mass.
| a | The first node. |
| b | The second node. |
| float gameplay::PhysicsConstraint::getBreakingImpulse | ( | ) | const [inline] |
Gets the impulse needed to break the constraint.
| static Quaternion gameplay::PhysicsConstraint::getRotationOffset | ( | const Node * | node, |
| const Vector3 & | point | ||
| ) | [static] |
Calculates the rotation offset to the given point in the given node's local space.
| node | The node to calculate a rotation offset for. |
| point | The point to calculate the rotation offset to. |
| static btTransform gameplay::PhysicsConstraint::getTransformOffset | ( | const Node * | node, |
| const Vector3 & | origin | ||
| ) | [static, protected] |
Calculates the transform to be used as the offset (i.e. "frame in" parameter in Bullet terms) to the given constraint origin.
| static Vector3 gameplay::PhysicsConstraint::getTranslationOffset | ( | const Node * | node, |
| const Vector3 & | point | ||
| ) | [static] |
Calculates the translation offset to the given point in the given node's local space.
| node | The node to calculate a translation offset for. |
| point | The point to calculate the translation offset to. |
| static Vector3 gameplay::PhysicsConstraint::getWorldCenterOfMass | ( | const Node * | node | ) | [static, protected] |
Calculates the center of mass in world space of the given node.
| bool gameplay::PhysicsConstraint::isEnabled | ( | ) | const [inline] |
Gets whether the constraint is enabled or not.
| static Vector3 gameplay::PhysicsConstraint::offsetByCenterOfMass | ( | const Node * | node, |
| const Vector3 & | v | ||
| ) | [static, protected] |
Offsets the given vector by the given node's center of mass.
| void gameplay::PhysicsConstraint::setBreakingImpulse | ( | float | impulse | ) | [inline] |
Sets the impulse needed to break the constraint (if an impulse greater than or equal to the given value is applied to the constraint, the constraint will be broken).
| impulse | The impulse needed to break the constraint. |
| void gameplay::PhysicsConstraint::setEnabled | ( | bool | enabled | ) | [inline] |
Sets whether the constraint is enabled or not.
| enabled | Whether the constraint is enabled or not. |
PhysicsRigidBody* gameplay::PhysicsConstraint::_a [protected] |
Pointer to the one rigid body bound by this constraint.
PhysicsRigidBody* gameplay::PhysicsConstraint::_b [protected] |
Pointer to the other rigid body bound by this constraint.
btTypedConstraint* gameplay::PhysicsConstraint::_constraint [protected] |
Pointer to the Bullet constraint.
1.7.6.1