HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ColliderBFA Class Referenceabstract

A single potential-collision event involving a pair of primitives. More...

#include <SIM_ColliderBFA.h>

+ Inheritance diagram for SIM_ColliderBFA:

Public Member Functions

void getCollisionsDeformable (SIM_IsectArray &collisions, SIM_Object &object, SIM_Object &affector, fpreal tolerance, const SIM_Time &startTime, const SIM_Time &endTime, bool doRepulsion) const
 
void getCollisionsRigid (SIM_IsectArray &collisions, SIM_Object &object, SIM_Object &affector, fpreal tolerance, const SIM_Time &startTime, const SIM_Time &endTime, const UT_DMatrix4 &startXformA, const UT_DMatrix4 &startXformB, const UT_DMatrix4 &endXformA, const UT_DMatrix4 &endXformB) const
 
 simDetail (int objectId, const GU_Detail &gdp, const SIM_TriangulatedGeometry *tgeo, const UT_DMatrix4 &startXform, const UT_DMatrix4 &endXform, const SIM_Time &startTime, const SIM_Time &endTime)
 
int getObjectId () const
 
const GU_DetailgetGdp () const
 
bool operator== (const simDetail &rhs) const
 
const SIM_TimegetStartTime () const
 
const SIM_TimegetEndTime () const
 
const SIM_Time getTimestep () const
 
int getTriPointId (int fid, int vid) const
 Get point id of vertex on a given face. Optimized for triangles. More...
 
int getPrimPointId (int fid, int vid) const
 Unoptimized version of getTriPointId for arbitrary primitives. More...
 
bool hasTriEdgeIds () const
 
int getTriEdgeId (int fid, int vid) const
 
int getFusePointId (int pid) const
 
bool hasFusePointIds () const
 
UT_Vector3 getDetailPointPos (int pid) const
 
const UT_Vector3getPointVel (int pid) const
 
float getPointMass (int pid) const
 
const UT_Vector3getPointStartPos (int pid) const
 
const UT_Vector3getPointEndPos (int pid) const
 
UT_Vector3 getPointPos (int pid, const SIM_Time &time) const
 
UT_Vector3 getTriBaryPos (int primId, const UT_Vector3 &baryV3, const SIM_Time &time) const
 
UT_Vector3 getTriBaryVel (int primId, const UT_Vector3 &baryV3) const
 
fpreal getTriBaryMass (int primId, const UT_Vector3 &baryV3) const
 
UT_Vector3 getTriEdgePos (int primId, int eid, fpreal bary, const SIM_Time &time) const
 Get a position of a point somewhere on the edge of a triangle. More...
 
UT_Vector3 getPrimEdgePos (int primId, int eid, fpreal bary, const SIM_Time &time) const
 Optimized variant of getTriEdgePos for non-triangular primitives. More...
 
UT_Vector3 getTriStartBaryCenter (int primId) const
 
bool setPointChecked (int primIdA, const simDetail &sdpB, int pidB)
 
bool setEdgeChecked (int eidA, const simDetail &sdpB, int eidB)
 
 simPrimPairEvent (int primId0, int primId1, int edgeId0, int edgeId1, fpreal radius0, fpreal radius1, int &adjacent)
 
- Public Member Functions inherited from SIM_Collider
 GETSET_DATA_FUNCS_B (SIM_NAME_REVERSEOBJECTROLES, ReverseObjectRoles)
 
bool collideObjects (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags) const
 
bool collideObjects (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags, UT_ValArray< SIM_ColliderCacheData * > &objcachedata, UT_ValArray< SIM_ColliderCacheData * > &affectorcachedata) const
 
- Public Member Functions inherited from SIM_Data
const UT_StringHoldergetDataType () 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 compressionType) const
 
bool saveToStream (std::ostream &os, UT_CompressionType compressionType) 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 voidgetConstPointerToType (const UT_StringRef &datatype) const
 
voidgetPointerToType (const UT_StringRef &datatype)
 
int getNumSubData () const
 Get the number of sub-data items attached to this data. More...
 
const UT_StringHoldergetSubDataName (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_QuerygetQueryObject () const
 
SIM_OptionsgetUserOptions ()
 
const SIM_OptionsgetConstUserOptions () 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 > &detailArray, UT_Array< UT_DMatrix4 > &xformArray) 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_DatagetSubData (int index)
 
const SIM_DatagetConstSubData (int index) const
 
SIM_DatagetNamedSubData (const char *dataname)
 
const SIM_DatagetConstNamedSubData (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 &recurseFilter) const
 
SIM_DatagetNthSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurseFilter)
 
const SIM_DatagetNthConstSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurseFilter) const
 
void forEachSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurseFilter)
 
void forEachConstSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurseFilter) const
 
SIM_DatacreateNamedSubData (const char *dataname, const char *datatype, int creationflags, UT_String *newdatanameptr=NULL)
 
SIM_DatagetOrCreateAlternateRepresentation (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_GuidgetUniqueId () const
 
long getReferenceCount () const
 
int getCreatorId () const
 Get the ID of the node that created this data. More...
 
OP_NodegetCreatorNode () const
 Use the creator ID to look up the OP_Node that created this data. More...
 
OP_NodegetOwnerNetwork () const
 Look up the owner node of our engine to get the DOP Network pointer. More...
 
const SIM_EnginegetEngine () 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_TimegetCreationTime () 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_NodegetNodePathsRelativeTo () const
 
OP_NodegetOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
OBJ_NodegetOBJNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
SOP_NodegetSOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a SOP_Node. More...
 
DOP_NodegetDOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a DOP_Node. More...
 
COP2_NodegetCOP2Node (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a COP2_Node. More...
 
CHOP_NodegetCHOPNode (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_OptionsgetOptions () const
 

Public Attributes

int myPrimId [2]
 
int myEdgeId [2]
 
fpreal myRadii [2]
 
intmyAdjacent
 
UT_Array< simEdgeEdgeEventmyEdgeEdgeEvents
 
UT_Array< simFaceVertexEventmyFaceVertexEvents
 
UT_Array< SIM_IsectmyTriTriEvents
 

Protected Member Functions

 SIM_ColliderBFA (const SIM_DataFactory *factory)
 
 ~SIM_ColliderBFA () override
 
virtual SIM_BVTree::simBVTreeType getBVTreeType () const
 
virtual BV_LeafIteratorcreateLeafIt (const SIM_Object &object, const SIM_Time &timestep, bool startPosOnly) const =0
 
virtual void convertLeafToPrim (const BV_LeafIterator &leafIt, int leafId, int &outPrimId, int &outEdgeId) const =0
 
virtual fpreal getLeafRadius (const BV_LeafIterator &leafIt, int leafId) const =0
 
virtual bool getEventsAtSurface () const
 
void retrieveGeometry (const SIM_Object &object, GU_ConstDetailHandle &outGdh, const GU_Detail *&outGdp, UT_DMatrix4 *outEndTransform, const SIM_TriangulatedGeometry **tgeo) const
 
bool testFaceSharesPoint (const simDetail &sdpF, int pidF0, int pidF1, int pidF2, const simDetail &sdpV, int pidV) const
 
bool testEdgesSharePoint (const simDetail &sdpA, int pidA0, int pidA1, const simDetail &sdpB, int pidB0, int pidB1) const
 
virtual bool doCheckTangle () const
 
virtual void intersectPrims (simPrimPairEvent &event, simDetail &sdpA, simDetail &sdpB, fpreal tolerance, bool doRepulsion, bool selfCollision) const
 
- Protected Member Functions inherited from SIM_Collider
 SIM_Collider (const SIM_DataFactory *factory)
 The SIM_Collider constructor. More...
 
 ~SIM_Collider () override
 The SIM_Collider destructor. More...
 
SIM_ImpactsgetObjectImpactData (SIM_Object &object, SIM_ImpactApplyType impactapplytype) const
 
SIM_ImpactsgetAffectorImpactData (SIM_Object &affector, SIM_ImpactApplyType impactapplytype) const
 
bool getAffectorInterpolatedToEndTime () const
 
virtual bool collideObjectsSubclass (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags) const
 
virtual bool collideObjectsCachedSubclass (SIM_Engine &engine, SIM_Object &object, SIM_Object &affector, const SIM_Time &starttime, const SIM_Time &endtime, SIM_ImpactApplyType impactapplytype, int impactflags, UT_ValArray< SIM_ColliderCacheData * > &objcachedata, UT_ValArray< SIM_ColliderCacheData * > &affectorcachedata) const
 
virtual bool getAffectorInterpolatedToEndTimeSubclass () const
 
- 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_QuerycreateQueryObjectSubclass () const
 
virtual long getGuideParmVersionSubclass () const
 
virtual SIM_GuidecreateGuideObjectSubclass () 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 void interpolateSubclass (const SIM_Data *source1, const SIM_Data *source2, fpreal interp)
 
virtual int64 getMemorySizeSubclass () const
 
virtual void handleModificationSubclass (int code)
 
virtual bool getIsAlternateRepresentationSubclass () const
 
virtual void initAlternateRepresentationSubclass (const SIM_Data &)
 
virtual voidgetCastToType (const UT_StringRef &datatype) const
 
virtual const UT_StringHoldergetDataTypeSubclass () const
 
const SIM_DatagetAlternateRepresentationOf () const
 
- Protected Member Functions inherited from SIM_OptionsUser
SIM_OptionsgetOptions ()
 
virtual void optionChangedSubclass (const char *name)
 

Protected Attributes

GA_ROHandleF myAttMass
 

Friends

class simBVCallback
 

Additional Inherited Members

- Public Types inherited from SIM_Collider
enum  SIM_ImpactApplyType { SIM_IMPACTAPPLY_NONE, SIM_IMPACTAPPLY_ONEWAY, SIM_IMPACTAPPLY_MUTUAL, SIM_IMPACTAPPLY_FEEDBACK }
 Defines the possible affector types when doing collision detection. More...
 
- 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 voidcastConstPointerToType (const SIM_Data *data, const UT_StringRef &datatype)
 
static voidcastPointerToType (SIM_Data *data, const UT_StringRef &datatype)
 
- Static Protected Member Functions inherited from SIM_Data
static const PRM_TemplategetEmptyTemplateList ()
 
static const SIM_DopDescriptiongetEmptyDopDescription ()
 A DOP description that says not to create an automatic DOP. More...
 
static void getDataTypeSuperclasses (UT_StringArray &)
 

Detailed Description

A single potential-collision event involving a pair of primitives.

This class implements a cloth-cloth collider based on Bridson's 2002 paper (BriFedAnd02). We use it for several types of deformable collisions: cloth-cloth, cloth-hair and hair-hair. We also use it for thin plate rigid body collisions. This class can only be used for collision detection. The cloth subclass does the Bridson/Fedkiw/Anderson collision response.

For deformable objects, the input objects should be updated to the end-of-step positions and velocities. This collider will proposes changes to that end-of-step velocity which can then be used to obtain a new end-of-step position. The start-of-step position is calculated by assuming that explicit integration was used - i.e., by computing x - dt*v.

This class does both self-collision and object/object collision. It supports "point fusing," where two points in the same object (or one point in each of the two objects) are fused together into a single virtual point. (Typically, the user sets that up using a hard DOPs constraint.) For collision purposes, those points are treated as a single point - so, if two edges collide, but they share a virtual point as an endpoint, the collision will be ignored.

Definition at line 142 of file SIM_ColliderBFA.h.

Constructor & Destructor Documentation

SIM_ColliderBFA::SIM_ColliderBFA ( const SIM_DataFactory factory)
explicitprotected
SIM_ColliderBFA::~SIM_ColliderBFA ( )
overrideprotected

Member Function Documentation

virtual void SIM_ColliderBFA::convertLeafToPrim ( const BV_LeafIterator leafIt,
int  leafId,
int outPrimId,
int outEdgeId 
) const
protectedpure virtual

Given a leaf iterator and the id of a leaf, convert the leaf id to a primitive id and (optionally) an edge id.

Implemented in RBD_ColliderBFA.

virtual BV_LeafIterator* SIM_ColliderBFA::createLeafIt ( const SIM_Object object,
const SIM_Time timestep,
bool  startPosOnly 
) const
protectedpure virtual

This method should create a BV_LeafIterator class. This class will iterate over the individual geometric entities to be used for OBB intersection - in most cases, each leaf will contain a single primitive from the geometry. The time used to retrieve the geometry is determined by the startPosOnly flag: true: return the position at the start of the timestep - i.e., position at object - vel*timestep false: return the positions at both the start and end of the timestep. The leaf iterator should return points in simulation (world) space, not local object space.

Implemented in RBD_ColliderBFA.

virtual bool SIM_ColliderBFA::doCheckTangle ( ) const
inlineprotectedvirtual

returns true iff tangling triangles should not be processed for collision detection The RBD collision detection uses this to allow objects that are tangled at the start of the timestep to untangle without the attempt to disentangle triggering a collision.

Reimplemented in RBD_ColliderBFA.

Definition at line 262 of file SIM_ColliderBFA.h.

virtual SIM_BVTree::simBVTreeType SIM_ColliderBFA::getBVTreeType ( ) const
protectedvirtual
void SIM_ColliderBFA::getCollisionsDeformable ( SIM_IsectArray collisions,
SIM_Object object,
SIM_Object affector,
fpreal  tolerance,
const SIM_Time startTime,
const SIM_Time endTime,
bool  doRepulsion 
) const
inline

Collision detection for deformable bodies. These bodies: 1) define velocity via a point attribute 2) need their bounding volume trees updated every step.

Definition at line 151 of file SIM_ColliderBFA.h.

void SIM_ColliderBFA::getCollisionsRigid ( SIM_IsectArray collisions,
SIM_Object object,
SIM_Object affector,
fpreal  tolerance,
const SIM_Time startTime,
const SIM_Time endTime,
const UT_DMatrix4 startXformA,
const UT_DMatrix4 startXformB,
const UT_DMatrix4 endXformA,
const UT_DMatrix4 endXformB 
) const
inline

Collision detection for rigid bodies. These bodies: 1) define velocity via start/end transforms 2) never need to update their bounding volume trees. 3) need proxy triangulated geometry, since the source geometry may not be triangles.

Definition at line 170 of file SIM_ColliderBFA.h.

UT_Vector3 SIM_ColliderBFA::getDetailPointPos ( int  pid) const
const SIM_Time& SIM_ColliderBFA::getEndTime ( ) const
inline

Definition at line 362 of file SIM_ColliderBFA.h.

virtual bool SIM_ColliderBFA::getEventsAtSurface ( ) const
protectedvirtual

Test if this class generates events located at the centre of the triangles/edges or at the surface. This choice usually depends on the model of collision response.

int SIM_ColliderBFA::getFusePointId ( int  pid) const
inline

Retrieve the "simulation" point id (or "equation number") associated with the given point. This allows for testing if points from two different gdps are "fused" into a single point within the simulation. It is stored as an attribute on the GU_Detail. Collisions between fused points are ignored. If the attribute is absent, fusing is disabled.

Definition at line 393 of file SIM_ColliderBFA.h.

const GU_Detail& SIM_ColliderBFA::getGdp ( ) const
inline

Definition at line 355 of file SIM_ColliderBFA.h.

virtual fpreal SIM_ColliderBFA::getLeafRadius ( const BV_LeafIterator leafIt,
int  leafId 
) const
protectedpure virtual

This method returns a radius to expand the leaf's geometry for collision detection. For example, if the leaf's geometry is a line segment, the expanded geometry used for collision detection will be a cylinder with hemisphere caps.

Implemented in RBD_ColliderBFA.

int SIM_ColliderBFA::getObjectId ( ) const
inline

Definition at line 353 of file SIM_ColliderBFA.h.

const UT_Vector3& SIM_ColliderBFA::getPointEndPos ( int  pid) const
inline

Definition at line 409 of file SIM_ColliderBFA.h.

float SIM_ColliderBFA::getPointMass ( int  pid) const
UT_Vector3 SIM_ColliderBFA::getPointPos ( int  pid,
const SIM_Time time 
) const
const UT_Vector3& SIM_ColliderBFA::getPointStartPos ( int  pid) const
inline

Definition at line 407 of file SIM_ColliderBFA.h.

const UT_Vector3& SIM_ColliderBFA::getPointVel ( int  pid) const
inline

Definition at line 404 of file SIM_ColliderBFA.h.

UT_Vector3 SIM_ColliderBFA::getPrimEdgePos ( int  primId,
int  eid,
fpreal  bary,
const SIM_Time time 
) const

Optimized variant of getTriEdgePos for non-triangular primitives.

int SIM_ColliderBFA::getPrimPointId ( int  fid,
int  vid 
) const

Unoptimized version of getTriPointId for arbitrary primitives.

const SIM_Time& SIM_ColliderBFA::getStartTime ( ) const
inline

Definition at line 360 of file SIM_ColliderBFA.h.

const SIM_Time SIM_ColliderBFA::getTimestep ( ) const
inline

Definition at line 365 of file SIM_ColliderBFA.h.

fpreal SIM_ColliderBFA::getTriBaryMass ( int  primId,
const UT_Vector3 baryV3 
) const
UT_Vector3 SIM_ColliderBFA::getTriBaryPos ( int  primId,
const UT_Vector3 baryV3,
const SIM_Time time 
) const
UT_Vector3 SIM_ColliderBFA::getTriBaryVel ( int  primId,
const UT_Vector3 baryV3 
) const
int SIM_ColliderBFA::getTriEdgeId ( int  fid,
int  vid 
) const
inline

Definition at line 381 of file SIM_ColliderBFA.h.

UT_Vector3 SIM_ColliderBFA::getTriEdgePos ( int  primId,
int  eid,
fpreal  bary,
const SIM_Time time 
) const

Get a position of a point somewhere on the edge of a triangle.

int SIM_ColliderBFA::getTriPointId ( int  fid,
int  vid 
) const
inline

Get point id of vertex on a given face. Optimized for triangles.

Definition at line 369 of file SIM_ColliderBFA.h.

UT_Vector3 SIM_ColliderBFA::getTriStartBaryCenter ( int  primId) const
bool SIM_ColliderBFA::hasFusePointIds ( ) const
inline

Definition at line 397 of file SIM_ColliderBFA.h.

bool SIM_ColliderBFA::hasTriEdgeIds ( ) const
inline

Definition at line 377 of file SIM_ColliderBFA.h.

virtual void SIM_ColliderBFA::intersectPrims ( simPrimPairEvent event,
simDetail sdpA,
simDetail sdpB,
fpreal  tolerance,
bool  doRepulsion,
bool  selfCollision 
) const
protectedvirtual
bool SIM_ColliderBFA::operator== ( const simDetail rhs) const
inline

Definition at line 357 of file SIM_ColliderBFA.h.

void SIM_ColliderBFA::retrieveGeometry ( const SIM_Object object,
GU_ConstDetailHandle outGdh,
const GU_Detail *&  outGdp,
UT_DMatrix4 outEndTransform,
const SIM_TriangulatedGeometry **  tgeo 
) const
protected
bool SIM_ColliderBFA::setEdgeChecked ( int  eidA,
const simDetail sdpB,
int  eidB 
)

Flag that edge (pidA0,pidA1) of this detail has been tested against edge (pidB0,pidB1) of sdpB. Returns true if it had already been tested before.

bool SIM_ColliderBFA::setPointChecked ( int  primIdA,
const simDetail sdpB,
int  pidB 
)

Flag that point pidB of sdpB has been tested against primIdA from this simDetail. Returns true if it had already been tested before.

SIM_ColliderBFA::simDetail ( int  objectId,
const GU_Detail gdp,
const SIM_TriangulatedGeometry tgeo,
const UT_DMatrix4 startXform,
const UT_DMatrix4 endXform,
const SIM_Time startTime,
const SIM_Time endTime 
)

The difference between rigid/deformable is the presence/absence of tgeo data.

SIM_ColliderBFA::simPrimPairEvent ( int  primId0,
int  primId1,
int  edgeId0,
int  edgeId1,
fpreal  radius0,
fpreal  radius1,
int adjacent 
)
bool SIM_ColliderBFA::testEdgesSharePoint ( const simDetail sdpA,
int  pidA0,
int  pidA1,
const simDetail sdpB,
int  pidB0,
int  pidB1 
) const
protected

Return true if the two edges (defined by their endpoint ids) share an endpoint. If the "fuse mapping" point attribute is present on both GU_Details, it is used to determine if two points are fused; If absent, sharing is only possible if the face and point belong to the same GU_Detail - i.e., self-collision.

bool SIM_ColliderBFA::testFaceSharesPoint ( const simDetail sdpF,
int  pidF0,
int  pidF1,
int  pidF2,
const simDetail sdpV,
int  pidV 
) const
protected

Return true if a face and point share a point. If the "fuse mapping" point attribute is present on both GU_Details, it is used to determine if two points are fused; If absent, sharing is only possible if the face and point belong to the same GU_Detail - i.e., self-collision.

Friends And Related Function Documentation

friend class simBVCallback
friend

Definition at line 337 of file SIM_ColliderBFA.h.

Member Data Documentation

int& SIM_ColliderBFA::myAdjacent

A flag to indicate that the two primitives are adjacent (i.e., share one or more vertices)

Definition at line 489 of file SIM_ColliderBFA.h.

GA_ROHandleF SIM_ColliderBFA::myAttMass
protected

If mass attribute is missing (e.g., solid object), infinity is assumed. TODO: change this?

Definition at line 439 of file SIM_ColliderBFA.h.

UT_Array<simEdgeEdgeEvent> SIM_ColliderBFA::myEdgeEdgeEvents

Definition at line 490 of file SIM_ColliderBFA.h.

int SIM_ColliderBFA::myEdgeId[2]

Definition at line 485 of file SIM_ColliderBFA.h.

UT_Array<simFaceVertexEvent> SIM_ColliderBFA::myFaceVertexEvents

Definition at line 491 of file SIM_ColliderBFA.h.

int SIM_ColliderBFA::myPrimId[2]

Definition at line 484 of file SIM_ColliderBFA.h.

fpreal SIM_ColliderBFA::myRadii[2]

Definition at line 486 of file SIM_ColliderBFA.h.

UT_Array<SIM_Isect> SIM_ColliderBFA::myTriTriEvents

Definition at line 492 of file SIM_ColliderBFA.h.


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