MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public 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 (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &AxisA, const Vector3 &AxisB, const Real Ratio)
 Double body constructor. Binds the two bodies. More...
 
virtual ~GearConstraint ()
 Class destructor.
 
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 btTypedConstraint * GetConstraintBase () const
 Get the Bullet constraint that this class encapsulates. More...
 
virtual Real GetRotationRatio () const
 Gets the ratio at which ActorA's rotation will be applied to ActorB. More...
 
virtual bool HasParamBeenSet (ConstraintParam Param, int Axis) const
 
virtual void ProtoDeSerialize (const XML::Node &OneNode)
 Take the data stored in an XML and overwrite this instance of this object with it. More...
 
virtual void ProtoSerialize (XML::Node &CurrentRoot) const
 Convert 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...
 
virtual Constraint::AxisList ValidAngularAxis () const
 Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation) More...
 
virtual Constraint::AxisList ValidLinearAxis () const
 Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation) More...
 
virtual Constraint::ParamList ValidParamOnAxis (int Axis) const
 Get a sorted (low to high) list of Parameters that are valid on this Axis. More...
 
- Public Member Functions inherited from Mezzanine::Physics::Constraint
virtual ~Constraint ()
 Class destructor. 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 bool IsParamValidOnAxis (ConstraintParam Param, int Axis) const
 Is a certain Parameter valid on a certain axis. More...
 
virtual void SetParam (ConstraintParam Param, Real Value, int Axis=-1)
 Provides override of constraint parameters. More...
 
virtual AxisList ValidAxis () const
 Get a sorted (low to high) list of All Valid Axis. More...
 
virtual ParamList ValidParams () const
 Get A sorted (low to high) list of Parameters that are valid on all Axis. More...
 

Static Public Member Functions

static String SerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::Physics::Constraint
static String SerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 

Protected Attributes

btGearConstraint * Gear
 Bullet constraint that this class encapsulates.
 
- Protected Attributes inherited from Mezzanine::Physics::Constraint
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
< ConstraintParam
ParamList
 Used to Store lists of param for return types.
 
- Protected Member Functions inherited from Mezzanine::Physics::Constraint
 Constraint ()
 No initialization constructor. More...
 
void SetBodies (RigidProxy *Prox1, RigidProxy *Prox2)
 Sets the Internal Proxy pointers. More...
 
void SetBodies (RigidProxy *Prox1)
 Sets the Internal Proxy pointers. More...
 

Detailed Description

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

Definition at line 57 of file gearconstraint.h.

Constructor & Destructor Documentation

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

Double body constructor. Binds the two bodies.

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

Definition at line 55 of file gearconstraint.cpp.

Member Function Documentation

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 74 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 77 of file gearconstraint.cpp.

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 185 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 86 of file gearconstraint.cpp.

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

Implements Mezzanine::Physics::Constraint.

Definition at line 110 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::ProtoDeSerialize ( const XML::Node OneNode)
virtual

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

Parameters
OneNodeand XML::Node containing the data.
Warning
A precondition of using this is that all of the actors intended for use must already be Deserialized.

Reimplemented from Mezzanine::Physics::Constraint.

Definition at line 148 of file gearconstraint.cpp.

void Mezzanine::Physics::GearConstraint::ProtoSerialize ( XML::Node CurrentRoot) const
virtual

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

Parameters
CurrentRootThe point in the XML hierarchy that all this vectorw should be appended to.

Reimplemented from Mezzanine::Physics::Constraint.

Definition at line 118 of file gearconstraint.cpp.

String Mezzanine::Physics::GearConstraint::SerializableName ( )
static

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

Returns
A string containing "Point2PointConstraint"

Definition at line 179 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 68 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 71 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 83 of file gearconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::GearConstraint::ValidAngularAxis ( ) 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 104 of file gearconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::GearConstraint::ValidLinearAxis ( ) 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 98 of file gearconstraint.cpp.

Constraint::ParamList Mezzanine::Physics::GearConstraint::ValidParamOnAxis ( 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 92 of file gearconstraint.cpp.


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