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

This is a constraint to be used to restrict the movement between two objects to angular rotation on a single axis. More...

#include <hingeconstraint.h>

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

Public Member Functions

 HingeConstraint (const UInt32 ID, RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &PivotInA, const Vector3 &PivotInB, const Vector3 &AxisInA, const Vector3 &AxisInB, PhysicsManager *Creator)
 Convenience axis constructor. More...
 
 HingeConstraint (const UInt32 ID, RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB, PhysicsManager *Creator)
 Transform constructor. More...
 
 HingeConstraint (const UInt32 ID, RigidProxy *ProxyA, const Vector3 &PivotInA, const Vector3 &AxisInA, PhysicsManager *Creator)
 Single body axis constructor. More...
 
 HingeConstraint (const UInt32 ID, RigidProxy *ProxyA, const Transform &TransA, PhysicsManager *Creator)
 Single body transform constructor. More...
 
 HingeConstraint (const XML::Node &SelfRoot, PhysicsManager *Creator)
 XML constructor. More...
 
virtual ~HingeConstraint ()
 Class destructor.
 
virtual btTypedConstraint * _GetConstraintBase () const
 Get the Bullet constraint that this class encapsulates. More...
 
virtual void EnableMotor (const Boole EnableMotor, const Real TargetVelocity, const Real MaxMotorImpulse)
 Enables(or Disables) the motor on the hinge and sets it's parameters. More...
 
virtual Quaternion GetAPivotRotation () const
 
virtual Quaternion GetBPivotRotation () const
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of this Constraint. More...
 
virtual Real GetHingeAngle ()
 Gets the current angle of the hinge. More...
 
virtual Real GetLimitBiasFactor () const
 Return the bias factor of the hinge (Not entirely certain hat this on is) More...
 
virtual Real GetLimitHigh () const
 Return the Upper Limit of the hinge. More...
 
virtual Real GetLimitLow () const
 Return the Lower Limit of the hinge. More...
 
virtual Real GetLimitRelaxationFactor () const
 Return the Relaxation Factor of the hinge. More...
 
virtual Real GetLimitSoftness () const
 Return the Softness of the hinge. More...
 
virtual Real GetMaxMotorImpulse () const
 Retrieve the maximimum value that the acceleration of the motor can be increased. More...
 
virtual Boole GetMotorEnabled () const
 Is this motor on this hinge enabled? More...
 
virtual Real GetMotorTargetVelocity () const
 Get the Target Velocity. More...
 
virtual Vector3 GetPivotALocation () const
 Gets the location of the pivot relative to ProxA's Center of gravity. More...
 
virtual Transform GetPivotATransform () const
 
virtual Vector3 GetPivotBLocation () const
 Gets the location of the pivot relative to ProxB's Center of gravity. More...
 
virtual Transform GetPivotBTransform () const
 
virtual Boole GetUseFrameOffset () const
 Gets whether or not an offset of the constraint frame should be used to calculate internal data. More...
 
virtual Boole GetUseReferenceFrameA () const
 Gets whether or not to perform linear math from ProxyA's perspective. 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 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 ProtoSerializeProperties (XML::Node &SelfRoot) const
 Convert the properties of this class to an XML::Node ready for serialization. More...
 
virtual void SetAPivotRotation (const Quaternion &Rotation)
 
virtual void SetAxis (const Vector3 &AxisInA)
 Sets the axis on which this constraint acts. More...
 
virtual void SetBPivotRotation (const Quaternion &Rotation)
 
virtual void SetLimits (const Real Low, const Real High, const Real Softness=0.9, const Real BiasFactor=0.3, const Real RelaxationFactor=1.0)
 Sets the angle limits of the constraint in radians. More...
 
virtual void SetMaxMotorImpulse (const Real MaxMotorImpulse)
 Sets the maximum amount of force the motor is to apply. More...
 
virtual void SetMotorEnabled (const Boole EnableMotor)
 Enables(or Disables) the motor on the hinge. More...
 
virtual void SetMotorTarget (const Quaternion &QuatAInB, const Real Delta)
 Sets a Target Velocity, indirectly using the angle stored in a quaternion. More...
 
virtual void SetMotorTarget (const Real TargetAngle, const Real Delta)
 Set the Rotational velocity in a more direct fashion. More...
 
virtual void SetMotorTargetVelocity (const Real TargetVelocity)
 Desired angular velocity of the motor. More...
 
virtual void SetPivotALocation (const Vector3 &Location)
 Sets The relative location of the pivot from ProxA's Center of gravity. More...
 
virtual void SetPivotATransform (const Transform &TransA)
 
virtual void SetPivotBLocation (const Vector3 &Location)
 Sets The relative location of the pivot from ProxB's Center of gravity. More...
 
virtual void SetPivotBTransform (const Transform &TransB)
 
virtual void SetPivotTransforms (const Transform &TransA, const Transform &TransB)
 Sets the Position and Rotation for the first and second body using a Transform. More...
 
virtual void SetUseFrameOffset (const Boole FrameOffset)
 Sets whether or not an offset of the constraint frame should be used to calculate internal data. More...
 
virtual void SetUseReferenceFrameA (const Boole UseRefFrameA)
 Sets whether or not to perform linear math from ProxyA's perspective. More...
 
- Public Member Functions inherited from Mezzanine::Physics::DualTransformConstraint
virtual ~DualTransformConstraint ()
 Class destructor.
 
virtual Quaternion GetPivotARotation () const
 Gets the relative rotation for ProxA. More...
 
virtual Quaternion GetPivotBRotation () const
 Gets the relative rotation for ProxB. 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 SetPivotARotation (const Quaternion &Rotation)
 Sets The relative rotation of ProxA. More...
 
virtual void SetPivotBRotation (const Quaternion &Rotation)
 Sets The relative rotation of ProxB. 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::DualTransformConstraint
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 Transform &TransA, const Transform &TransB)
 Creates the internal constraint. More...
 
virtual void CreateConstraint (RigidProxy *RigidA, RigidProxy *RigidB, const Vector3 &PivotInA, const Vector3 &PivotInB, const Vector3 &AxisInA, const Vector3 &AxisInB)
 Creates the internal constraint. More...
 
virtual void DestroyConstraint ()
 Destroys the internal constraint. More...
 
- Protected Member Functions inherited from Mezzanine::Physics::DualTransformConstraint
 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...
 
- 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

btHingeConstraint * Hinge
 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 to be used to restrict the movement between two objects to angular rotation on a single axis.

As the name suggests, this constraint essentially works like a door Hinge.

Definition at line 56 of file hingeconstraint.h.

Constructor & Destructor Documentation

Mezzanine::Physics::HingeConstraint::HingeConstraint ( const UInt32  ID,
RigidProxy ProxyA,
RigidProxy ProxyB,
const Vector3 PivotInA,
const Vector3 PivotInB,
const Vector3 AxisInA,
const Vector3 AxisInB,
PhysicsManager Creator 
)

Convenience axis constructor.

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 location in ProxyA's local space to apply the constraint to.
PivotBThe location in ProxyB's local space to apply the constraint to.
AxisInAThe axis(for ProxyA) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
AxisInBThe axis(for ProxyB) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
CreatorA pointer to the manager that created this constraint.

Definition at line 58 of file hingeconstraint.cpp.

Mezzanine::Physics::HingeConstraint::HingeConstraint ( const UInt32  ID,
RigidProxy ProxyA,
RigidProxy ProxyB,
const Transform TransA,
const Transform TransB,
PhysicsManager Creator 
)

Transform constructor.

Parameters
IDThe unique identifier assigned to this constraint.
ProxyAThe first proxy to apply this constraint to.
ProxyBThe second proxy to apply this constraint to.
TransAThe offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
TransBThe offset and rotation from ProxyBs center of gravity.
CreatorA pointer to the manager that created this constraint.

Definition at line 63 of file hingeconstraint.cpp.

Mezzanine::Physics::HingeConstraint::HingeConstraint ( const UInt32  ID,
RigidProxy ProxyA,
const Vector3 PivotInA,
const Vector3 AxisInA,
PhysicsManager Creator 
)

Single body axis constructor.

Parameters
IDThe unique identifier assigned to this constraint.
ProxyAThe proxy to apply this constraint to.
PivotInAThe point in the objects(ProxyA) local space where the constraint is to be attached to world space.
AxisInAThe axis(for ProxyA) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
CreatorA pointer to the manager that created this constraint.

Definition at line 68 of file hingeconstraint.cpp.

Mezzanine::Physics::HingeConstraint::HingeConstraint ( const UInt32  ID,
RigidProxy ProxyA,
const Transform TransA,
PhysicsManager Creator 
)

Single body transform constructor.

Parameters
IDThe unique identifier assigned to this constraint.
ProxyAThe first proxy to apply this constraint to.
TransBThe offset and rotation from ProxyAs center of gravity.
CreatorA pointer to the manager that created this constraint.

Definition at line 73 of file hingeconstraint.cpp.

Mezzanine::Physics::HingeConstraint::HingeConstraint ( 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 78 of file hingeconstraint.cpp.

Member Function Documentation

btTypedConstraint * Mezzanine::Physics::HingeConstraint::_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 371 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::CreateConstraint ( RigidProxy RigidA,
RigidProxy RigidB,
const Transform TransA,
const Transform TransB 
)
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.
TransAThe offset to place the constraint in the first proxys local space.
TransBThe offset to place the constraint in the second proxys local space.

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 86 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::CreateConstraint ( RigidProxy RigidA,
RigidProxy RigidB,
const Vector3 PivotInA,
const Vector3 PivotInB,
const Vector3 AxisInA,
const Vector3 AxisInB 
)
protectedvirtual

Creates the internal constraint.

Parameters
RigidAThe first proxy to apply this constraint to.
RigidBThe second proxy to apply this constraint to.
PivotAThe location in ProxyA's local space to apply the constraint to.
PivotBThe location in ProxyB's local space to apply the constraint to.
AxisInAThe axis(for ProxyA) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.
AxisInBThe axis(for ProxyB) on which the hinge is to act. For example, a door hinge would be (0.0,1.0,0.0), aka the positive Y axis.

Definition at line 97 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::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.

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 108 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::EnableMotor ( const Boole  EnableMotor,
const Real  TargetVelocity,
const Real  MaxMotorImpulse 
)
virtual

Enables(or Disables) the motor on the hinge and sets it's parameters.

Parameters
EnableMotorSets whether or not the motor on this constraint is enabled.
TargetVelocityThe desired velocity of rotation the motor will have. This may or may not be achieved based on obstructions in the simulation.
MaxMotorImpulseThe maximum amount of force the motor is to apply to try and reach it's target velocity.

Definition at line 206 of file hingeconstraint.cpp.

Quaternion Mezzanine::Physics::HingeConstraint::GetAPivotRotation ( ) const
virtual

Remarks
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Definition at line 155 of file hingeconstraint.cpp.

Quaternion Mezzanine::Physics::HingeConstraint::GetBPivotRotation ( ) const
virtual

Remarks
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Definition at line 158 of file hingeconstraint.cpp.

String Mezzanine::Physics::HingeConstraint::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 362 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetHingeAngle ( )
virtual

Gets the current angle of the hinge.

Returns
Gets the amount of rotation this hinge is off from it's origin in radians.

Definition at line 167 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetLimitBiasFactor ( ) const
virtual

Return the bias factor of the hinge (Not entirely certain hat this on is)

Returns
A real containing the bias Factor

Definition at line 197 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetLimitHigh ( ) const
virtual

Return the Upper Limit of the hinge.

Returns
A real containing the Higher Limit

Definition at line 191 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetLimitLow ( ) const
virtual

Return the Lower Limit of the hinge.

Returns
A real containing the Lower Limit

Definition at line 188 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetLimitRelaxationFactor ( ) const
virtual

Return the Relaxation Factor of the hinge.

Returns
A real containing the Relaxation Factor

Definition at line 200 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetLimitSoftness ( ) const
virtual

Return the Softness of the hinge.

Returns
A real containing the Softness

Definition at line 194 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetMaxMotorImpulse ( ) const
virtual

Retrieve the maximimum value that the acceleration of the motor can be increased.

Returns
A real containing the maximum impulse.

Definition at line 218 of file hingeconstraint.cpp.

Boole Mezzanine::Physics::HingeConstraint::GetMotorEnabled ( ) const
virtual

Is this motor on this hinge enabled?

Returns
True if it is, false otherwise.

Definition at line 212 of file hingeconstraint.cpp.

Real Mezzanine::Physics::HingeConstraint::GetMotorTargetVelocity ( ) const
virtual

Get the Target Velocity.

Returns
the target valocity as a real.

Definition at line 224 of file hingeconstraint.cpp.

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

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

Returns
A Vector3 with the pivot location.
Remarks
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Reimplemented from Mezzanine::Physics::DualTransformConstraint.

Definition at line 143 of file hingeconstraint.cpp.

Transform Mezzanine::Physics::HingeConstraint::GetPivotATransform ( ) const
virtual

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 131 of file hingeconstraint.cpp.

Vector3 Mezzanine::Physics::HingeConstraint::GetPivotBLocation ( ) const
virtual

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

Returns
A Vector3 with the pivot location.
Remarks
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Reimplemented from Mezzanine::Physics::DualTransformConstraint.

Definition at line 146 of file hingeconstraint.cpp.

Transform Mezzanine::Physics::HingeConstraint::GetPivotBTransform ( ) const
virtual

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 134 of file hingeconstraint.cpp.

String Mezzanine::Physics::HingeConstraint::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 365 of file hingeconstraint.cpp.

Boole Mezzanine::Physics::HingeConstraint::GetUseFrameOffset ( ) const
virtual

Gets whether or not an offset of the constraint frame should be used to calculate internal data.

Returns
Returns whether or not an offset in the constraint frame is being used by the internal constraint.

Definition at line 173 of file hingeconstraint.cpp.

Boole Mezzanine::Physics::HingeConstraint::GetUseReferenceFrameA ( ) const
virtual

Gets whether or not to perform linear math from ProxyA's perspective.

Returns
Returns true if math is being done from ProxyA's perspective, false if math is being done from ProxyB's perspective.

Definition at line 179 of file hingeconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::HingeConstraint::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 254 of file hingeconstraint.cpp.

Constraint::AxisList Mezzanine::Physics::HingeConstraint::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 247 of file hingeconstraint.cpp.

Constraint::ParamList Mezzanine::Physics::HingeConstraint::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 236 of file hingeconstraint.cpp.

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

Implements Mezzanine::Physics::Constraint.

Definition at line 261 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::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 298 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::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 274 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetAPivotRotation ( const Quaternion Rotation)
virtual

Remarks
Ultimately this information winds up being stored in the TransformA. This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Definition at line 149 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetAxis ( const Vector3 AxisInA)
virtual

Sets the axis on which this constraint acts.

Parameters
AxisInAA vector3 representing the axis to be used with this constraint.

Definition at line 164 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetBPivotRotation ( const Quaternion Rotation)
virtual

Remarks
Ultimately this information winds up being stored in the TransformB. This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Definition at line 152 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetLimits ( const Real  Low,
const Real  High,
const Real  Softness = 0.9,
const Real  BiasFactor = 0.3,
const Real  RelaxationFactor = 1.0 
)
virtual

Sets the angle limits of the constraint in radians.

Parameters
LowThe minimum angle limit for the constraint in radians.
HighThe maximum angle limit for the constraint in radians.
SoftnessNot currently used internally.
BiasFactorMultiplier for the constraint error, constraint appears more "soft" when closer to zero.
RelaxationFactorThe amount of bounce to apply when the constraint reaches it's limit. Range: 0.0-1.0.

Definition at line 185 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetMaxMotorImpulse ( const Real  MaxMotorImpulse)
virtual

Sets the maximum amount of force the motor is to apply.

Parameters
MaxMotorImpulseThe maximum amount of force the motor is to apply to try and reach it's target velocity.

Definition at line 215 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetMotorEnabled ( const Boole  EnableMotor)
virtual

Enables(or Disables) the motor on the hinge.

Warning
Be sure to set values for the Motor max impulse and/or velocity before enabling the motor, or else you may get a crash.
Parameters
EnableMotorSets whether or not the motor on this constraint is enabled.

Definition at line 209 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetMotorTarget ( const Quaternion QuatAInB,
const Real  Delta 
)
virtual

Sets a Target Velocity, indirectly using the angle stored in a quaternion.

Parameters
QuatAInBThe angle a quaternion relative to the two objects in the constraint.
DeltaThe Desired Time steps that the target rotational velocity should be reached in.

Definition at line 227 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetMotorTarget ( const Real  TargetAngle,
const Real  Delta 
)
virtual

Set the Rotational velocity in a more direct fashion.

Parameters
TargetAngleThe desired angle in radians.
DeltaThe Desired Time steps that the target rotational velocity should be reached in.

Definition at line 230 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetMotorTargetVelocity ( const Real  TargetVelocity)
virtual

Desired angular velocity of the motor.

Parameters
TargetVelocityThe Desired velocity
Warning
Causes segfaults in some tests.

Definition at line 221 of file hingeconstraint.cpp.

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

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

Parameters
LocationThe New value for PivotA.
Remarks
Ultimately this information winds up being stored in the TransformA. This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Reimplemented from Mezzanine::Physics::DualTransformConstraint.

Definition at line 137 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetPivotATransform ( const Transform TransA)
virtual

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 125 of file hingeconstraint.cpp.

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

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

Parameters
LocationThe New value for PivotB.
Remarks
Ultimately this information winds up being stored in the TransformB. This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Reimplemented from Mezzanine::Physics::DualTransformConstraint.

Definition at line 140 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetPivotBTransform ( const Transform TransB)
virtual

Implements Mezzanine::Physics::DualTransformConstraint.

Definition at line 128 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::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.
Remarks
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.

Reimplemented from Mezzanine::Physics::DualTransformConstraint.

Definition at line 122 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetUseFrameOffset ( const Boole  FrameOffset)
virtual

Sets whether or not an offset of the constraint frame should be used to calculate internal data.

Parameters
FrameOffsetThe full effect of this being true or false is uknown, but internal documentation suggests "true" provides more stable results.

Definition at line 170 of file hingeconstraint.cpp.

void Mezzanine::Physics::HingeConstraint::SetUseReferenceFrameA ( const Boole  UseRefFrameA)
virtual

Sets whether or not to perform linear math from ProxyA's perspective.

Parameters
UseRefFrameATrue to perform math from ProxyA's perspective, false to perform math from ProxyB's perspective. Initial Value: false.

Definition at line 176 of file hingeconstraint.cpp.

Member Data Documentation

btHingeConstraint* Mezzanine::Physics::HingeConstraint::Hinge
protected

Bullet constraint that this class encapsulates.

Definition at line 61 of file hingeconstraint.h.


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