SIM_ConAnchorRotational Class Reference

#include <SIM_ConAnchorRotational.h>

Inheritance diagram for SIM_ConAnchorRotational:

SIM_ConAnchor SIM_Data SIM_OptionsUser SIM_ConAnchorAlignAxis SIM_ConAnchorObjRotational SIM_ConAnchorWorldSpaceRot SIM_ConAnchorObjPointRot SIM_ConAnchorObjSpaceRot SIM_ConAnchorObjPointIdRot SIM_ConAnchorObjPointNumRot

List of all members.

Public Types

enum  SIM_DOFType { DOF_FREE = 0, DOF_PLANEJOINT = 1, DOF_HINGE = 2, DOF_ORIENT = 3 }
 We need better names for these. More...

Public Member Functions

 GETSET_DATA_FUNCS_V3 (SIM_NAME_ROTATION, RotationInput)
 GETSET_DATA_FUNCS_E (SIM_NAME_CONDOF, DOFTypeInput, SIM_DOFType)
 GETSET_DATA_FUNCS_V3 (SIM_NAME_CONDIR, DOFVectorInput)
const UT_Vector3 getRotation () const
 Overridable get/set for Rotation and DOF of constraint.
void setRotation (const UT_Vector3 &rotation)
SIM_DOFType getDOFType () const
void setDOFType (const SIM_DOFType type)
const UT_Vector3 getDOFVector () const
void setDOFVector (const UT_Vector3 &vector)
UT_Vector3 getGuidePosition (const SIM_Time &t) const
 Retrieve the world-space position for the guide geometry.
UT_Quaternion getOrientation (const SIM_Time &time) const
 Retrieve the world-space orientation to constrain to.
UT_Vector3 getAngularVelocity (const SIM_Time &time) const
int getNumConDOFs () const
 Retrieve number of constrained degrees of freedom.
void getConDOFFilter (UT_Matrix3 &result, const SIM_Time &time) const
void getUnconDOFFilter (UT_Matrix3 &result, const SIM_Time &time) const

Protected Member Functions

 SIM_ConAnchorRotational (const SIM_DataFactory *f)
virtual ~SIM_ConAnchorRotational ()
virtual void buildAnchorGuideGeometrySubclass (const SIM_Options &options, const GU_DetailHandle &gdh, const SIM_Relationship &rel, const SIM_Time &t) const
 Default implementation does nothing.
virtual UT_Vector3 getGuidePositionSubclass (const SIM_Time &time) const
virtual UT_Quaternion getOrientationSubclass (const SIM_Time &time) const =0
virtual UT_Vector3 getAngularVelocitySubclass (const SIM_Time &time) const =0
virtual const UT_Vector3 getRotationSubclass () const
virtual SIM_DOFType getDOFTypeSubclass () const
virtual const UT_Vector3 getDOFVectorSubclass () const


Detailed Description

Rotational constraints are a bit odd. We categorize constraints by the shape created by sweeping the possible rotation axes through unconstrained space. The numerical representation is thus the number of degrees that have been constrained. "DOF" stands for "degrees of freedom".

Definition at line 28 of file SIM_ConAnchorRotational.h.


Member Enumeration Documentation

We need better names for these.

Enumerator:
DOF_FREE  DOF_FREE is a complete absence of any restrictions on orientation. Any orientation is valid.
DOF_PLANEJOINT  DOF_PLANEJOINT provides the mobility of a thick wire system. The plane's axis can be made to look in any direction, but can't be rotated freely. Only rotations whose axes lie in a given plane are allowed.
DOF_HINGE  DOF_HINGE allows any orientation around a specific axis. A specific axis is locked, rotating around that is allowed.
DOF_ORIENT  DOF_ORIENT provides no free orientation. Orientation completely locked down.

Definition at line 34 of file SIM_ConAnchorRotational.h.


Constructor & Destructor Documentation

SIM_ConAnchorRotational::SIM_ConAnchorRotational ( const SIM_DataFactory f  )  [explicit, protected]

virtual SIM_ConAnchorRotational::~SIM_ConAnchorRotational (  )  [protected, virtual]


Member Function Documentation

virtual void SIM_ConAnchorRotational::buildAnchorGuideGeometrySubclass ( const SIM_Options options,
const GU_DetailHandle gdh,
const SIM_Relationship rel,
const SIM_Time t 
) const [protected, virtual]

Default implementation does nothing.

Reimplemented from SIM_ConAnchor.

UT_Vector3 SIM_ConAnchorRotational::getAngularVelocity ( const SIM_Time time  )  const

virtual UT_Vector3 SIM_ConAnchorRotational::getAngularVelocitySubclass ( const SIM_Time time  )  const [protected, pure virtual]

void SIM_ConAnchorRotational::getConDOFFilter ( UT_Matrix3 result,
const SIM_Time time 
) const

Returns a matrix that, when multiplied by a angular velocity, gives only the components of the angular velocity that are constrained.

SIM_DOFType SIM_ConAnchorRotational::getDOFType (  )  const

virtual SIM_DOFType SIM_ConAnchorRotational::getDOFTypeSubclass (  )  const [protected, virtual]

const UT_Vector3 SIM_ConAnchorRotational::getDOFVector (  )  const

virtual const UT_Vector3 SIM_ConAnchorRotational::getDOFVectorSubclass (  )  const [protected, virtual]

UT_Vector3 SIM_ConAnchorRotational::getGuidePosition ( const SIM_Time t  )  const

Retrieve the world-space position for the guide geometry.

virtual UT_Vector3 SIM_ConAnchorRotational::getGuidePositionSubclass ( const SIM_Time time  )  const [protected, virtual]

int SIM_ConAnchorRotational::getNumConDOFs (  )  const

Retrieve number of constrained degrees of freedom.

UT_Quaternion SIM_ConAnchorRotational::getOrientation ( const SIM_Time time  )  const

Retrieve the world-space orientation to constrain to.

virtual UT_Quaternion SIM_ConAnchorRotational::getOrientationSubclass ( const SIM_Time time  )  const [protected, pure virtual]

const UT_Vector3 SIM_ConAnchorRotational::getRotation (  )  const

Overridable get/set for Rotation and DOF of constraint.

virtual const UT_Vector3 SIM_ConAnchorRotational::getRotationSubclass (  )  const [protected, virtual]

SIM_ConAnchorRotational::GETSET_DATA_FUNCS_E ( SIM_NAME_CONDOF  ,
DOFTypeInput  ,
SIM_DOFType   
)

SIM_ConAnchorRotational::GETSET_DATA_FUNCS_V3 ( SIM_NAME_CONDIR  ,
DOFVectorInput   
)

All constraints are represented by a vector which is interpreted differently depending on how many DOF will be constrained.

If O is the orientation to constrain, and Q the rest orientation, and V the vector: Free constraint: O = O No constraint occurs.

Plane constraint: (O / Q) . V = 0 The rotation which maps from Q to O should not have any component of V in it. This allows all orientations which can be reached from Q by rotating around a vector perpendicular to V.

Hinge constraint: (O / Q) = s V, for some s There is one degree of freedom. The set of valid orientations are those that can be reached from Q by rotating around V.

Orient constraint: O = Q The quaternion is fully constrained.

Through further abuse of notation, we can define the UnconDOFFilter which when applied to an angular velocity will cause it to fulfill those conditions. We can then clamp a quaternion O into the desired value Q according to the filter uF with: O' = ((uF) * (O / Q)) * Q

(Note that uF is symmetric and O/Q a vector, so we don't have to worry which side we multiply it on.)

This vector is defined in *object* space. (Ie, a value of (1, 0, 0) means that the X axis of the object should point in the fashion that the X axis of O does)

SIM_ConAnchorRotational::GETSET_DATA_FUNCS_V3 ( SIM_NAME_ROTATION  ,
RotationInput   
)

void SIM_ConAnchorRotational::getUnconDOFFilter ( UT_Matrix3 result,
const SIM_Time time 
) const

void SIM_ConAnchorRotational::setDOFType ( const SIM_DOFType  type  ) 

void SIM_ConAnchorRotational::setDOFVector ( const UT_Vector3 vector  ) 

void SIM_ConAnchorRotational::setRotation ( const UT_Vector3 rotation  ) 


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

Generated on Fri May 25 00:10:39 2012 for HDK by  doxygen 1.5.9