This is a constraint to be used to restrict the movement between two objects to angular rotation on a single axis. More...
#include <constraint.h>
Public Member Functions | |
HingeConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &PivotInA, const Vector3 &PivotInB, const Vector3 &AxisInA, const Vector3 &AxisInB, bool UseReferenceFrameA=false) | |
Creates a Hinge constraint that will connect two proxies together by their offsets. More... | |
HingeConstraint (RigidProxy *ProxyA, const Vector3 &PivotInA, const Vector3 &AxisInA, bool UseReferenceFrameA=false) | |
Creates a Hinge constraint that will attach an proxy to a point in world space. More... | |
HingeConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Vector3 &VectorA, const Vector3 &VectorB, const Quaternion &QuaternionA, const Quaternion &QuaternionB, bool UseReferenceFrameA=false) | |
Create a Hinge with components of a tranform. More... | |
HingeConstraint (RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransformA, const Transform &TransformB, bool UseReferenceFrameA=false) | |
Create a Hinge with components of a tranform. More... | |
virtual | ~HingeConstraint () |
Class destructor. | |
virtual void | EnableMotor (bool EnableMotor, Real TargetVelocity, Real MaxMotorImpulse) |
Enables(or Disables) the motor on the hinge and sets it's parameters. More... | |
virtual void | EnableMotor (bool EnableMotor) |
Enables(or Disables) the motor on the hinge. More... | |
virtual Quaternion | GetAPivotRotation () const |
Get the relative rotation for ActorA. More... | |
virtual Quaternion | GetBPivotRotation () const |
Get the relative rotation for ActorB. More... | |
virtual btTypedConstraint * | GetConstraintBase () const |
Get the Bullet constraint that this class encapsulates. 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 bool | GetMotorEnabled () const |
Is this motor on this hinge enabled? More... | |
virtual Real | GetMotorTargetVelocity () const |
Get the Target Velocity. More... | |
virtual Vector3 | GetPivotALocation () const |
Get the location of the hinge pivot relative to ActorA's Center of gravity. More... | |
virtual Transform | GetPivotATransform () const |
virtual Vector3 | GetPivotBLocation () const |
Get the location of the hinge pivot relative to ActorB's Center of gravity. More... | |
virtual Transform | GetPivotBTransform () const |
virtual bool | GetUseFrameOffset () const |
Retrieve the stored value from the physics subsystem(bullet) More... | |
virtual bool | GetUseReferenceFrameA () const |
Is this Using Reference Frame A. 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 | SetAPivotRotation (const Quaternion &Rotation) |
Set The relative rotation of ActorA. More... | |
virtual void | SetAxis (const Vector3 &AxisInA) |
Sets the axis on which this constraint acts. More... | |
virtual void | SetBPivotRotation (const Quaternion &Rotation) |
Set The relative rotation of ActorB. More... | |
virtual void | SetLimit (Real Low, Real High, Real Softness=0.9, Real BiasFactor=0.3, Real RelaxationFactor=1.0) |
Sets the angle limits of the constraint in radians. More... | |
virtual void | SetMaxMotorImpulse (Real MaxMotorImpulse) |
Sets the maximum amount of force the motor is to apply. More... | |
virtual void | SetMotorTarget (const Quaternion &QuatAInB, Real Dt) |
Sets a Target Velocity, indirectly using the angle stored in a quaternion. More... | |
virtual void | SetMotorTarget (Real TargetAngle, Real Dt) |
Set the Rotational velocity in a more direct fashion. More... | |
virtual void | SetMotorTargetVelocity (Real TargetVelocity) |
Desired angular velocity of the motor. More... | |
virtual void | SetPivotALocation (const Vector3 &Location) |
Set The relative location of the hinge pivot from ActorA's Center of gravity. More... | |
virtual void | SetPivotATransform (const Transform &TranA) |
virtual void | SetPivotBLocation (const Vector3 &Location) |
Set The relative location of the hinge pivot from ActorB's Center of gravity. More... | |
virtual void | SetPivotBTransform (const Transform &TranB) |
virtual void | SetUseFrameOffset (bool FrameOffset) |
Set the stored value for UseFrameOffset on this hinge in the physics subsystem(bullet) More... | |
virtual void | SetUseReferenceFrameA (bool UseReferenceFrameA=false) |
Change whether this is Using Reference Frame A or not. 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::DualTransformConstraint | |
virtual Quaternion | GetPivotARotation () const |
Get the relative rotation for ActorA. More... | |
virtual Quaternion | GetPivotBRotation () const |
Get the relative rotation for ActorB. More... | |
virtual void | SetPivotARotation (const Quaternion &Rotation) |
Set The relative rotation of ActorA. More... | |
virtual void | SetPivotBRotation (const Quaternion &Rotation) |
Set The relative rotation of ActorB. 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 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 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::DualTransformConstraint | |
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 | |
btHingeConstraint * | Hinge |
Bullet constraint that this class encapsulates. | |
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... | |
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 57 of file hingeconstraint.h.
Mezzanine::Physics::HingeConstraint::HingeConstraint | ( | RigidProxy * | ProxyA, |
RigidProxy * | ProxyB, | ||
const Vector3 & | PivotInA, | ||
const Vector3 & | PivotInB, | ||
const Vector3 & | AxisInA, | ||
const Vector3 & | AxisInB, | ||
bool | UseReferenceFrameA = false |
||
) |
Creates a Hinge constraint that will connect two proxies together by their offsets.
ProxyA | The first proxy to apply this constraint to. |
ProxyB | The second proxy to apply this constraint to. |
PivotA | The location in ProxyA's local space to apply the constraint to. |
PivotB | The location in ProxyB's local space to apply the constraint to. |
AxisInA | The 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. |
AxisInB | The 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. |
UseReferenceFrameA | By default, this constraint uses ProxyB's local space as the reference for certain values, such as the rotational limits. This simply controls whether or not it should use ProxyA's local space instead. |
Definition at line 64 of file hingeconstraint.cpp.
Mezzanine::Physics::HingeConstraint::HingeConstraint | ( | RigidProxy * | ProxyA, |
const Vector3 & | PivotInA, | ||
const Vector3 & | AxisInA, | ||
bool | UseReferenceFrameA = false |
||
) |
Creates a Hinge constraint that will attach an proxy to a point in world space.
ProxyA | The proxy to apply this constraint to. |
PivotInA | The point in the objects(ProxyA) local space where the constraint is to be attached to world space. |
AxisInA | The 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. |
UseReferenceFrameA | By default, this constraint uses ProxyB's local space as the reference for certain values, such as the rotational limits. This simply controls whether or not it should use ProxyA's local space instead. |
Definition at line 73 of file hingeconstraint.cpp.
Mezzanine::Physics::HingeConstraint::HingeConstraint | ( | RigidProxy * | ProxyA, |
RigidProxy * | ProxyB, | ||
const Vector3 & | VectorA, | ||
const Vector3 & | VectorB, | ||
const Quaternion & | QuaternionA, | ||
const Quaternion & | QuaternionB, | ||
bool | UseReferenceFrameA = false |
||
) |
Create a Hinge with components of a tranform.
ProxyA | The first proxy to apply this constraint to. |
ProxyB | The second proxy to apply this constraint to. |
VectorA | The location component of Transform A |
VectorB | The location component of Transform B |
QuaternionA | The rotation component of Transform A |
QuaternionB | The rotation component of Transform B |
UseReferenceFrameA | By default, this constraint uses ProxyB's local space as the reference for certain values, such as the rotational limits. This simply controls whether or not it should use ProxyAs local space instead. |
Definition at line 81 of file hingeconstraint.cpp.
Mezzanine::Physics::HingeConstraint::HingeConstraint | ( | RigidProxy * | ProxyA, |
RigidProxy * | ProxyB, | ||
const Transform & | TransformA, | ||
const Transform & | TransformB, | ||
bool | UseReferenceFrameA = false |
||
) |
Create a Hinge with components of a tranform.
ProxyA | The first proxy to apply this constraint to. |
ProxyB | The second proxy to apply this constraint to. |
TransformA | The location component of Transform A |
TransformB | The location component of Transform B |
UseReferenceFrameA | By default, this constraint uses ProxyBs local space as the reference for certain values, such as the rotational limits. This simply controls whether or not it should use ProxyAs local space instead. |
Definition at line 90 of file hingeconstraint.cpp.
|
virtual |
Enables(or Disables) the motor on the hinge and sets it's parameters.
EnableMotor | Sets whether or not the motor on this constraint is enabled. |
TargetVelocity | The desired velocity of rotation the motor will have. This may or may not be achieved based on obstructions in the simulation. |
MaxMotorImpulse | The maximum amount of force the motor is to apply to try and reach it's target velocity. |
Definition at line 145 of file hingeconstraint.cpp.
|
virtual |
Enables(or Disables) the motor on the hinge.
EnableMotor | Sets whether or not the motor on this constraint is enabled. |
Definition at line 148 of file hingeconstraint.cpp.
|
virtual |
Get the relative rotation for ActorA.
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.
Definition at line 124 of file hingeconstraint.cpp.
|
virtual |
Get the relative rotation for ActorB.
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.
Definition at line 127 of file hingeconstraint.cpp.
|
virtual |
Get the Bullet constraint that this class encapsulates.
Implements Mezzanine::Physics::Constraint.
Definition at line 58 of file hingeconstraint.cpp.
|
virtual |
Gets the current angle of the hinge.
Definition at line 202 of file hingeconstraint.cpp.
|
virtual |
Return the bias factor of the hinge (Not entirely certain hat this on is)
Definition at line 187 of file hingeconstraint.cpp.
|
virtual |
Return the Upper Limit of the hinge.
Definition at line 181 of file hingeconstraint.cpp.
|
virtual |
Return the Lower Limit of the hinge.
Definition at line 178 of file hingeconstraint.cpp.
|
virtual |
Return the Relaxation Factor of the hinge.
Definition at line 190 of file hingeconstraint.cpp.
|
virtual |
Return the Softness of the hinge.
Definition at line 184 of file hingeconstraint.cpp.
|
virtual |
Retrieve the maximimum value that the acceleration of the motor can be increased.
Definition at line 157 of file hingeconstraint.cpp.
|
virtual |
Is this motor on this hinge enabled?
Definition at line 151 of file hingeconstraint.cpp.
|
virtual |
Get the Target Velocity.
Definition at line 169 of file hingeconstraint.cpp.
|
virtual |
Get the location of the hinge pivot relative to ActorA's Center of gravity.
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.
Reimplemented from Mezzanine::Physics::DualTransformConstraint.
Definition at line 112 of file hingeconstraint.cpp.
|
virtual |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 136 of file hingeconstraint.cpp.
|
virtual |
Get the location of the hinge pivot relative to ActorB's Center of gravity.
This implements a more Hinge specific version of the logic than DualTransformConstraint for efficiency reasons.
Reimplemented from Mezzanine::Physics::DualTransformConstraint.
Definition at line 115 of file hingeconstraint.cpp.
|
virtual |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 139 of file hingeconstraint.cpp.
|
virtual |
Retrieve the stored value from the physics subsystem(bullet)
Definition at line 249 of file hingeconstraint.cpp.
|
virtual |
Is this Using Reference Frame A.
Definition at line 243 of file hingeconstraint.cpp.
|
virtual |
Implements Mezzanine::Physics::Constraint.
Definition at line 233 of file hingeconstraint.cpp.
|
virtual |
Take the data stored in an XML and overwrite this instance of this object with it.
OneNode | and XML::Node containing the data. |
Reimplemented from Mezzanine::Physics::DualTransformConstraint.
Definition at line 315 of file hingeconstraint.cpp.
|
virtual |
Convert this class to an XML::Node ready for serialization.
CurrentRoot | The point in the XML hierarchy that all this vectorw should be appended to. |
Reimplemented from Mezzanine::Physics::DualTransformConstraint.
Definition at line 258 of file hingeconstraint.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 356 of file hingeconstraint.cpp.
|
virtual |
Set The relative rotation of ActorA.
Rotation | The new rotation amount for A |
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 118 of file hingeconstraint.cpp.
|
virtual |
Sets the axis on which this constraint acts.
AxisInA | A vector3 representing the axis to be used with this constraint. |
Definition at line 196 of file hingeconstraint.cpp.
|
virtual |
Set The relative rotation of ActorB.
otation | The new rotation amount for B |
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 121 of file hingeconstraint.cpp.
|
virtual |
Sets the angle limits of the constraint in radians.
Low | The minimum angle limit for the constraint in radians. |
High | The maximum angle limit for the constraint in radians. |
Softness | Not currently used internally. |
BiasFactor | Multiplier for the constraint error, constraint appears more "soft" when closer to zero. |
RelaxationFactor | The amount of bounce to apply when the constraint reaches it's limit. Range: 0.0-1.0. |
Definition at line 175 of file hingeconstraint.cpp.
|
virtual |
Sets the maximum amount of force the motor is to apply.
MaxMotorImpulse | The maximum amount of force the motor is to apply to try and reach it's target velocity. |
Definition at line 154 of file hingeconstraint.cpp.
|
virtual |
Sets a Target Velocity, indirectly using the angle stored in a quaternion.
Is implemented in terms of SetMotorTarget(Real, Real);
QuatAInB | The angle a quaternion relative to the two objects in the constraint. |
Dt | The Desired Time steps that the target rotational velocity should be reached in. |
Definition at line 160 of file hingeconstraint.cpp.
Set the Rotational velocity in a more direct fashion.
TargetAngle | The desired angle in radians. |
Dt | The Desired Time steps that the target rotational velocity should be reached in. |
Definition at line 163 of file hingeconstraint.cpp.
|
virtual |
Desired angular velocity of the motor.
TargetVelocity | The Desired velocity |
Definition at line 166 of file hingeconstraint.cpp.
|
virtual |
Set The relative location of the hinge pivot from ActorA's Center of gravity.
Location | The New value for PivotA |
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 106 of file hingeconstraint.cpp.
|
virtual |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 130 of file hingeconstraint.cpp.
|
virtual |
Set The relative location of the hinge pivot from ActorB's Center of gravity.
Location | The New value for PivotB |
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 109 of file hingeconstraint.cpp.
|
virtual |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 133 of file hingeconstraint.cpp.
|
virtual |
Set the stored value for UseFrameOffset on this hinge in the physics subsystem(bullet)
FrameOffset | The new desired value. |
Definition at line 252 of file hingeconstraint.cpp.
|
virtual |
Change whether this is Using Reference Frame A or not.
UseReferenceFrameA | Whether certain math be performed from the perspective of Actor A or Actor B (we think this is the case, but we have not test thoroughly) |
Definition at line 246 of file hingeconstraint.cpp.
|
virtual |
Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation)
Implements Mezzanine::Physics::Constraint.
Definition at line 226 of file hingeconstraint.cpp.
|
virtual |
Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation)
Implements Mezzanine::Physics::Constraint.
Definition at line 219 of file hingeconstraint.cpp.
|
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.
Axis | the Axis to check. |
Implements Mezzanine::Physics::Constraint.
Definition at line 207 of file hingeconstraint.cpp.