HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RBD_State Class Reference

#include <RBD_State.h>

+ Inheritance diagram for RBD_State:

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)
 
- Public Member Functions inherited from SIM_Motion
 GETSET_DATA_FUNCS_V3 (SIM_NAME_VELOCITY, Velocity)
 Control the linear velocity attribute of this data. More...
 
 GETSET_DATA_FUNCS_V3 (SIM_NAME_ANGVELOCITY, AngularVelocityDegrees)
 
void setAngularVelocity (const UT_Vector3 &value)
 
const UT_Vector3 getAngularVelocity () const
 
const UT_Vector3 getVelocityAtPosition (const UT_Vector3 &pos, fpreal integrateovertime=0.0) const
 Gets the motion of a point that is offset from our centre of motion. More...
 
const UT_Vector3 getMaximumVelocity (fpreal radius) const
 
- Public Member Functions inherited from SIM_PositionSimple
 GETSET_DATA_FUNCS_V3 (SIM_NAME_POSITION, Position)
 Control the translation attribute of the position. More...
 
 GETSET_DATA_FUNCS_V3 (SIM_NAME_PIVOT, Pivot)
 Control the pivot point which the orientation is applied to. More...
 
 GETSET_DATA_FUNCS_Q (SIM_NAME_ORIENTATION, Orientation)
 Control the orientation attribute of the position. More...
 
- Public Member Functions inherited from SIM_Position
void getTransform (UT_DMatrix4 &xform) const
 
void getInverseTransform (UT_DMatrix4 &xform) const
 
void getOrientation (UT_Quaternion &q) const
 
void getPosition (UT_Vector3 &t) const
 
void getPivot (UT_Vector3 &p) const
 
UT_Vector3 selfToWorld (const UT_Vector3 &p) const
 
UT_Vector3 worldToSelf (const UT_Vector3 &p) const
 
UT_Vector3 selfToWorldVector (const UT_Vector3 &p) const
 
UT_Vector3 worldToSelfVector (const UT_Vector3 &p) const
 
- Public Member Functions inherited from SIM_Data
const UT_StringHolder & getDataType () const
 
void initialize (const SIM_SubdataBehavior &subdatabehavior)
 
void makeEqual (const SIM_Data *source, const SIM_SubdataBehavior &subdatabehavior)
 
void setParameters (const SIM_Options &parms)
 
void interpolate (const SIM_Data *source1, const SIM_Data *source2, fpreal interp)
 
int64 getMemorySize () const
 
bool getIsAlternateRepresentation () const
 
bool saveToFile (const char *filename, UT_CompressionType compression_type) const
 
bool saveToStream (std::ostream &os, UT_CompressionType compression_type) const
 
void appendFullDataPath (const SIM_Data *subdata, bool useobjectid, UT_String &datapath) const
 
bool loadFromFile (const char *filename)
 
bool loadFromStream (UT_IStream &is, bool skiptype=false)
 
bool getIsOfType (const UT_StringRef &datatype) const
 
const void * getConstPointerToType (const UT_StringRef &datatype) const
 
void * getPointerToType (const UT_StringRef &datatype)
 
int getNumSubData () const
 Get the number of sub-data items attached to this data. More...
 
const UT_StringHolder & getSubDataName (int index) const
 Get the name of the sub-data at a particular index location. More...
 
int getSubDataIndex (const SIM_Data *subdata) const
 
bool buildSubDataPath (const SIM_Data *subdata, UT_String &pathto) const
 
const SIM_Query & getQueryObject () const
 
SIM_Options * getUserOptions ()
 
const SIM_Options * getConstUserOptions () const
 
long getGuideParmVersion () const
 
void addGuideDep (DEP_MicroNode &src) const
 
virtual bool getGuideGeometryList (const SIM_RootData &root, const char *datapath, const SIM_Time &t, UT_Array< GU_ConstDetailHandle > &detail_array, UT_Array< UT_DMatrix4 > &xform_array) const
 
GU_ConstDetailHandle getGuideGeometry (const SIM_RootData &root, const char *datapath, UT_DMatrix4 &xform, const SIM_Time &t) const
 
void buildGuideOptions (SIM_Options &options, const SIM_Time &time) const
 
SIM_Data * getSubData (int index)
 
const SIM_Data * getConstSubData (int index) const
 
SIM_Data * getNamedSubData (const char *dataname)
 
const SIM_Data * getConstNamedSubData (const char *dataname) const
 
void filterSubData (SIM_DataArray &ncdp, UT_StringArray *names, const SIM_DataFilter &ncfilter, const char *startfrom, const SIM_DataFilter &recursefilter)
 
void filterConstSubData (SIM_ConstDataArray &dp, UT_StringArray *names, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurse_filter) const
 
SIM_Data * getNthSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurse_filter)
 
const SIM_Data * getNthConstSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurse_filter) const
 
void forEachSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurse_filter)
 
void forEachConstSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurse_filter) const
 
SIM_Data * createNamedSubData (const char *dataname, const char *datatype, int creationflags, UT_String *newdatanameptr=NULL)
 
SIM_Data * getOrCreateAlternateRepresentation (const char *dataname, const char *datatype) const
 
void interpolateSubData (const SIM_Data &source1, const SIM_Data &source2, fpreal interp, const SIM_DataFilter &interpdata, const SIM_DataFilter &recurse)
 
void setNamedSubData (const char *dataname, const SIM_Data *data, int setflags)
 
void createUniqueSubDataName (const SIM_Data *subdata, UT_String &dataname) const
 
void removeNamedSubData (const char *dataname)
 Remove some existing sub-data by name. More...
 
void removeSubData (int index)
 Remove some existing sub-data by index. More...
 
void moveNamedSubData (const char *oldname, const char *newname)
 
const UT_Guid & getUniqueId () const
 
long getReferenceCount () const
 
int getCreatorId () const
 Get the ID of the node that created this data. More...
 
OP_Node * getCreatorNode () const
 Use the creator ID to look up the OP_Node that created this data. More...
 
OP_Node * getOwnerNetwork () const
 Look up the owner node of our engine to get the DOP Network pointer. More...
 
const SIM_Engine & getEngine () const
 Get the engine that created us (from our data factory). More...
 
int getCreatorIndex () const
 Get the output index of the creator node that generated this data. More...
 
const SIM_Time & getCreationTime () const
 Get the creation time for this data. More...
 
bool getIsSelected () const
 Get the selected flag for this data. More...
 
void setIsSelected (bool selected) const
 
bool getSelectionRepresentsObject () const
 
void copyCreationInfoFrom (const SIM_Data *source)
 
OP_Node & getNodePathsRelativeTo () const
 
OP_Node * getOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
OBJ_Node * getOBJNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
SOP_Node * getSOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a SOP_Node. More...
 
DOP_Node * getDOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a DOP_Node. More...
 
COP2_Node * getCOP2Node (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a COP2_Node. More...
 
CHOP_Node * getCHOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a CHOP_Node. More...
 
void addOPInterest (OP_Node *node) const
 Adds an interest in the specified node to our engine's owner node. More...
 
void addError (const SIM_RootData *root, int errorcode, const char *errorparm, UT_ErrorSeverity severity) const
 Adds an error to our SIM_Engine. More...
 
void makeMemberDataUnique ()
 
virtual void makeMemberDataUniqueSubclass ()
 
- Public Member Functions inherited from SIM_OptionsUser
 SIM_OptionsUser (SIM_Data *owner)
 
virtual ~SIM_OptionsUser ()
 
void optionChanged (const char *name)
 
const SIM_Options & getOptions () const
 

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)
 
- Static Public Member Functions inherited from SIM_Motion
static UT_Vector3 getVelocityAtPosition (const UT_Vector3 &location, const UT_Vector3 &velocity, const UT_Vector3 &angvel, const UT_Vector3 &position, const UT_Vector3 &pivot, fpreal integrateovertime=0.0)
 
- Static Public Member Functions inherited from SIM_Data
static bool getDataTypeFromFile (const char *filename, UT_String &datatype)
 
static bool getDataTypeFromStream (UT_IStream &is, UT_String &datatype)
 
static const void * castConstPointerToType (const SIM_Data *data, const UT_StringRef &datatype)
 
static void * castPointerToType (SIM_Data *data, const UT_StringRef &datatype)
 

Protected Types

enum  constrainType { CON_NONE, CON_SINGLEPOINT, CON_AXIS, CON_FULL }
 

Protected Member Functions

 RBD_State (const SIM_DataFactory *factory)
 
 ~RBD_State () override
 
void optionChangedSubclass (const char *name) override
 
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
 
- Protected Member Functions inherited from SIM_Motion
 SIM_Motion (const SIM_DataFactory *factory)
 
 ~SIM_Motion () override
 
- Protected Member Functions inherited from SIM_PositionSimple
 SIM_PositionSimple (const SIM_DataFactory *factory)
 
 ~SIM_PositionSimple () override
 
void optionChangedSubclass (const char *name) override
 
void getTransformSubclass (UT_DMatrix4 &xform) const override
 Gets a transform matrix from our position and rotation data. More...
 
void getInverseTransformSubclass (UT_DMatrix4 &xform) const override
 
void getOrientationSubclass (UT_Quaternion &q) const override
 Gets a rotation matrix from our position data. More...
 
void getPositionSubclass (UT_Vector3 &t) const override
 Gets a translation vector from our position data. More...
 
void getPivotSubclass (UT_Vector3 &p) const override
 Gets pivot info from our position data. More...
 
UT_Vector3 selfToWorldSubclass (const UT_Vector3 &p) const override
 
UT_Vector3 worldToSelfSubclass (const UT_Vector3 &p) const override
 
UT_Vector3 selfToWorldVectorSubclass (const UT_Vector3 &p) const override
 
UT_Vector3 worldToSelfVectorSubclass (const UT_Vector3 &p) const override
 
void interpolateSubclass (const SIM_Data *source1, const SIM_Data *source2, fpreal interp) override
 
- Protected Member Functions inherited from SIM_Position
 SIM_Position (const SIM_DataFactory *factory)
 
 ~SIM_Position () override
 
- Protected Member Functions inherited from SIM_Data
 SIM_Data (const SIM_DataFactory *factory)
 
virtual ~SIM_Data ()
 
void handleModification (int code=-1)
 
void setNeedsToRecalculateMemorySize () const
 
void deleteQueryObjectIfNotBuilding () const
 Deletes the query object for this data, if there is one. More...
 
void deleteGuideObjectIfNotBuilding () const
 Delete the guide geometry for this data, if it exists. More...
 
void initAlternateRepresentation () const
 
void setNeedsInitialization (bool needsinit) const
 Flags an alternate representation subdata as requiring initialization. More...
 
bool getNeedsInitialization () const
 Tests whether an alternate representation requires initialization. More...
 
bool saveOptionPacket (std::ostream &os, const char *name, const SIM_Options *opts) const
 
bool loadOptionPacket (UT_IStream &is, const char *name, SIM_Options *opts) const
 
bool getIsDoingSimplifiedSaveLoad () const
 
void initializeFromParmDefaults ()
 
void setSelectionRepresentsObject (bool representsobject)
 
virtual void setNeedsInitializationSubclass (bool needsinit) const
 
virtual void initializeSubclass ()
 
virtual void makeEqualSubclass (const SIM_Data *source)
 
virtual void saveSubclass (std::ostream &os) const
 
virtual void saveIOSubclass (std::ostream &os, SIM_DataThreadedIO *io) const
 
virtual bool loadSubclass (UT_IStream &is)
 
virtual bool loadIOSubclass (UT_IStream &is, SIM_DataThreadedIO *io)
 
virtual SIM_Query * createQueryObjectSubclass () const
 
virtual long getGuideParmVersionSubclass () const
 
virtual SIM_Guide * createGuideObjectSubclass () const
 
virtual void buildGuideGeometrySubclass (const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const
 
virtual void setParametersSubclass (const SIM_Options &parms)
 
virtual void setNamedSubDataSubclass (const char *dataname, const SIM_Data *data)
 
virtual void removeNamedSubDataSubclass (const char *dataname)
 
virtual int64 getMemorySizeSubclass () const
 
virtual void handleModificationSubclass (int code)
 
virtual bool getIsAlternateRepresentationSubclass () const
 
virtual void initAlternateRepresentationSubclass (const SIM_Data &)
 
virtual void * getCastToType (const UT_StringRef &datatype) const
 
virtual const UT_StringHolder & getDataTypeSubclass () const
 
const SIM_Data * getAlternateRepresentationOf () const
 
- Protected Member Functions inherited from SIM_OptionsUser
SIM_Options & getOptions ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from SIM_Data
static const PRM_Template * getEmptyTemplateList ()
 
static const SIM_DopDescription * getEmptyDopDescription ()
 A DOP description that says not to create an automatic DOP. More...
 
static void getDataTypeSuperclasses (UT_StringArray &)
 

Detailed Description

Definition at line 28 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 209 of file RBD_State.h.

Constructor & Destructor Documentation

RBD_State::RBD_State ( const SIM_DataFactory *  factory)
explicitprotected
RBD_State::~RBD_State ( )
overrideprotected

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.

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.

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.

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.

RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_INHERITVELOCITY  ,
InheritVelocity   
)
RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTECOM  ,
ComputeCOM   
)
RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTEMASS  ,
ComputeMass   
)
RBD_State::GETSET_DATA_FUNCS_B ( RBD_NAME_COMPUTEINERTIALTENSOR  ,
ComputeInertialTensor   
)
RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_MASS  ,
Mass   
)
RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_INERTIALTENSORSTIFFNESS  ,
InertialTensorStiffness   
)
RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUETHRESHOLD  ,
GlueThreshold   
)
RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUEIMPULSE  ,
GlueImpulse   
)
RBD_State::GETSET_DATA_FUNCS_F ( RBD_NAME_GLUEIMPULSEHALFLIFE  ,
GlueImpulseHalfLife   
)
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   
)
void RBD_State::optionChangedSubclass ( const char *  name)
overrideprotectedvirtual

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

Reimplemented from SIM_OptionsUser.

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: