#include <PhysicsController.h>
List of all members.
Classes |
| class | CollisionCallback |
| struct | CollisionInfo |
| class | DebugDrawer |
| class | HitFilter |
| struct | HitResult |
| class | Listener |
Public Member Functions |
| const char * | getTypeName () const |
| void | addStatusListener (PhysicsController::Listener *listener) |
| void | removeStatusListener (Listener *listener) |
| PhysicsFixedConstraint * | createFixedConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b=NULL) |
| PhysicsGenericConstraint * | createGenericConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b=NULL) |
| PhysicsGenericConstraint * | createGenericConstraint (PhysicsRigidBody *a, const Quaternion &rotationOffsetA, const Vector3 &translationOffsetA, PhysicsRigidBody *b=NULL, const Quaternion &rotationOffsetB=Quaternion(), const Vector3 &translationOffsetB=Vector3()) |
| PhysicsHingeConstraint * | createHingeConstraint (PhysicsRigidBody *a, const Quaternion &rotationOffsetA, const Vector3 &translationOffsetA, PhysicsRigidBody *b=NULL, const Quaternion &rotationOffsetB=Quaternion(), const Vector3 &translationOffsetB=Vector3()) |
| PhysicsSocketConstraint * | createSocketConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b=NULL) |
| PhysicsSocketConstraint * | createSocketConstraint (PhysicsRigidBody *a, const Vector3 &translationOffsetA, PhysicsRigidBody *b=NULL, const Vector3 &translationOffsetB=Vector3()) |
| PhysicsSpringConstraint * | createSpringConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b) |
| PhysicsSpringConstraint * | createSpringConstraint (PhysicsRigidBody *a, const Quaternion &rotationOffsetA, const Vector3 &translationOffsetA, PhysicsRigidBody *b, const Quaternion &rotationOffsetB, const Vector3 &translationOffsetB) |
| const Vector3 & | getGravity () const |
| void | setGravity (const Vector3 &gravity) |
| void | drawDebug (const Matrix &viewProjection) |
| bool | rayTest (const Ray &ray, float distance, PhysicsController::HitResult *result=NULL, PhysicsController::HitFilter *filter=NULL) |
| bool | sweepTest (PhysicsCollisionObject *object, const Vector3 &endPosition, PhysicsController::HitResult *result=NULL, PhysicsController::HitFilter *filter=NULL) |
Detailed Description
Member Function Documentation
Adds a listener to the physics controller.
- Parameters:
-
| listener | The listener to add. |
Creates a fixed constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| b | The second rigid body to constrain (optional). |
- Returns:
- Pointer to the created PhysicsFixedConstraint object.
Creates a generic constraint so that the rigid body (or bodies) is (are) constrained to its (their) current world position(s).
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| b | The second rigid body to constrain (optional). |
- Returns:
- Pointer to the created PhysicsGenericConstraint object.
Creates a generic constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| rotationOffsetA | The rotation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| translationOffsetA | The translation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| b | The second rigid body to constrain (optional). |
| rotationOffsetB | The rotation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
| translationOffsetB | The translation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
- Returns:
- Pointer to the created PhysicsGenericConstraint object.
Creates a hinge constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| rotationOffsetA | The rotation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| translationOffsetA | The translation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| b | The second rigid body to constrain (optional). |
| rotationOffsetB | The rotation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
| translationOffsetB | The translation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
- Returns:
- Pointer to the created PhysicsHingeConstraint object.
Creates a socket constraint so that the rigid body (or bodies) is (are) constrained using its (their) current world position(s) for the translation offset(s) to the constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| b | The second rigid body to constrain (optional). |
- Returns:
- Pointer to the created PhysicsSocketConstraint object.
Creates a socket constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| translationOffsetA | The translation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| b | The second rigid body to constrain (optional). |
| translationOffsetB | The translation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
- Returns:
- Pointer to the created PhysicsSocketConstraint object.
Creates a spring constraint so that the rigid body (or bodies) is (are) constrained using its (their) current world position(s) for the translation offset(s) to the constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| b | The second rigid body to constrain (optional). |
- Returns:
- Pointer to the created PhysicsSpringConstraint object.
Creates a spring constraint.
- Parameters:
-
| a | The first (possibly only) rigid body to constrain. If this is the only rigid body specified the constraint applies between it and the global physics world object. |
| rotationOffsetA | The rotation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| translationOffsetA | The translation offset for the first rigid body (in its local space) with respect to the constraint joint. |
| b | The second rigid body to constrain (optional). |
| rotationOffsetB | The rotation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
| translationOffsetB | The translation offset for the second rigid body (in its local space) with respect to the constraint joint (optional). |
- Returns:
- Pointer to the created PhysicsSpringConstraint object.
Draws debugging information (rigid body outlines, etc.) using the given view projection matrix.
- Parameters:
-
| viewProjection | The view projection matrix to use when drawing. |
Gets the gravity vector for the simulated physics world.
- Returns:
- The gravity vector.
Performs a ray test on the physics world.
- Parameters:
-
| ray | The ray to test intersection with. |
| distance | How far along the given ray to test for intersections. |
| result | Optional pointer to a HitTest structure to store the hit test result information in. When using a default (or no) filter, this will always be the closest object hit. Otherwise, if using a custom filter, it will be the last object passed to the HitFilter::hit method (which is not necessarily the closest or furthest). |
| filter | Optional filter pointer used to control which objects are tested. |
- Returns:
- True if the ray test collided with a physics object, false otherwise.
Removes a listener to the physics controller.
- Parameters:
-
| listener | The listener to remove. |
Sets the gravity vector for the simulated physics world.
- Parameters:
-
| gravity | The gravity vector. |
Performs a sweep test of the given collision object on the physics world.
The start position of the sweep test is defined by the current world position of the specified collision object.
- Parameters:
-
| object | The collision object to test. |
| endPosition | The end position of the sweep test, in world space. |
| result | Optional pointer to a HitTest structure to store the hit test result information in. When using a default (or no) filter, this will always be the closest object hit. Otherwise, if using a custom filter, it will be the last object passed to the HitFilter::hit method (which is not necessarily the closest or furthest). |
| filter | Optional filter pointer used to control which objects are tested. |
- Returns:
- True if the object intersects any other physics objects, false otherwise.