RBD_Object Class Reference

#include <RBD_Object.h>

Inheritance diagram for RBD_Object:

SIM_ObjectSolveInfo

List of all members.

Public Member Functions

 RBD_Object (const SIM_Solver *solver, SIM_Object *obj)
virtual ~RBD_Object ()
SIM_ObjectgetObject () const
RBD_StategetState () const
SIM_ImpactsgetImpacts ()
const SIM_SDFgetSDF () const
const SIM_GeometrygetGeometry () const
const RBD_SphereTreegetSphereTree () const
fpreal getRadius () const
bool isInfiniteExtent () const
void getBBox (UT_BoundingBox &bbox) const
void accumulatePointVelocity (UT_Vector3Array &pos, UT_Vector3Array &vel) const
void stashState ()
 Stashes the current state internally.
void reloadImpacts (SIM_Collider::SIM_ImpactApplyType impactaplytype)
void preserveImpacts (SIM_Engine *engine)
void restoreStatePos ()
 Restores the position of the state using changePosition.
void restoreStateVel ()
 Restores the velocity of the state using changeVelocity.
void restoreState ()
 Restores the full state.
void getGlueSubObjects (RBD_ObjectArray &objlist) const
 This returns a list of all the objects that are frozen to us.
int getNumGlueSubObjects () const
RBD_ObjectgetNthGlueSubObject (int i) const
RBD_ObjectgetGlueParent () const
 Returns our parent object, null if not glued.
bool hasGlueSubObjects () const
 This returns true if we have any frozen sub objects.
void addGlueSubObject (RBD_Object *obj)
 Marks that obj is glued to this.
void removeGlueSubObject (RBD_Object *obj)
 Removes that object as being glued to this.
bool hasAsGlueChild (RBD_Object *obj)
 Returns true if the given object is one of our glue children.
bool isGlued () const
 Return if this object is glued to somewhere else.
void buildImpulseModel (UT_DMatrix3 &k, const UT_Vector3 &f, const UT_Vector3 &p) const
void buildImpulseModelForA (UT_DMatrix3 &k, const UT_Vector3 &f, const UT_Vector3 &p, RBD_Object *A) const
void buildConstraints (const RBD_Solver *solver, const SIM_Time &time, const SIM_Time &endtime)
void removeConstraints ()
void applyImpulse (const UT_Vector3 &pos, fpreal impulse, const UT_Vector3 &normal)
void applyImpacts (const SIM_Impacts *impacts, const SIM_Time &time, const SIM_Time &timestep)
 Applies impulses from SIM_Impacts data.
void integratePosition (const SIM_Time &time, const SIM_Time &timestep)
 Integrate position. Uses current velocity.
void integrateVelocity (const SIM_Time &time, const SIM_Time &timestep)
 Integrate velocity. Finds & applies all forces.
void initSDF ()
void initFromGeometry ()
 Updates the state from geometry, unless already calculated.
void initRadius ()
 Calculates the radius, unless already calculated.
void initBBox (bool useSDF)
 Calculates the bounding box.
void gatherBuilderRequests (UT_RefArray< GU_SDFDelayedBuilder > &buildrequests)
 Gathers all of our builder requests.
void initForCollisions ()
 Initialize for collisions.
fpreal getPropertyAtPosition (const SIM_Property &property, const UT_Vector3 &pos) const
 Calculates the property value at the given world position.
void rebuildAffectorList (const RBD_Solver *solver, SIM_Engine &engine, const SIM_Time &time, const SIM_Time &timestep, RBD_SharedAffectorListArray &affectorlists, UT_HashTable &affectorhash)
void getStashedTransform (UT_DMatrix4 &xform) const
 Gets the transform matrix from self to world from stashed state.
void findOverlapIdx (const RBD_Solver *solver, UT_IntArray &overlap)
void setAffectorTreeDirty ()
int getNumAffectors () const
RBD_ObjectgetAffector (int j) const
const SIM_CollidergetCollider (int j) const
SIM_Collider::SIM_ImpactApplyType getImpactApplyType (int j) const
int getArrayIndex () const
void setArrayIndex (int index)
bool hasNailConstraints () const
UT_PtrArray
< SIM_ColliderCacheData * > & 
getCollideCache ()
void clearCollideCache ()
void cachePhysicalValues ()
void restorePhysicalValues ()

Public Attributes

bool myPinProcessFlag
RBD_ObjectArray myPinObjects
UT_Vector3Array myPinAnchorPos
UT_Vector3Array myPinAnchorGoalPos

Protected Member Functions

void accumulateConstraints (const RBD_Solver *solver, RBD_Object *piece, UT_Vector3Array &hard_objpos, UT_Vector3Array &hard_goalpos, UT_Matrix3 &hard_spatialfilter, UT_Matrix3 &hard_rotationalfilter, const SIM_Time &time, const SIM_Time &endtime)


Detailed Description

Definition at line 55 of file RBD_Object.h.


Constructor & Destructor Documentation

RBD_Object::RBD_Object ( const SIM_Solver solver,
SIM_Object obj 
)

virtual RBD_Object::~RBD_Object (  )  [virtual]


Member Function Documentation

void RBD_Object::accumulateConstraints ( const RBD_Solver solver,
RBD_Object piece,
UT_Vector3Array hard_objpos,
UT_Vector3Array hard_goalpos,
UT_Matrix3 hard_spatialfilter,
UT_Matrix3 hard_rotationalfilter,
const SIM_Time time,
const SIM_Time endtime 
) [protected]

void RBD_Object::accumulatePointVelocity ( UT_Vector3Array pos,
UT_Vector3Array vel 
) const

Accumulates into the given arrays all of our point's positions and velocities. Both are given in world space.

void RBD_Object::addGlueSubObject ( RBD_Object obj  ) 

Marks that obj is glued to this.

void RBD_Object::applyImpacts ( const SIM_Impacts impacts,
const SIM_Time time,
const SIM_Time timestep 
)

Applies impulses from SIM_Impacts data.

void RBD_Object::applyImpulse ( const UT_Vector3 pos,
fpreal  impulse,
const UT_Vector3 normal 
)

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

void RBD_Object::buildConstraints ( const RBD_Solver solver,
const SIM_Time time,
const SIM_Time endtime 
)

Determines what hard constraints are present at this time step and updates its internal model to reflect theses. We need the end time to be able to acquire non-interpolated objects to handle live pin constraints.

void RBD_Object::buildImpulseModel ( UT_DMatrix3 k,
const UT_Vector3 f,
const UT_Vector3 p 
) const

Builds the impulse model matrix for the given world space coordinate. This matrix when multiplied by an impulse will give the change in velocity at that point caused by the impulse.

This takes hard constraints into consideration. Builds the impulse model matrix describing the velocity change at point p given a force at point f. This is Mfp-1 in my naming scheme.

void RBD_Object::buildImpulseModelForA ( UT_DMatrix3 k,
const UT_Vector3 f,
const UT_Vector3 p,
RBD_Object A 
) const

Builds the impulse model matrix describing motion of P on *this given an a force at f on *this. This is Mzfp-1(A) in my naming scheme, where this is Z.

void RBD_Object::cachePhysicalValues (  ) 

void RBD_Object::clearCollideCache (  ) 

void RBD_Object::findOverlapIdx ( const RBD_Solver solver,
UT_IntArray overlap 
) [inline]

Definition at line 223 of file RBD_Object.h.

void RBD_Object::gatherBuilderRequests ( UT_RefArray< GU_SDFDelayedBuilder > &  buildrequests  ) 

Gathers all of our builder requests.

RBD_Object* RBD_Object::getAffector ( int  j  )  const [inline]

Definition at line 239 of file RBD_Object.h.

int RBD_Object::getArrayIndex (  )  const [inline]

Definition at line 250 of file RBD_Object.h.

void RBD_Object::getBBox ( UT_BoundingBox bbox  )  const

This returns the bounding box of the object inside it's own frame. This must be transformed by the orientation to get the world bounding box.

UT_PtrArray<SIM_ColliderCacheData *>& RBD_Object::getCollideCache (  )  [inline]

Definition at line 258 of file RBD_Object.h.

const SIM_Collider* RBD_Object::getCollider ( int  j  )  const [inline]

Definition at line 241 of file RBD_Object.h.

const SIM_Geometry* RBD_Object::getGeometry (  )  const [inline]

Definition at line 67 of file RBD_Object.h.

RBD_Object* RBD_Object::getGlueParent (  )  const [inline]

Returns our parent object, null if not glued.

Definition at line 118 of file RBD_Object.h.

void RBD_Object::getGlueSubObjects ( RBD_ObjectArray objlist  )  const

This returns a list of all the objects that are frozen to us.

SIM_Collider::SIM_ImpactApplyType RBD_Object::getImpactApplyType ( int  j  )  const [inline]

Definition at line 244 of file RBD_Object.h.

SIM_Impacts* RBD_Object::getImpacts (  ) 

RBD_Object* RBD_Object::getNthGlueSubObject ( int  i  )  const

int RBD_Object::getNumAffectors (  )  const [inline]

Definition at line 235 of file RBD_Object.h.

int RBD_Object::getNumGlueSubObjects (  )  const

Discover the number of glued subobjects and retrieve a specific one

SIM_Object* RBD_Object::getObject (  )  const [inline]

These cache the common RBD structures so we don't have to look them up every time we fetch them.

Definition at line 63 of file RBD_Object.h.

fpreal RBD_Object::getPropertyAtPosition ( const SIM_Property property,
const UT_Vector3 pos 
) const

Calculates the property value at the given world position.

fpreal RBD_Object::getRadius (  )  const [inline]

This is the radius of this object from the pivot position. It is thus orientation independent.

Definition at line 73 of file RBD_Object.h.

const SIM_SDF* RBD_Object::getSDF (  )  const [inline]

Definition at line 66 of file RBD_Object.h.

const RBD_SphereTree* RBD_Object::getSphereTree (  )  const

void RBD_Object::getStashedTransform ( UT_DMatrix4 xform  )  const

Gets the transform matrix from self to world from stashed state.

RBD_State* RBD_Object::getState (  )  const [inline]

Definition at line 64 of file RBD_Object.h.

bool RBD_Object::hasAsGlueChild ( RBD_Object obj  ) 

Returns true if the given object is one of our glue children.

bool RBD_Object::hasGlueSubObjects (  )  const

This returns true if we have any frozen sub objects.

bool RBD_Object::hasNailConstraints (  )  const [inline]

Definition at line 255 of file RBD_Object.h.

void RBD_Object::initBBox ( bool  useSDF  ) 

Calculates the bounding box.

void RBD_Object::initForCollisions (  ) 

Initialize for collisions.

void RBD_Object::initFromGeometry (  ) 

Updates the state from geometry, unless already calculated.

void RBD_Object::initRadius (  ) 

Calculates the radius, unless already calculated.

void RBD_Object::initSDF (  ) 

Builds the SDF and updates the state from the sdf, unless sdf is already built.

void RBD_Object::integratePosition ( const SIM_Time time,
const SIM_Time timestep 
)

Integrate position. Uses current velocity.

void RBD_Object::integrateVelocity ( const SIM_Time time,
const SIM_Time timestep 
)

Integrate velocity. Finds & applies all forces.

bool RBD_Object::isGlued (  )  const [inline]

Return if this object is glued to somewhere else.

Definition at line 133 of file RBD_Object.h.

bool RBD_Object::isInfiniteExtent (  )  const

Returns true if this object can intersect anywhere in space Used for things like implicit planes.

void RBD_Object::preserveImpacts ( SIM_Engine engine  ) 

Copies our NewImpact data into Impacts. This is a pass through to SIM_Object, but ensures our cached impact structure is cleared.

void RBD_Object::rebuildAffectorList ( const RBD_Solver solver,
SIM_Engine engine,
const SIM_Time time,
const SIM_Time timestep,
RBD_SharedAffectorListArray affectorlists,
UT_HashTable affectorhash 
)

Rebuilds the list of affectors for this object. Interpolates the affectors for the given time.

void RBD_Object::reloadImpacts ( SIM_Collider::SIM_ImpactApplyType  impactaplytype  ) 

Reloads our impact data structure from the SIM_Object. This must be done whenever preserveImpacts is called.

void RBD_Object::removeConstraints (  ) 

Removes the constraints added. This restores stuff like the pivot to its original value.

void RBD_Object::removeGlueSubObject ( RBD_Object obj  ) 

Removes that object as being glued to this.

void RBD_Object::restorePhysicalValues (  ) 

void RBD_Object::restoreState (  ) 

Restores the full state.

void RBD_Object::restoreStatePos (  ) 

Restores the position of the state using changePosition.

void RBD_Object::restoreStateVel (  ) 

Restores the velocity of the state using changeVelocity.

void RBD_Object::setAffectorTreeDirty (  )  [inline]

Definition at line 231 of file RBD_Object.h.

void RBD_Object::setArrayIndex ( int  index  )  [inline]

Definition at line 252 of file RBD_Object.h.

void RBD_Object::stashState (  ) 

Stashes the current state internally.


Member Data Documentation

Definition at line 272 of file RBD_Object.h.

Definition at line 271 of file RBD_Object.h.

Definition at line 266 of file RBD_Object.h.

Definition at line 265 of file RBD_Object.h.


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

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