RBD_State Class Reference

#include <RBD_State.h>

Inheritance diagram for RBD_State:

SIM_Motion SIM_PositionSimple SIM_Position SIM_OptionsUser SIM_Data

List of all members.

Public Member Functions

 GETSET_DATA_FUNCS_M3 (RBD_NAME_ITENSOR, InertialTensor)
 GET_DATA_FUNC_M3 (RBD_NAME_ITENSORLOCALINV, InertialTensorLocalInv)
 GETSET_DATA_FUNCS_B (RBD_NAME_INHERITVELOCITY, InheritVelocity)
 GETSET_DATA_FUNCS_B (RBD_NAME_COMPUTECOM, ComputeCOM)
 GETSET_DATA_FUNCS_B (RBD_NAME_COMPUTEMASS, ComputeMass)
 GETSET_DATA_FUNCS_B (RBD_NAME_COMPUTEINERTIALTENSOR, ComputeInertialTensor)
 GETSET_DATA_FUNCS_I (RBD_NAME_COMPUTEINERTIALTENSORTYPE, ComputeInertialTensorType)
 GET_DATA_FUNC_F (RBD_NAME_DENSITY, Density)
 GETSET_DATA_FUNCS_F (RBD_NAME_MASS, Mass)
 GETSET_DATA_FUNCS_F (RBD_NAME_INERTIALTENSORSTIFFNESS, InertialTensorStiffness)
 GETSET_DATA_FUNCS_S (RBD_NAME_GLUEOBJECT, GlueObject)
 GETSET_DATA_FUNCS_F (RBD_NAME_GLUETHRESHOLD, GlueThreshold)
 GETSET_DATA_FUNCS_F (RBD_NAME_GLUEIMPULSE, GlueImpulse)
 GETSET_DATA_FUNCS_F (RBD_NAME_GLUEIMPULSEHALFLIFE, GlueImpulseHalfLife)
void updatePhysicalValues (RBD_Object *obj, const GU_SDF *sdf, const SIM_Geometry *geo, bool updatelinearvel)
void getNewPosition (const SIM_Object &object, const SIM_Time &time, const SIM_Time &timestep, UT_Vector3 &newpos, UT_Quaternion &neworient) const
void getNewVelocity (RBD_Object *object, const SIM_Time &time, const SIM_Time &timestep, UT_Vector3 &newvel, UT_Vector3 &newangvel) const
void getNewVelocity (RBD_Object *object, const SIM_Time &time, const SIM_Time &timestep, const UT_Vector3 &com, UT_Vector3 &newvel, UT_Vector3 &newangvel) const
const UT_Vector3 getNewVelocity (fpreal impulse, const UT_Vector3 &normal) const
const UT_Vector3 getNewAngularVelocity (fpreal impulse, const UT_Vector3 &pos, const UT_Vector3 &normal) const
void constrainPosition (SIM_Object &object, const SIM_Time &time, const SIM_Time &timestep, UT_Vector3 &pos, UT_Quaternion &orient) const
void constrainAccordingToPositions (const UT_Vector3Array &hard_objpos, const UT_Vector3Array &hard_goalpos, const UT_Matrix3 &hard_filter, UT_Vector3 &pos, UT_Quaternion &orient) const
void constrainVelocity (SIM_Object &object, const SIM_ObjectArray &solvingobjects, const SIM_Time &time, const SIM_Time &timestep, UT_Vector3 &vel, UT_Vector3 &angvel) const
UT_Vector3 solveForImpulse (const UT_Vector3 &pos, const UT_Vector3 &relvel) const
void changePosition (RBD_Object *obj, const UT_Vector3 &pos, const UT_Quaternion &orient)
void changeVelocity (RBD_Object *obj, const UT_Vector3 &vel, const UT_Vector3 &angvel)
void changePivot (const UT_Vector3 &pivot, bool updatetensor, bool updatelinearvel=true)
void accumulateGlueImpulse (fpreal impulse)
void decayGlueImpulse (SIM_Time timestep)

Static Public Member Functions

static void projectRigidMotion (UT_Vector3 &vel, UT_Vector3 &angvel, const UT_Vector3 &com, const UT_Vector3Array &posarray, const UT_Vector3Array &velarray)

Protected Types

enum  constrainType { CON_NONE, CON_SINGLEPOINT, CON_AXIS, CON_FULL }

Protected Member Functions

 RBD_State (const SIM_DataFactory *factory)
virtual ~RBD_State ()
virtual void optionChangedSubclass (const char *name)
constrainType findConstraintType (const UT_Vector3Array &geo, const UT_Vector3Array &anchor, UT_Vector3 &objpos, UT_Vector3 &goalpos, UT_Vector3 &objaxis, UT_Vector3 &goalaxis, UT_Quaternion &orient) const


Detailed Description

Definition at line 34 of file RBD_State.h.


Member Enumeration Documentation

enum RBD_State::constrainType [protected]

Determines what sort of freedom of movement is available if the given constraints hold. The obj list is the world coordinates of points on the geometry The goal list is the world coordinates of where those points should be. This sets the objpos to where an impulse should be given. goalpos is where objpos should be. Axis is the only axis of rotation allowed. neworient specifies the required change of orientation (in world space) for the FULL case.

Enumerator:
CON_NONE 
CON_SINGLEPOINT 
CON_AXIS 
CON_FULL 

Definition at line 215 of file RBD_State.h.


Constructor & Destructor Documentation

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

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


Member Function Documentation

void RBD_State::accumulateGlueImpulse ( fpreal  impulse  ) 

These alert the frozen object to impulses, causing it to break off if they become large enough.

void RBD_State::changePivot ( const UT_Vector3 pivot,
bool  updatetensor,
bool  updatelinearvel = true 
)

This changes the pivot point of the object to the new value. The new value is given in object cooridinates! This will adjust both Position and Pivot so the object's position doesn't change as a result. This also changes the inertial tensor to account for the new "center of mass". Changing the inertial tensor in this fashion is NOT invertible! updatelinearvel controls whether the linear velocity should be updated taking into account the angular velocity

void RBD_State::changePosition ( RBD_Object obj,
const UT_Vector3 pos,
const UT_Quaternion orient 
)

These act as setPosition, setOrientation and setVelocity, setAngularVelocity. The main difference is that they will properly propagate to frozen sub objects.

void RBD_State::changeVelocity ( RBD_Object obj,
const UT_Vector3 vel,
const UT_Vector3 angvel 
)

void RBD_State::constrainAccordingToPositions ( const UT_Vector3Array hard_objpos,
const UT_Vector3Array hard_goalpos,
const UT_Matrix3 hard_filter,
UT_Vector3 pos,
UT_Quaternion orient 
) const

Determines the new pos and orient that best satisfies the set of constraints. hard_objpos and hard_goal pos are both in world coordinates. The new pos and orient should be such that the change will map hard_objpos onto hard_goalpos.

void RBD_State::constrainPosition ( SIM_Object object,
const SIM_Time time,
const SIM_Time timestep,
UT_Vector3 pos,
UT_Quaternion orient 
) const

Iterate over all hard constraints and constrain the pos and orient to those constraints. The new values are output in pos & orient. Note you likely want to constrain with time' = (time + timestep) if you solved with time.

void RBD_State::constrainVelocity ( SIM_Object object,
const SIM_ObjectArray solvingobjects,
const SIM_Time time,
const SIM_Time timestep,
UT_Vector3 vel,
UT_Vector3 angvel 
) const

Iterate over all the hard constraints and constraint the velocity according to those constraints. The new values are output in pos & orient. Note you likely want to constrain with time' = (time + timestep) if you solved with time. This only resolves nail constraints. Pin constraints are handled at the RBD_Solver level as they can affect other objects.

void RBD_State::decayGlueImpulse ( SIM_Time  timestep  ) 

This decays the frozen impulse according to the given timestep.

constrainType RBD_State::findConstraintType ( const UT_Vector3Array geo,
const UT_Vector3Array anchor,
UT_Vector3 objpos,
UT_Vector3 goalpos,
UT_Vector3 objaxis,
UT_Vector3 goalaxis,
UT_Quaternion orient 
) const [protected]

RBD_State::GET_DATA_FUNC_F ( RBD_NAME_DENSITY  ,
Density   
)

RBD_State::GET_DATA_FUNC_M3 ( RBD_NAME_ITENSORLOCALINV  ,
InertialTensorLocalInv   
)

const UT_Vector3 RBD_State::getNewAngularVelocity ( fpreal  impulse,
const UT_Vector3 pos,
const UT_Vector3 normal 
) const

void RBD_State::getNewPosition ( const SIM_Object object,
const SIM_Time time,
const SIM_Time timestep,
UT_Vector3 newpos,
UT_Quaternion neworient 
) const

Integrates the position of this object forward by a timestep. The current velocity is treated as constant.

const UT_Vector3 RBD_State::getNewVelocity ( fpreal  impulse,
const UT_Vector3 normal 
) const

Applies an impulse to this object. This results in an instantaneous change in velocity.

void RBD_State::getNewVelocity ( RBD_Object object,
const SIM_Time time,
const SIM_Time timestep,
const UT_Vector3 com,
UT_Vector3 newvel,
UT_Vector3 newangvel 
) const

Integrates velocity forward by one timestep. This uses the specified center of mass for sampling the force function rather than the objects pivot.

void RBD_State::getNewVelocity ( RBD_Object object,
const SIM_Time time,
const SIM_Time timestep,
UT_Vector3 newvel,
UT_Vector3 newangvel 
) const

Integrates velocity forward by one timestep. This will iterate over all forces and soft constraints to construct the required acceleration & apply it.

RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTEINERTIALTENSOR  ,
ComputeInertialTensor   
)

RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTEMASS  ,
ComputeMass   
)

RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTECOM  ,
ComputeCOM   
)

RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_INHERITVELOCITY  ,
InheritVelocity   
)

RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUEIMPULSEHALFLIFE  ,
GlueImpulseHalfLife   
)

RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUEIMPULSE  ,
GlueImpulse   
)

RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUETHRESHOLD  ,
GlueThreshold   
)

RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_INERTIALTENSORSTIFFNESS  ,
InertialTensorStiffness   
)

RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_MASS  ,
Mass   
)

RBD_State::GETSET_DATA_FUNCS_I ( RBD_NAME_COMPUTEINERTIALTENSORTYPE  ,
ComputeInertialTensorType   
)

RBD_State::GETSET_DATA_FUNCS_M3 ( RBD_NAME_ITENSOR  ,
InertialTensor   
)

RBD_State::GETSET_DATA_FUNCS_S ( RBD_NAME_GLUEOBJECT  ,
GlueObject   
)

virtual void RBD_State::optionChangedSubclass ( const char *  name  )  [protected, virtual]

Override setOrientation because we need to update our local inertial tensor when we do this.

Reimplemented from SIM_PositionSimple.

static void RBD_State::projectRigidMotion ( UT_Vector3 vel,
UT_Vector3 angvel,
const UT_Vector3 com,
const UT_Vector3Array posarray,
const UT_Vector3Array velarray 
) [static]

Takes an array of points in space with associated velocities. Computes the angular velocity and velocity that best matches the given values. Each point/velocity pair is treated as equally important. Note that center of mass is only needed to compute the linear component.

UT_Vector3 RBD_State::solveForImpulse ( const UT_Vector3 pos,
const UT_Vector3 relvel 
) const

This utility method solves for the impulse required to create induce the given relative velocity at the given point. This does *not* take the current velocity into consideration! If the returned impulse is applied, the new velocity at the point would change by relative velocity.

void RBD_State::updatePhysicalValues ( RBD_Object obj,
const GU_SDF sdf,
const SIM_Geometry geo,
bool  updatelinearvel 
)

Updates our values based on a given SDF or Geometry. If SDF is null, will use the geometry and assume a thin plate model. This will update the mass, COM, and ITensor provided the relevant compute flags are true. It will also recalculate your linear & angular velocity from the underlying geometry if inherit is turned on. updatelinearvel controls whether the linear velocity should be updated when computing the COM. It has no effect on calculations for inheriting vel


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

Generated on Mon Jan 28 00:29:50 2013 for HDK by  doxygen 1.5.9