SIM_ConRelSpring Class Reference

#include <SIM_ConRelSpring.h>

Inheritance diagram for SIM_ConRelSpring:

SIM_ConRel SIM_OptionsUser SIM_Data

List of all members.

Public Member Functions

UT_Vector3 getForce (const SIM_Time &time, const SIM_ConAnchorSpatial &objAnchor, const SIM_ConAnchorSpatial &otherAnchor, UT_Matrix3 *jacobianPos=NULL, UT_Matrix3 *jacobianVel=NULL)
UT_Vector3 getForce (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter)
UT_Vector3 getTorque (const UT_Quaternion &objOrient, const UT_Vector3 &objAngVel, const UT_Quaternion &anchorOrient, const UT_Vector3 &anchorAngVel)
UT_Matrix3 getJacobianPos (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter) const
UT_Matrix3 getJacobianVel (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter) const
 Get Jacobian with respect to velocity, dF/dv. Same caveats as dF/dx.
 GETSET_DATA_FUNCS_F (SIM_NAME_STRENGTH, Strength)
 k
 GETSET_DATA_FUNCS_F (SIM_NAME_RESTLENGTH, RestLength)
 L.
 GETSET_DATA_FUNCS_F (SIM_NAME_DAMPING, Damping)
 kd

Protected Member Functions

 SIM_ConRelSpring (const SIM_DataFactory *factory)
virtual ~SIM_ConRelSpring ()
virtual void setStateForceSubclass (fpreal force)
virtual fpreal getStateForceSubclass () const
virtual void setStateDistanceSubclass (fpreal distance)
virtual fpreal getStateDistanceSubclass () const
virtual void buildConRelGuideSpatial (const GU_DetailHandle &gdh, const SIM_Options &options, const UT_Vector3 &anchorPos1, const UT_Vector3 &anchorPos2) const
virtual UT_Vector3 getForceSubclass (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter)
virtual UT_Vector3 getTorqueSubclass (const UT_Quaternion &objOrient, const UT_Vector3 &objAngVel, const UT_Quaternion &anchorOrient, const UT_Vector3 &anchorAngVel)
virtual UT_Matrix3 getJacobianPosSubclass (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter) const
virtual UT_Matrix3 getJacobianVelSubclass (const UT_Vector3 &objAnchorPos, const UT_Vector3 &objAnchorVel, const UT_Vector3 &otherAnchorPos, const UT_Vector3 &otherAnchorVel, const UT_Matrix3 &dofFilter) const
UT_Vector3 project (const UT_Vector3 &vec, const UT_Matrix3 &dofFilter) const


Detailed Description

Defines a spring force between two anchors to enforce the constraint between them.

The force is expressed mathematically as: F = -k * (|x| - L) * ( x/|x| ) with a damping force of Fd = -kd * (v . (x/|x|)) * (x/|x|) where x is the vector connecting the two anchors and v is dx/dt.

Torque is defined similarly.

Definition at line 35 of file SIM_ConRelSpring.h.


Constructor & Destructor Documentation

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

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


Member Function Documentation

virtual void SIM_ConRelSpring::buildConRelGuideSpatial ( const GU_DetailHandle gdh,
const SIM_Options options,
const UT_Vector3 anchorPos1,
const UT_Vector3 anchorPos2 
) const [protected, virtual]

Reimplemented from SIM_ConRel.

UT_Vector3 SIM_ConRelSpring::getForce ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
)

UT_Vector3 SIM_ConRelSpring::getForce ( const SIM_Time time,
const SIM_ConAnchorSpatial objAnchor,
const SIM_ConAnchorSpatial otherAnchor,
UT_Matrix3 jacobianPos = NULL,
UT_Matrix3 jacobianVel = NULL 
)

Retrieve the force (and optional jacobian) acting on objAnchor from a spring.

virtual UT_Vector3 SIM_ConRelSpring::getForceSubclass ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
) [protected, virtual]

UT_Matrix3 SIM_ConRelSpring::getJacobianPos ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
) const

Get Jacobian with respect to position, dF/dx. The returned Jacobian is w.r.t. the obj point (dF_i/dx_i); the Jacobian for the other point is the same thing, just negated (dF_i/dx_j = -dF_i/dx_i)

virtual UT_Matrix3 SIM_ConRelSpring::getJacobianPosSubclass ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
) const [protected, virtual]

UT_Matrix3 SIM_ConRelSpring::getJacobianVel ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
) const

Get Jacobian with respect to velocity, dF/dv. Same caveats as dF/dx.

virtual UT_Matrix3 SIM_ConRelSpring::getJacobianVelSubclass ( const UT_Vector3 objAnchorPos,
const UT_Vector3 objAnchorVel,
const UT_Vector3 otherAnchorPos,
const UT_Vector3 otherAnchorVel,
const UT_Matrix3 dofFilter 
) const [protected, virtual]

SIM_ConRelSpring::GETSET_DATA_FUNCS_F ( SIM_NAME_DAMPING  ,
Damping   
)

kd

SIM_ConRelSpring::GETSET_DATA_FUNCS_F ( SIM_NAME_RESTLENGTH  ,
RestLength   
)

L.

SIM_ConRelSpring::GETSET_DATA_FUNCS_F ( SIM_NAME_STRENGTH  ,
Strength   
)

k

virtual fpreal SIM_ConRelSpring::getStateDistanceSubclass (  )  const [protected, virtual]

Reimplemented from SIM_ConRel.

virtual fpreal SIM_ConRelSpring::getStateForceSubclass (  )  const [protected, virtual]

Reimplemented from SIM_ConRel.

UT_Vector3 SIM_ConRelSpring::getTorque ( const UT_Quaternion objOrient,
const UT_Vector3 objAngVel,
const UT_Quaternion anchorOrient,
const UT_Vector3 anchorAngVel 
)

virtual UT_Vector3 SIM_ConRelSpring::getTorqueSubclass ( const UT_Quaternion objOrient,
const UT_Vector3 objAngVel,
const UT_Quaternion anchorOrient,
const UT_Vector3 anchorAngVel 
) [protected, virtual]

UT_Vector3 SIM_ConRelSpring::project ( const UT_Vector3 vec,
const UT_Matrix3 dofFilter 
) const [protected]

virtual void SIM_ConRelSpring::setStateDistanceSubclass ( fpreal  distance  )  [protected, virtual]

Reimplemented from SIM_ConRel.

virtual void SIM_ConRelSpring::setStateForceSubclass ( fpreal  force  )  [protected, virtual]

Reimplemented from SIM_ConRel.


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