|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions
gameplay::PhysicsGenericConstraint Class Reference

`#include <PhysicsGenericConstraint.h>`

Inheritance diagram for gameplay::PhysicsGenericConstraint:

List of all members.

## Public Member Functions

const Quaternion & | getRotationOffsetA () const
const Quaternion & | getRotationOffsetB () const
const Vector3 & | getTranslationOffsetA () const
const Vector3 & | getTranslationOffsetB () const
void | setAngularLowerLimit (const Vector3 &limits)
void | setAngularUpperLimit (const Vector3 &limits)
void | setLinearLowerLimit (const Vector3 &limits)
void | setLinearUpperLimit (const Vector3 &limits)
void | setRotationOffsetA (const Quaternion &rotationOffset)
void | setRotationOffsetB (const Quaternion &rotationOffset)
void | setTranslationOffsetA (const Vector3 &translationOffset)
void | setTranslationOffsetB (const Vector3 &translationOffset)

## Protected Member Functions

| PhysicsGenericConstraint ()
| PhysicsGenericConstraint (PhysicsRigidBody *a, PhysicsRigidBody *b)
| PhysicsGenericConstraint (PhysicsRigidBody *a, const Quaternion &rotationOffsetA, const Vector3 &translationOffsetA, PhysicsRigidBody *b, const Quaternion &rotationOffsetB, const Vector3 &translationOffsetB)
virtual | ~PhysicsGenericConstraint ()

## Detailed Description

Defines a completely generic constraint between two rigid bodies (or one rigid body and the world) where the limits for all six degrees of freedom can be set individually.

See also:
  http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-Constraints

## Constructor & Destructor Documentation

gameplay::PhysicsGenericConstraint::PhysicsGenericConstraint | ( |  | ) | `[protected]`

Constructor.

Note: This should only used by subclasses that do not want the _constraint member variable to be initialized.

gameplay::PhysicsGenericConstraint::PhysicsGenericConstraint | ( | PhysicsRigidBody * | a,
|  | PhysicsRigidBody * | b
| ) |  | `[protected]`

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).

gameplay::PhysicsGenericConstraint::PhysicsGenericConstraint | ( | PhysicsRigidBody * | a,
|  | const Quaternion & | rotationOffsetA,
|  | const Vector3 & | translationOffsetA,
|  | PhysicsRigidBody * | b,
|  | const Quaternion & | rotationOffsetB,
|  | const Vector3 & | translationOffsetB
| ) |  | `[protected]`

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).

virtual gameplay::PhysicsGenericConstraint::~PhysicsGenericConstraint | ( |  | ) | `[protected, virtual]`

Destructor.

## Member Function Documentation

const Quaternion& gameplay::PhysicsGenericConstraint::getRotationOffsetA | ( |  | ) | const`[inline]`

Gets the rotation offset for the first rigid body in the constraint.

Returns:
  The rotation offset.

const Quaternion& gameplay::PhysicsGenericConstraint::getRotationOffsetB | ( |  | ) | const`[inline]`

Gets the rotation offset for the second rigid body in the constraint.

Returns:
  The rotation offset.

const Vector3& gameplay::PhysicsGenericConstraint::getTranslationOffsetA | ( |  | ) | const`[inline]`

Gets the translation offset for the first rigid body in the constraint.

Returns:
  The translation offset.

const Vector3& gameplay::PhysicsGenericConstraint::getTranslationOffsetB | ( |  | ) | const`[inline]`

Gets the translation offset for the second rigid body in the constraint.

Returns:
  The translation offset.

void gameplay::PhysicsGenericConstraint::setAngularLowerLimit | ( | const Vector3 & | limits | ) | `[inline]`

Sets the lower angular limits (as Euler angle limits) along the constraint's local X, Y, and Z axes using the values in the given vector.

Parameters:

  limits | The lower angular limits (as Euler angle limits) along the local X, Y, and Z axes.

Reimplemented in gameplay::PhysicsFixedConstraint.

void gameplay::PhysicsGenericConstraint::setAngularUpperLimit | ( | const Vector3 & | limits | ) | `[inline]`

Sets the upper angular limits (as Euler angle limits) along the constraint's local X, Y, and Z axes using the values in the given vector.

Parameters:

  limits | The upper angular limits (as Euler angle limits) along the local X, Y, and Z axes.

Reimplemented in gameplay::PhysicsFixedConstraint.

void gameplay::PhysicsGenericConstraint::setLinearLowerLimit | ( | const Vector3 & | limits | ) | `[inline]`

Sets the lower linear limits along the constraint's local X, Y, and Z axes using the values in the given vector.

Parameters:

  limits | The lower linear limits along the local X, Y, and Z axes.

Reimplemented in gameplay::PhysicsFixedConstraint.

void gameplay::PhysicsGenericConstraint::setLinearUpperLimit | ( | const Vector3 & | limits | ) | `[inline]`

Sets the upper linear limits along the constraint's local X, Y, and Z axes using the values in the given vector.

Parameters:

  limits | The upper linear limits along the local X, Y, and Z axes.

Reimplemented in gameplay::PhysicsFixedConstraint.

void gameplay::PhysicsGenericConstraint::setRotationOffsetA | ( | const Quaternion & | rotationOffset | ) | `[inline]`

Sets the rotation offset for the first rigid body in the constraint.

Parameters:

  rotationOffset | The rotation offset.

void gameplay::PhysicsGenericConstraint::setRotationOffsetB | ( | const Quaternion & | rotationOffset | ) | `[inline]`

Sets the rotation offset for the second rigid body in the constraint.

Parameters:

  rotationOffset | The rotation offset.

void gameplay::PhysicsGenericConstraint::setTranslationOffsetA | ( | const Vector3 & | translationOffset | ) | `[inline]`

Sets the translation offset for the first rigid body in the constraint.

Parameters:

  translationOffset | The translation offset.

void gameplay::PhysicsGenericConstraint::setTranslationOffsetB | ( | const Vector3 & | translationOffset | ) | `[inline]`

Sets the translation offset for the second rigid body in the constraint.

Parameters:

  translationOffset | The translation offset.

All Classes Functions Variables Typedefs Enumerations Enumerator