All constraints that track rotation and location of the Pivot relative to each Actor inherit from this. More...
#include <dualtransformconstraint.h>
Public Member Functions | |
virtual | ~DualTransformConstraint () |
Class destructor. | |
virtual Vector3 | GetPivotALocation () const |
Gets the location of the pivot relative to ProxA's Center of gravity. More... | |
virtual Quaternion | GetPivotARotation () const |
Gets the relative rotation for ProxA. More... | |
virtual Transform | GetPivotATransform () const =0 |
Gets the current Rotation and Location of ProxyA. More... | |
virtual Vector3 | GetPivotBLocation () const |
Gets the location of the pivot relative to ProxB's Center of gravity. More... | |
virtual Quaternion | GetPivotBRotation () const |
Gets the relative rotation for ProxB. More... | |
virtual Transform | GetPivotBTransform () const =0 |
Gets the current Rotation and Location of ProxyB. More... | |
virtual void | ProtoDeSerializeInitData (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and initializes a new internal object with it. More... | |
virtual void | ProtoSerializeInitData (XML::Node &SelfRoot) const |
Convert the data needed to initialize this class to an XML::Node ready for serialization. More... | |
virtual void | SetPivotALocation (const Vector3 &Location) |
Sets The relative location of the pivot from ProxA's Center of gravity. More... | |
virtual void | SetPivotARotation (const Quaternion &Rotation) |
Sets The relative rotation of ProxA. More... | |
virtual void | SetPivotATransform (const Transform &TransA)=0 |
Sets the Position and Rotation for the first body using a Transform. More... | |
virtual void | SetPivotBLocation (const Vector3 &Location) |
Sets The relative location of the pivot from ProxB's Center of gravity. More... | |
virtual void | SetPivotBRotation (const Quaternion &Rotation) |
Sets The relative rotation of ProxB. More... | |
virtual void | SetPivotBTransform (const Transform &TransB)=0 |
Sets the Position and Rotation for the second body using a Transform. More... | |
virtual void | SetPivotTransforms (const Transform &TransA, const Transform &TransB) |
Sets the Position and Rotation for the first and second body using a Transform. More... | |
Public Member Functions inherited from Mezzanine::Physics::Constraint | |
virtual | ~Constraint () |
Class destructor. | |
virtual btTypedConstraint * | _GetConstraintBase () const =0 |
Get the Bullet constraint that this class encapsulates. More... | |
virtual void | EnableConstraint (const Boole Enable) |
Enables or disables this constraint. More... | |
virtual Boole | GetAllowCollisions () const |
Gets whether or not collisions can/will occur between the two constrained bodies. More... | |
virtual UInt32 | GetConstraintID () const |
Gets the unique ID of this constraint. More... | |
virtual String | GetDerivedSerializableName () const =0 |
Gets the most derived serializable name of this Constraint. More... | |
virtual Real | GetParam (ConstraintParam Param, int Axis=-1) const |
Gets value of constraint parameters. More... | |
virtual RigidProxy * | GetProxyA () const |
Gets the first Proxy this constraint applies to. More... | |
virtual RigidProxy * | GetProxyB () const |
Gets the second Proxy this constraint applies to. More... | |
virtual AxisList | GetValidAngularAxes () const =0 |
Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation) More... | |
virtual AxisList | GetValidAxes () const |
Get a sorted (low to high) list of All Valid Axis. More... | |
virtual AxisList | GetValidLinearAxes () const =0 |
Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation) More... | |
virtual ParamList | GetValidParams () const |
Get A sorted (low to high) list of Parameters that are valid on all Axis. More... | |
virtual ParamList | GetValidParamsOnAxis (int Axis) const =0 |
Get a sorted (low to high) list of Parameters that are valid on this Axis. More... | |
virtual Boole | HasParamBeenSet (ConstraintParam Param, int Axis) const =0 |
Has the given Param on the Given Axis been set yet. More... | |
virtual Boole | IsConstraintEnabled () const |
Gets whether or not this constraint is enabled. More... | |
virtual Boole | IsParamValidOnAxis (ConstraintParam Param, int Axis) const |
Is a certain Parameter valid on a certain axis. More... | |
virtual void | ProtoDeSerialize (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite this object with it. More... | |
virtual void | ProtoDeSerializeGlobalOverrides (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite the global overrides of this object with it. More... | |
virtual void | ProtoDeSerializeProperties (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite the properties of this object with it. More... | |
virtual void | ProtoSerialize (XML::Node &ParentNode) const |
Convert this class to an XML::Node ready for serialization. More... | |
virtual void | ProtoSerializeGlobalOverrides (XML::Node &SelfRoot) const |
Convert the global overrides of this class to an XML::Node ready for serialization. More... | |
virtual void | ProtoSerializeProperties (XML::Node &SelfRoot) const |
Convert the properties of this class to an XML::Node ready for serialization. More... | |
virtual void | SetAllowCollisions (const Boole Allow) |
Sets whether collisions between the two constrained bodies should occur. More... | |
virtual void | SetParam (ConstraintParam Param, Real Value, int Axis=-1) |
Provides override of constraint parameters. More... | |
Static Public Member Functions | |
static String | GetSerializableName () |
Get the name of the the XML tag the class will leave behind as its instances are serialized. More... | |
Static Public Member Functions inherited from Mezzanine::Physics::Constraint | |
static String | GetSerializableName () |
Get the name of the the XML tag the class will leave behind as its instances are serialized. More... | |
Protected Member Functions | |
DualTransformConstraint (const UInt32 ID, RigidProxy *Prox1, PhysicsManager *Creator) | |
Single body inheritance constructor. More... | |
DualTransformConstraint (const UInt32 ID, RigidProxy *Prox1, RigidProxy *Prox2, PhysicsManager *Creator) | |
Dual body inheritance constructor. More... | |
virtual void | CreateConstraint (RigidProxy *RigidA, RigidProxy *RigidB, const Transform &TransA, const Transform &TransB)=0 |
Creates the internal constraint. More... | |
virtual void | DestroyConstraint ()=0 |
Destroys the internal constraint. More... | |
Protected Member Functions inherited from Mezzanine::Physics::Constraint | |
Constraint (const UInt32 ID, PhysicsManager *Creator) | |
Zero body constructor. More... | |
Constraint (const UInt32 ID, RigidProxy *Prox1, PhysicsManager *Creator) | |
Single body constructor. More... | |
Constraint (const UInt32 ID, RigidProxy *Prox1, RigidProxy *Prox2, PhysicsManager *Creator) | |
Dual body constructor. More... | |
Additional Inherited Members | |
Public Types inherited from Mezzanine::Physics::Constraint | |
typedef std::vector< int > | AxisList |
Used to Store lists of Int Axis for return types. More... | |
typedef std::vector< ConstraintParam > | ParamList |
Used to Store lists of param for return types. | |
Protected Attributes inherited from Mezzanine::Physics::Constraint | |
Boole | AllowCollisions |
Whether or not collisions will be allowed to occure between the constrained bodies. More... | |
UInt32 | ConstraintID |
The unique ID used to identify this constraint. More... | |
Boole | Enabled |
Whether or not the constraint is currently taking effect. More... | |
PhysicsManager * | Manager |
This is a pointer to the physics manager that created and owns this constraint. More... | |
RigidProxy * | ProxA |
The first Collidable this constraint applies to. More... | |
RigidProxy * | ProxB |
The second Collidable this constraint applies to. More... | |
All constraints that track rotation and location of the Pivot relative to each Actor inherit from this.
Since not all contraints provide tracking for the Actor Transform (location/rotation of the pivot) we subdivided the constraints to unify the interface of those that could be unified. This stores nothing, but provides uniform access to the transform and rotation functions.
Any deriving class must implement every thing from TypedConstraint and the four set/get Transform function. It is expected that more derived classes will implement the Set/Get Pivot/Rotation Function in a more efficient Manner if a more efficient way exists. The non-transform get/set function are implmented in terms of the get/set transform function extra copies of values and extra reading/writing may occur if the compiler weakly optimizes. Of course, implementing more functions could slow down the software if it no longer fits in CPU caches. As always benchmark if this is something that may be critically slowing you down.
Definition at line 61 of file dualtransformconstraint.h.
|
protected |
Single body inheritance constructor.
ID | The unique identifier assigned to this constraint. |
Prox1 | A pointer to the first/only proxy that will be constrained. |
Creator | A pointer to the manager that created this constraint. |
Definition at line 54 of file dualtransformconstraint.cpp.
|
protected |
Dual body inheritance constructor.
ID | The unique identifier assigned to this constraint. |
Prox1 | A pointer to the first proxy that will be constrained. |
Prox2 | A pointer to the second proxy that will be constrained. |
Creator | A pointer to the manager that created this constraint. |
Definition at line 58 of file dualtransformconstraint.cpp.
|
protectedpure virtual |
Creates the internal constraint.
RigidA | A pointer to the first Proxy to be constrained. |
RigidB | A pointer to the second Proxy to be constrained. |
TransA | The offset to place the constraint in the first proxys local space. |
TransB | The offset to place the constraint in the second proxys local space. |
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::SliderConstraint, Mezzanine::Physics::UniversalConstraint, Mezzanine::Physics::Generic6DofSpringConstraint, Mezzanine::Physics::Hinge2Constraint, Mezzanine::Physics::ConeTwistConstraint, and Mezzanine::Physics::HingeConstraint.
|
protectedpure virtual |
Destroys the internal constraint.
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::SliderConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::ConeTwistConstraint.
|
virtual |
Gets the location of the pivot relative to ProxA's Center of gravity.
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 77 of file dualtransformconstraint.cpp.
|
virtual |
Gets the relative rotation for ProxA.
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 89 of file dualtransformconstraint.cpp.
|
pure virtual |
Gets the current Rotation and Location of ProxyA.
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.
|
virtual |
Gets the location of the pivot relative to ProxB's Center of gravity.
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 80 of file dualtransformconstraint.cpp.
|
virtual |
Gets the relative rotation for ProxB.
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 92 of file dualtransformconstraint.cpp.
|
pure virtual |
Gets the current Rotation and Location of ProxyB.
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.
|
static |
Get the name of the the XML tag the class will leave behind as its instances are serialized.
Definition at line 160 of file dualtransformconstraint.cpp.
|
virtual |
Take the data stored in an XML Node and initializes a new internal object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Implements Mezzanine::Physics::Constraint.
Definition at line 121 of file dualtransformconstraint.cpp.
|
virtual |
Convert the data needed to initialize this class to an XML::Node ready for serialization.
SelfRoot | The root node containing all the serialized data for this instance. |
Implements Mezzanine::Physics::Constraint.
Definition at line 98 of file dualtransformconstraint.cpp.
|
virtual |
Sets The relative location of the pivot from ProxA's Center of gravity.
Location | The New value for PivotA. |
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 71 of file dualtransformconstraint.cpp.
|
virtual |
Sets The relative rotation of ProxA.
Rotation | The new rotation amount for ProxA. |
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 83 of file dualtransformconstraint.cpp.
|
pure virtual |
Sets the Position and Rotation for the first body using a Transform.
TransA | The new position and rotation. |
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.
|
virtual |
Sets The relative location of the pivot from ProxB's Center of gravity.
Location | The New value for PivotB. |
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 74 of file dualtransformconstraint.cpp.
|
virtual |
Sets The relative rotation of ProxB.
otation | The new rotation amount for ProxB. |
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 86 of file dualtransformconstraint.cpp.
|
pure virtual |
Sets the Position and Rotation for the second body using a Transform.
TransB | The new position and rotation. |
Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.
|
virtual |
Sets the Position and Rotation for the first and second body using a Transform.
TransA | The new position and rotation for ProxyA. |
TransB | The new position and rotation for ProxyB. |
Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.
Definition at line 68 of file dualtransformconstraint.cpp.