Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Mezzanine::Physics::DualTransformConstraint Class Referenceabstract

All constraints that track rotation and location of the Pivot relative to each Actor inherit from this. More...

#include <dualtransformconstraint.h>

+ Inheritance diagram for Mezzanine::Physics::DualTransformConstraint:
+ Collaboration diagram for Mezzanine::Physics::DualTransformConstraint:

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 RigidProxyGetProxyA () const
 Gets the first Proxy this constraint applies to. More...
 
virtual RigidProxyGetProxyB () 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< ConstraintParamParamList
 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...
 
PhysicsManagerManager
 This is a pointer to the physics manager that created and owns this constraint. More...
 
RigidProxyProxA
 The first Collidable this constraint applies to. More...
 
RigidProxyProxB
 The second Collidable this constraint applies to. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Mezzanine::Physics::DualTransformConstraint::DualTransformConstraint ( const UInt32  ID,
RigidProxy Prox1,
PhysicsManager Creator 
)
protected

Single body inheritance constructor.

Parameters
IDThe unique identifier assigned to this constraint.
Prox1A pointer to the first/only proxy that will be constrained.
CreatorA pointer to the manager that created this constraint.

Definition at line 54 of file dualtransformconstraint.cpp.

Mezzanine::Physics::DualTransformConstraint::DualTransformConstraint ( const UInt32  ID,
RigidProxy Prox1,
RigidProxy Prox2,
PhysicsManager Creator 
)
protected

Dual body inheritance constructor.

Parameters
IDThe unique identifier assigned to this constraint.
Prox1A pointer to the first proxy that will be constrained.
Prox2A pointer to the second proxy that will be constrained.
CreatorA pointer to the manager that created this constraint.

Definition at line 58 of file dualtransformconstraint.cpp.

Member Function Documentation

virtual void Mezzanine::Physics::DualTransformConstraint::CreateConstraint ( RigidProxy RigidA,
RigidProxy RigidB,
const Transform TransA,
const Transform TransB 
)
protectedpure virtual

Creates the internal constraint.

Remarks
This methods exists primarily as a convenience for serialization, and shouldn't be called unless it is known to be safe.
Parameters
RigidAA pointer to the first Proxy to be constrained.
RigidBA pointer to the second Proxy to be constrained.
TransAThe offset to place the constraint in the first proxys local space.
TransBThe 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.

virtual void Mezzanine::Physics::DualTransformConstraint::DestroyConstraint ( )
protectedpure virtual

Destroys the internal constraint.

Remarks
This methods exists primarily as a convenience for serialization, and shouldn't be called unless it is known to be safe.

Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::SliderConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::ConeTwistConstraint.

Vector3 Mezzanine::Physics::DualTransformConstraint::GetPivotALocation ( ) const
virtual

Gets the location of the pivot relative to ProxA's Center of gravity.

Returns
A Vector3 with the pivot location.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 77 of file dualtransformconstraint.cpp.

Quaternion Mezzanine::Physics::DualTransformConstraint::GetPivotARotation ( ) const
virtual

Gets the relative rotation for ProxA.

Returns
A Quaternion that has the rotation.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 89 of file dualtransformconstraint.cpp.

virtual Transform Mezzanine::Physics::DualTransformConstraint::GetPivotATransform ( ) const
pure virtual
Vector3 Mezzanine::Physics::DualTransformConstraint::GetPivotBLocation ( ) const
virtual

Gets the location of the pivot relative to ProxB's Center of gravity.

Returns
A Vector3 with the pivot location.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 80 of file dualtransformconstraint.cpp.

Quaternion Mezzanine::Physics::DualTransformConstraint::GetPivotBRotation ( ) const
virtual

Gets the relative rotation for ProxB.

Returns
A Quaternion that has the rotation.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 92 of file dualtransformconstraint.cpp.

virtual Transform Mezzanine::Physics::DualTransformConstraint::GetPivotBTransform ( ) const
pure virtual
String Mezzanine::Physics::DualTransformConstraint::GetSerializableName ( )
static

Get the name of the the XML tag the class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

Definition at line 160 of file dualtransformconstraint.cpp.

void Mezzanine::Physics::DualTransformConstraint::ProtoDeSerializeInitData ( const XML::Node SelfRoot)
virtual

Take the data stored in an XML Node and initializes a new internal object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Implements Mezzanine::Physics::Constraint.

Definition at line 121 of file dualtransformconstraint.cpp.

void Mezzanine::Physics::DualTransformConstraint::ProtoSerializeInitData ( XML::Node SelfRoot) const
virtual

Convert the data needed to initialize this class to an XML::Node ready for serialization.

Parameters
SelfRootThe root node containing all the serialized data for this instance.

Implements Mezzanine::Physics::Constraint.

Definition at line 98 of file dualtransformconstraint.cpp.

void Mezzanine::Physics::DualTransformConstraint::SetPivotALocation ( const Vector3 Location)
virtual

Sets The relative location of the pivot from ProxA's Center of gravity.

Parameters
LocationThe New value for PivotA.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 71 of file dualtransformconstraint.cpp.

void Mezzanine::Physics::DualTransformConstraint::SetPivotARotation ( const Quaternion Rotation)
virtual

Sets The relative rotation of ProxA.

Parameters
RotationThe new rotation amount for ProxA.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 83 of file dualtransformconstraint.cpp.

virtual void Mezzanine::Physics::DualTransformConstraint::SetPivotATransform ( const Transform TransA)
pure virtual

Sets the Position and Rotation for the first body using a Transform.

Parameters
TransAThe new position and rotation.

Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.

void Mezzanine::Physics::DualTransformConstraint::SetPivotBLocation ( const Vector3 Location)
virtual

Sets The relative location of the pivot from ProxB's Center of gravity.

Parameters
LocationThe New value for PivotB.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 74 of file dualtransformconstraint.cpp.

void Mezzanine::Physics::DualTransformConstraint::SetPivotBRotation ( const Quaternion Rotation)
virtual

Sets The relative rotation of ProxB.

Parameters
otationThe new rotation amount for ProxB.

Reimplemented in Mezzanine::Physics::Generic6DofConstraint, and Mezzanine::Physics::SliderConstraint.

Definition at line 86 of file dualtransformconstraint.cpp.

virtual void Mezzanine::Physics::DualTransformConstraint::SetPivotBTransform ( const Transform TransB)
pure virtual

Sets the Position and Rotation for the second body using a Transform.

Parameters
TransBThe new position and rotation.

Implemented in Mezzanine::Physics::Generic6DofConstraint, Mezzanine::Physics::HingeConstraint, Mezzanine::Physics::SliderConstraint, and Mezzanine::Physics::ConeTwistConstraint.

void Mezzanine::Physics::DualTransformConstraint::SetPivotTransforms ( const Transform TransA,
const Transform TransB 
)
virtual

Sets the Position and Rotation for the first and second body using a Transform.

Parameters
TransAThe new position and rotation for ProxyA.
TransBThe 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.


The documentation for this class was generated from the following files: