This is a constraint that will limit the movement allowed from one body to within a cone area around another object. More...
#include <conetwistconstraint.h>
Public Member Functions | |
ConeTwistConstraint (const UInt32 ID, RigidProxy *ProxyA, RigidProxy *ProxyB, const Transform &TransA, const Transform &TransB, PhysicsManager *Creator) | |
Class constructor. More... | |
ConeTwistConstraint (const UInt32 ID, RigidProxy *ProxyA, const Transform &TransA, PhysicsManager *Creator) | |
Single body constructor. More... | |
ConeTwistConstraint (const XML::Node &SelfRoot, PhysicsManager *Creator) | |
XML constructor. More... | |
virtual | ~ConeTwistConstraint () |
Class destructor. | |
virtual btTypedConstraint * | _GetConstraintBase () const |
Get the Bullet constraint that this class encapsulates. More... | |
virtual void | EnableMotor (const Boole Enable) |
Enables (or disables) the motor of this constraint. More... | |
virtual Boole | GetAngularOnly () const |
virtual Real | GetBiasFactor () const |
Gets the strength of the force enforcing the twist limits. More... | |
virtual Real | GetDamping () const |
virtual String | GetDerivedSerializableName () const |
Gets the most derived serializable name of this Constraint. More... | |
virtual Real | GetFixThresh () const |
virtual Real | GetLimit (const Integer LimitIndex) const |
Gets a constraint limit based on Index. More... | |
virtual Real | GetLimitSoftness () const |
Gets the % portion of the swing limit in which to start enforcing the limit. More... | |
virtual Real | GetMaxMotorImpulse () const |
virtual Quaternion | GetMotorTarget () const |
virtual Transform | GetPivotATransform () const |
Gets the current Rotation and Location of ProxyA. More... | |
virtual Transform | GetPivotBTransform () const |
Gets the current Rotation and Location of ProxyB. More... | |
virtual Real | GetRelaxationFactor () const |
Gets the strength of the force enforcing the swing limits. More... | |
virtual Real | GetSwingSpan1 () const |
Gets the currently set value for the constraint Swing span on the Y axis. More... | |
virtual Real | GetSwingSpan2 () const |
Gets the currently set value for the constraint Swing span on the Z axis. More... | |
Real | GetTwistAngle () const |
Gets the current angle of thw twist applied to the constraint. More... | |
virtual Real | GetTwistSpan () const |
Gets the currently set value for the constraint Twist span on the X axis. More... | |
virtual AxisList | GetValidAngularAxes () const |
Get A list sorted (low to high) of all axis that operate Angularly (that lock sliding/translation) More... | |
virtual AxisList | GetValidLinearAxes () const |
Get a sorted (low to high) list of all axis that operate linearly (that lock sliding/translation) More... | |
virtual 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 |
Has the given Param on the Given Axis been set yet. More... | |
virtual Boole | IsMaxMotorImpulseNormalized () const |
virtual Boole | IsMotorEnabled () const |
Gets whether or not the motor is enabled. More... | |
Boole | IsPassedSwingLimit () const |
Gets whether or not the child object is outside the set limits for the constraint. 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 | ProtoSerializeProperties (XML::Node &SelfRoot) const |
Convert the properties of this class to an XML::Node ready for serialization. More... | |
virtual void | SetAngularOnly (const Boole AngularOnly) |
virtual void | SetDamping (const Real Damping) |
virtual void | SetFixThresh (const Real FixThresh) |
virtual void | SetLimit (const Integer LimitIndex, const Real LimitValue) |
Sets a constraint limit based on Index. More... | |
virtual void | SetLimits (const Real SwingSpan1, const Real SwingSpan2, const Real TwistSpan, const Real Softness=1.0, const Real BiasFactor=0.3, const Real RelaxationFactor=1.0) |
Sets all constraint limits. More... | |
virtual void | SetMaxMotorImpulse (const Real MaxMotorImpulse) |
virtual void | SetMaxMotorImpulseNormalized (const Real MaxMotorImpulse) |
virtual void | SetMotorTarget (const Quaternion &Quat) |
virtual void | SetMotorTargetInConstraintSpace (const Quaternion &Quat) |
virtual void | SetPivotATransform (const Transform &TransA) |
Sets the Position and Rotation for the first body using a Transform. More... | |
virtual void | SetPivotBTransform (const Transform &TransB) |
Sets the Position and Rotation for the second body using a Transform. More... | |
Public Member Functions inherited from Mezzanine::Physics::DualTransformConstraint | |
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 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 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 | 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 | 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 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 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 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 | 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 | |
btConeTwistConstraint * | ConeTwist |
The internal 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... | |
PhysicsManager * | Manager |
This is a pointer to the physics manager that created and owns this constraint. More... | |
RigidProxy * | ProxA |
The first Collidable this constraint applies to. More... | |
RigidProxy * | ProxB |
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. | |
This is a constraint that will limit the movement allowed from one body to within a cone area around another object.
This constraint is commonly used to simulate limbs for a ragdoll and moves similarly to a ball in a socket.
In a kinematic or character chain of bones, the child limbs should be defined as Body/Proxy A, and the parents as B.
Definition at line 57 of file conetwistconstraint.h.
Mezzanine::Physics::ConeTwistConstraint::ConeTwistConstraint | ( | const UInt32 | ID, |
RigidProxy * | ProxyA, | ||
RigidProxy * | ProxyB, | ||
const Transform & | TransA, | ||
const Transform & | TransB, | ||
PhysicsManager * | Creator | ||
) |
Class constructor.
ID | The unique identifier assigned to this constraint. |
ProxyA | The first proxy to apply this constraint to. |
ProxyB | The second proxy to apply this constraint to. |
TransA | The transform in ProxyA's local space to attach this constraint to. |
TransB | The transform in ProxyB's local space to attach this constraint to. |
Creator | A pointer to the manager that created this constraint. |
Definition at line 58 of file conetwistconstraint.cpp.
Mezzanine::Physics::ConeTwistConstraint::ConeTwistConstraint | ( | const UInt32 | ID, |
RigidProxy * | ProxyA, | ||
const Transform & | TransA, | ||
PhysicsManager * | Creator | ||
) |
Single body constructor.
ID | The unique identifier assigned to this constraint. |
ProxyA | The first proxy to apply this constraint to. |
TransA | The transform in ProxyA's local space to attach this constraint to. |
Creator | A pointer to the manager that created this constraint. |
Definition at line 63 of file conetwistconstraint.cpp.
Mezzanine::Physics::ConeTwistConstraint::ConeTwistConstraint | ( | const XML::Node & | SelfRoot, |
PhysicsManager * | Creator | ||
) |
XML constructor.
SelfRoot | An XML::Node containing the data to populate this class with. |
Creator | A pointer to the manager that created this constraint. |
Definition at line 68 of file conetwistconstraint.cpp.
|
virtual |
Get the Bullet constraint that this class encapsulates.
Implements Mezzanine::Physics::Constraint.
Definition at line 368 of file conetwistconstraint.cpp.
|
protectedvirtual |
Creates the internal constraint.
RigidA | A pointer to the first Proxy to be constrained. |
RigidB | A pointer to the second Proxy to be constrained. |
TransA | The offset to place the constraint in the first proxys local space. |
TransB | The offset to place the constraint in the second proxys local space. |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 76 of file conetwistconstraint.cpp.
|
protectedvirtual |
Destroys the internal constraint.
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 87 of file conetwistconstraint.cpp.
|
virtual |
Enables (or disables) the motor of this constraint.
Enable | If true, the constraint will push the child body towards the orientation set as the motor target. |
Definition at line 128 of file conetwistconstraint.cpp.
|
virtual |
Gets the strength of the force enforcing the twist limits.
Definition at line 161 of file conetwistconstraint.cpp.
|
virtual |
Gets the most derived serializable name of this Constraint.
Implements Mezzanine::Physics::Constraint.
Definition at line 359 of file conetwistconstraint.cpp.
Gets a constraint limit based on Index.
LimitIndex | The index of the constraint limit to retrieve. |
Definition at line 146 of file conetwistconstraint.cpp.
|
virtual |
Gets the % portion of the swing limit in which to start enforcing the limit.
Definition at line 158 of file conetwistconstraint.cpp.
|
virtual |
Definition at line 197 of file conetwistconstraint.cpp.
|
virtual |
Gets the current Rotation and Location of ProxyA.
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 119 of file conetwistconstraint.cpp.
|
virtual |
Gets the current Rotation and Location of ProxyB.
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 122 of file conetwistconstraint.cpp.
|
virtual |
Gets the strength of the force enforcing the swing limits.
Definition at line 164 of file conetwistconstraint.cpp.
|
static |
Get the name of the the XML tag the class will leave behind as its instances are serialized.
Definition at line 362 of file conetwistconstraint.cpp.
|
virtual |
Gets the currently set value for the constraint Swing span on the Y axis.
Definition at line 149 of file conetwistconstraint.cpp.
|
virtual |
Gets the currently set value for the constraint Swing span on the Z axis.
Definition at line 152 of file conetwistconstraint.cpp.
Real Mezzanine::Physics::ConeTwistConstraint::GetTwistAngle | ( | ) | const |
Gets the current angle of thw twist applied to the constraint.
Definition at line 104 of file conetwistconstraint.cpp.
|
virtual |
Gets the currently set value for the constraint Twist span on the X axis.
Definition at line 155 of file conetwistconstraint.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 225 of file conetwistconstraint.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 216 of file conetwistconstraint.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 203 of file conetwistconstraint.cpp.
|
virtual |
Has the given Param on the Given Axis been set yet.
Param | The parameter to Check |
Axis | The Axis on which to check the param |
This will probably have to implement the same logic aas what is in the respective get/setparam function of each constraint http://bulletphysics.com/Bullet/BulletFull/classbtTypedConstraint.html#a11f44dd743b59bc05e25d500456e2559
Implements Mezzanine::Physics::Constraint.
Definition at line 234 of file conetwistconstraint.cpp.
|
virtual |
Gets whether or not the motor is enabled.
Definition at line 131 of file conetwistconstraint.cpp.
Boole Mezzanine::Physics::ConeTwistConstraint::IsPassedSwingLimit | ( | ) | const |
Gets whether or not the child object is outside the set limits for the constraint.
Definition at line 101 of file conetwistconstraint.cpp.
|
virtual |
Take the data stored in an XML Node and overwrite the properties of this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Reimplemented from Mezzanine::Physics::Constraint.
Definition at line 284 of file conetwistconstraint.cpp.
|
virtual |
Convert the properties of this class to an XML::Node ready for serialization.
SelfRoot | The root node containing all the serialized data for this instance. |
Reimplemented from Mezzanine::Physics::Constraint.
Definition at line 256 of file conetwistconstraint.cpp.
|
virtual |
Sets a constraint limit based on Index.
LimitIndex | The index of the constraint limit to alter. |
LimitValue | The value to set for the specified limit. |
Definition at line 140 of file conetwistconstraint.cpp.
|
virtual |
Sets all constraint limits.
SwingSpan1 | The first parameter that determines the size/shape of the cone in which the body will be able to move (in radians). If different from SwingSpan2 this will create a non-circular area of movement. |
SwingSpan2 | The second parameter that determines the size/shape of the cone in which the body will be able to move (in radians). If different from SwingSpan1 this will create a non-circular area of movement. |
TwistSpan | The amount of rotation that is allowed on the axis the constraint is connected, aka how much the body is allowed to twist in radians. |
Softness | A scalar value representing the % of the limits which are free to move. Above this value limits will start to be enforced with a force related to how close to the limit the constraint is. Lower values mean smoother forces being applied to keep an object within the swing limits. A value of 1.0 means the object is free to swing however within the strictly defined limits. Generally this shouldn't be below 0.8. Range: 0.0-1.0. Initial value: 1.0. |
BiasFactor | A scalar value representing how strong the the forces used to enforce the "twist" limit set on this constraint. In most cases this should remain in the range of 0.0-0.6. Allowed range: 0.0-1.0. |
RelaxationFactor | A scalar value representing how strong the forces used to enforce the "swing" limits set on this constraint. In most cases this should remain near 1.0. Range: 0.0-1.0. |
Definition at line 143 of file conetwistconstraint.cpp.
|
virtual |
Sets the Position and Rotation for the first body using a Transform.
TransA | The new position and rotation. |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 107 of file conetwistconstraint.cpp.
|
virtual |
Sets the Position and Rotation for the second body using a Transform.
TransB | The new position and rotation. |
Implements Mezzanine::Physics::DualTransformConstraint.
Definition at line 113 of file conetwistconstraint.cpp.
|
protected |
The internal constraint that this class encapsulates.
Definition at line 62 of file conetwistconstraint.h.