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

This is a constraint that duplicate the angular motion of one object to another, adjusted by the provided ratio. More...

#include <gearconstraint.h>

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

Public Member Functions

 GearConstraint (const UInt32 ID, RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &AxisA, const Vector3 &AxisB, PhysicsManager *Creator)
 Double body constructor. Binds the two bodies. More...
 
 GearConstraint (const UInt32 ID, RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &AxisA, const Vector3 &AxisB, const Real Ratio, PhysicsManager *Creator)
 Double body constructor. Binds the two bodies. More...
 
 GearConstraint (const XML::Node &SelfRoot, PhysicsManager *Creator)
 XML constructor. More...
 
virtual ~GearConstraint ()
 Class destructor.
 
virtual btTypedConstraint * _GetConstraintBase () const
 Get the Bullet constraint that this class encapsulates. More...
 
virtual Vector3 GetAxisA () const
 Gets the axis in ActorA's local space which will translate to ActorB. More...
 
virtual Vector3 GetAxisB () const
 Gets the axis in ActorB's local space which will be manipulated. More...
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of this Constraint. More...
 
virtual Real GetRotationRatio () const
 Gets the ratio at which ActorA's rotation will be applied to ActorB. More...
 
virtual Constraint::AxisList GetValidAngularAxes () const
 Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation) More...
 
virtual Constraint::AxisList GetValidLinearAxes () const
 Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation) More...
 
virtual Constraint::ParamList GetValidParamsOnAxis (int Axis) const
 Get a sorted (low to high) list of Parameters that are valid on this Axis. More...
 
virtual Boole HasParamBeenSet (ConstraintParam Param, int Axis) const
 
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 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 ProtoSerializeInitData (XML::Node &SelfRoot) const
 Convert the data needed to initialize 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 SetAxisA (const Vector3 &Axis)
 Sets the axis in ActorA's local space which will translate to ActorB. More...
 
virtual void SetAxisB (const Vector3 &Axis)
 Sets the axis in ActorB's local space which will be manipulated. More...
 
virtual void SetRotationRatio (const Real Ratio)
 Sets the ratio at which ActorA's rotation will be applied to ActorB. More...
 
- Public Member Functions inherited from Mezzanine::Physics::Constraint
virtual ~Constraint ()
 Class destructor.
 
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 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 GetValidAxes () const
 Get a sorted (low to high) list of All Valid Axis. More...
 
virtual ParamList GetValidParams () const
 Get A sorted (low to high) list of Parameters that are valid on all Axis. 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 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 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

virtual void CreateConstraint (RigidProxy *RigidA, RigidProxy *RigidB, const Vector3 &AxisA, const Vector3 &AxisB)
 Creates the internal constraint. More...
 
virtual void DestroyConstraint ()
 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...
 

Protected Attributes

btGearConstraint * Gear
 Bullet constraint that this class encapsulates. More...
 
- 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...
 

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.
 

Detailed Description

This is a constraint that duplicate the angular motion of one object to another, adjusted by the provided ratio.

Definition at line 56 of file gearconstraint.h.

Constructor & Destructor Documentation

Mezzanine::Physics::GearConstraint::GearConstraint ( const UInt32  ID,
RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 AxisA,
const Vector3 AxisB,
PhysicsManager Creator 
)

Double body constructor. Binds the two bodies.

Parameters
IDThe unique identifier assigned to this constraint.
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe axis in ProxyA's local space to apply the constraint to.
PivotBThe axis in ProxyB's local space to apply the constraint to.
CreatorA pointer to the manager that created this constraint.

Definition at line 56 of file gearconstraint.cpp.

Mezzanine::Physics::GearConstraint::GearConstraint ( const UInt32  ID,
RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 AxisA,
const Vector3 AxisB,
const Real  Ratio,
PhysicsManager Creator 
)

Double body constructor. Binds the two bodies.

Parameters
IDThe unique identifier assigned to this constraint.
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
PivotAThe axis in ProxyA's local space to apply the constraint to.
PivotBThe axis in ProxyB's local space to apply the constraint to.
RatioThe amount the rotation from ProxyA that shall be used to be applied to ProxyB.
CreatorA pointer to the manager that created this constraint.

Definition at line 60 of file gearconstraint.cpp.

Mezzanine::Physics::GearConstraint::GearConstraint ( const XML::Node SelfRoot,
PhysicsManager Creator 
)

XML constructor.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.
CreatorA pointer to the manager that created this constraint.

Definition at line 64 of file gearconstraint.cpp.

Member Function Documentation

btTypedConstraint * Mezzanine::Physics::GearConstraint::_GetConstraintBase ( ) const
virtual

Get the Bullet constraint that this class encapsulates.

Returns
A pointer to the btTypedConstraint that stores the underlying constraint.

Implements Mezzanine::Physics::Constraint.

Definition at line 248 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::CreateConstraint ( RigidProxy RigidA,
RigidProxy RigidB,
const Vector3 AxisA,
const Vector3 AxisB 
)
protectedvirtual

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.
AxisAThe offset to place the constraint in the first proxys local space.
AxisBThe offset to place the constraint in the second proxys local space.

Definition at line 71 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::DestroyConstraint ( )
protectedvirtual

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.

Definition at line 78 of file gearconstraint.cpp.

Vector3 Mezzanine::Physics::GearConstraint::GetAxisA ( ) const
virtual

Gets the axis in ActorA's local space which will translate to ActorB.

Returns
Returns a vector3 expressing the axis on ActorA this constraint is being applied to.

Definition at line 98 of file gearconstraint.cpp.

Vector3 Mezzanine::Physics::GearConstraint::GetAxisB ( ) const
virtual

Gets the axis in ActorB's local space which will be manipulated.

Returns
Returns a vector3 expressing the axis on ActorB this constraint is being applied to.

Definition at line 101 of file gearconstraint.cpp.

String Mezzanine::Physics::GearConstraint::GetDerivedSerializableName ( ) const
virtual

Gets the most derived serializable name of this Constraint.

Note
When creating a new Constraint class verify this method has a valid return for it in order for serialization to work properly.
Returns
Returns the name of the XML tag from the most derived class of "this".

Implements Mezzanine::Physics::Constraint.

Definition at line 239 of file gearconstraint.cpp.

Real Mezzanine::Physics::GearConstraint::GetRotationRatio ( ) const
virtual

Gets the ratio at which ActorA's rotation will be applied to ActorB.

Returns
Returns a Real representing the ratio at which rotations on ActorA's specified axis is being transfered to ActorB's specified axis.

Definition at line 110 of file gearconstraint.cpp.

String Mezzanine::Physics::GearConstraint::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 242 of file gearconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::GearConstraint::GetValidAngularAxes ( ) const
virtual

Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation)

Warning
Odd behaviors, maybe even undefined behavior can happen if This returns a matching Axis to a Linear Axis. Any given axis should only be one or the other
Returns
An Axislist with the Axis this constraint Angularly supports.

Implements Mezzanine::Physics::Constraint.

Definition at line 128 of file gearconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::GearConstraint::GetValidLinearAxes ( ) const
virtual

Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation)

Warning
Odd behaviors, maybe even undefined behavior can happen if This returns a matching Axis to a Linear Axis. Any given axis should only be one or the other
Returns
An Axislist with the Axis this constraint linearly supports.

Implements Mezzanine::Physics::Constraint.

Definition at line 122 of file gearconstraint.cpp.

Constraint::ParamList Mezzanine::Physics::GearConstraint::GetValidParamsOnAxis ( int  Axis) const
virtual

Get a sorted (low to high) list of Parameters that are valid on this Axis.

Parameters returned from this will work on the given axis even if they are not valid on any other axis. There is no guarantee that the Parameters will be uniquely stored per an axis. There is no guarantee that changing one parameter will not change another.

Parameters
Axisthe Axis to check.
Returns
A Paramlist with all the valid parameters for this axis.

Implements Mezzanine::Physics::Constraint.

Definition at line 116 of file gearconstraint.cpp.

Boole Mezzanine::Physics::GearConstraint::HasParamBeenSet ( ConstraintParam  Param,
int  Axis 
) const
virtual

Implements Mezzanine::Physics::Constraint.

Definition at line 134 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::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 180 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::ProtoDeSerializeProperties ( const XML::Node SelfRoot)
virtual

Take the data stored in an XML Node and overwrite the properties of this object with it.

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

Reimplemented from Mezzanine::Physics::Constraint.

Definition at line 219 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::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 142 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::ProtoSerializeProperties ( XML::Node SelfRoot) const
virtual

Convert the properties of this class to an XML::Node ready for serialization.

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

Reimplemented from Mezzanine::Physics::Constraint.

Definition at line 165 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::SetAxisA ( const Vector3 Axis)
virtual

Sets the axis in ActorA's local space which will translate to ActorB.

Parameters
AxisA vector3 expressing the axis on ActorA this constraint will be applied to.

Definition at line 92 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::SetAxisB ( const Vector3 Axis)
virtual

Sets the axis in ActorB's local space which will be manipulated.

Parameters
AxisA vector3 expressing the axis on ActorB this constraint will be applied to.

Definition at line 95 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::SetRotationRatio ( const Real  Ratio)
virtual

Sets the ratio at which ActorA's rotation will be applied to ActorB.

Parameters
RatioThe ratio at which rotations on ActorA's specified axis will be transfered to ActorB's specified axis.

Definition at line 107 of file gearconstraint.cpp.

Member Data Documentation

btGearConstraint* Mezzanine::Physics::GearConstraint::Gear
protected

Bullet constraint that this class encapsulates.

Definition at line 61 of file gearconstraint.h.


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