SIM_ConAnchorSpatial Class Reference

#include <SIM_ConAnchorSpatial.h>

Inheritance diagram for SIM_ConAnchorSpatial:

SIM_ConAnchor SIM_Data SIM_OptionsUser SIM_ConAnchorObjSpatial SIM_ConAnchorWorldSpacePos SIM_ConAnchorObjPointPos SIM_ConAnchorObjPrimPos SIM_ConAnchorObjSpacePos SIM_ConAnchorObjPointIdPos SIM_ConAnchorObjPointNumPos

List of all members.

Public Types

enum  SIM_DOFType { DOF_SPACE = 0, DOF_PLANE = 1, DOF_LINE = 2, DOF_POINT = 3 }

Public Member Functions

 GETSET_DATA_FUNCS_E (SIM_NAME_CONDOF, DOFTypeInput, SIM_DOFType)
 GETSET_DATA_FUNCS_V3 (SIM_NAME_CONDIR, DOFVectorInput)
SIM_DOFType getDOFType () const
 Overridable get/set for the DOF of the constraint.
void setDOFType (const SIM_DOFType type)
const UT_Vector3 getDOFVector () const
void setDOFVector (const UT_Vector3 &vector)
UT_Vector3 getPosition (const SIM_Time &time) const
 Retrieve the world-space position to constrain to.
UT_Vector3 getVelocity (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_ConAnchorSpatial (const SIM_DataFactory *factory)
virtual ~SIM_ConAnchorSpatial ()
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 getPositionSubclass (const SIM_Time &time) const =0
virtual UT_Vector3 getVelocitySubclass (const SIM_Time &) const
virtual SIM_DOFType getDOFTypeSubclass () const
virtual const UT_Vector3 getDOFVectorSubclass () const


Detailed Description

Normally, constraints affect all three positional degrees of freedom of an object. Some constraints, however, can limit their action to only one or two degrees of freedom. For example, a hard constraint might only force geometry to follow the anchor in y, and leave the x and z DOFs unconstrained. In these situations, the constraint is completely independent of the unconstrained DOFs - movement of the geometry in unconstrained directions has no effect on the constraint (e.g., doesn't affect springs), and the constraint never has an effect in these DOFs (e.g., the constraint will never cause movement in x or z in the earlier example).

Definition at line 34 of file SIM_ConAnchorSpatial.h.


Member Enumeration Documentation

We categorize constraints by the shape created by sweeping a point through unconstrained space. The numerical representation is thus the number of degrees that have been constrained. "DOF" stands for "degrees of freedom".

Enumerator:
DOF_SPACE 
DOF_PLANE  Any point in space is valid. (i.e., constraint has no effect)
DOF_LINE  Any point on a plane is valid.
DOF_POINT  Any point on a line is valid.

Definition at line 41 of file SIM_ConAnchorSpatial.h.


Constructor & Destructor Documentation

SIM_ConAnchorSpatial::SIM_ConAnchorSpatial ( const SIM_DataFactory factory  )  [explicit, protected]

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


Member Function Documentation

virtual void SIM_ConAnchorSpatial::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.

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

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

SIM_DOFType SIM_ConAnchorSpatial::getDOFType (  )  const

Overridable get/set for the DOF of the constraint.

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

const UT_Vector3 SIM_ConAnchorSpatial::getDOFVector (  )  const

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

int SIM_ConAnchorSpatial::getNumConDOFs (  )  const

Retrieve number of constrained degrees of freedom.

UT_Vector3 SIM_ConAnchorSpatial::getPosition ( const SIM_Time time  )  const

Retrieve the world-space position to constrain to.

virtual UT_Vector3 SIM_ConAnchorSpatial::getPositionSubclass ( const SIM_Time time  )  const [protected, pure virtual]

SIM_ConAnchorSpatial::GETSET_DATA_FUNCS_E ( SIM_NAME_CONDOF  ,
DOFTypeInput  ,
SIM_DOFType   
)

SIM_ConAnchorSpatial::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. This is troublesome as it only works in 3d. Ideally, we should specify two types of constraints: If P is the point to constrain, and R the rest point, and V the vector, we have: Normal constraint: dot(V, P) = dot(V, R) This removes one degree of freedom. Equivalent to PLANE. Vector constraint: P - R = s V, for some s This removes all but one degree of freedom. Equivalent to LINE. The result of this is always normalized.

We can then define the UnconDOFFilter which, when applied to a velocity, will cause it to fulfill those conditions. We can then clamp a position P to a rest position R with the filter uF with: P' = (uF * (P - R)) + R (Note that we can also use the ConDOFFilter with the following equation: P' = (F * (R - P)) + P We present it with the unconstrained case to match the rotational case which is harder to rearrange)

This vector is defined in simulation space, and may not be normalized.

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

UT_Vector3 SIM_ConAnchorSpatial::getVelocity ( const SIM_Time time  )  const

virtual UT_Vector3 SIM_ConAnchorSpatial::getVelocitySubclass ( const SIM_Time  )  const [protected, virtual]

void SIM_ConAnchorSpatial::setDOFType ( const SIM_DOFType  type  ) 

void SIM_ConAnchorSpatial::setDOFVector ( const UT_Vector3 vector  ) 


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

Generated on Mon Jan 28 00:48:52 2013 for HDK by  doxygen 1.5.9