8 #ifndef __SIM_ColliderBFA_h__
9 #define __SIM_ColliderBFA_h__
66 bool firstIsFace,
int vid,
146 class simPrimPairEvent;
157 bool doRepulsion)
const
159 getCollisions(collisions,
object, affector,
160 tolerance, startTime, endTime,
162 NULL, NULL, NULL, NULL);
181 getCollisions(collisions,
object, affector,
182 tolerance, startTime, endTime,
184 &startXformA, &startXformB,
185 &endXformA, &endXformB);
193 getBVTreeType()
const;
210 bool startPosOnly)
const = 0;
214 virtual void convertLeafToPrim(
217 int &outPrimId,
int &outEdgeId)
const = 0;
223 virtual fpreal getLeafRadius(
225 int leafId)
const = 0;
230 virtual bool getEventsAtSurface()
const;
232 void retrieveGeometry(
const SIM_Object &
object,
243 bool testFaceSharesPoint(
const simDetail &sdpF,
244 int pidF0,
int pidF1,
int pidF2,
245 const simDetail &sdpV,
253 bool testEdgesSharePoint(
const simDetail &sdpA,
254 int pidA0,
int pidA1,
255 const simDetail&sdpB,
256 int pidB0,
int pidB1)
const;
265 virtual void intersectPrims(simPrimPairEvent &
event,
266 simDetail &sdpA, simDetail &sdpB,
267 fpreal tolerance,
bool doRepulsion,
268 bool selfCollision)
const;
294 int intersectFaceVertex(simPrimPairEvent &
event,
295 simDetail &sdp0, simDetail &sdp1,
296 bool firstIsFace,
int vid,
297 bool searchInTimestep,
307 int intersectEdgeEdge(simPrimPairEvent &
event,
308 int eid0, simDetail &sdp0,
309 int eid1, simDetail &sdp1,
310 bool searchInTimestep,
317 bool intersectTriTri(simPrimPairEvent &
event,
318 const simDetail &sdp0,
319 const simDetail &sdp1,
320 bool &searchInTimestep,
332 bool isDeformable)
const;
337 friend class simBVCallback;
345 simDetail(
int objectId,
354 {
return myObjectId; }
358 {
return &myGdp == &rhs.myGdp; }
361 {
return myStartTime; }
363 {
return myEndTime; }
366 {
return myEndTime - myStartTime; }
373 return myTriPointIds(fid*3 + vid);
376 int getPrimPointId(
int fid,
int vid)
const;
379 return myTriEdgeIds.entries() > 0;
385 return myTriEdgeIds(fid*3 + vid);
395 return myFusePointIds(pid);
399 return myFusePointIds.entries() > 0;
405 {
return myVel(pid); }
406 float getPointMass(
int pid)
const;
408 {
return myStartPos(pid); }
410 {
return myEndPos(pid); }
417 fpreal getTriBaryMass(
int primId,
425 UT_Vector3 getTriStartBaryCenter(
int primId)
const;
429 bool setPointChecked(
int primIdA,
const simDetail &sdpB,
434 bool setEdgeChecked(
int eidA,
const simDetail &sdpB,
int eidB);
479 simPrimPairEvent(
int primId0,
int primId1,
480 int edgeId0,
int edgeId1,
UT_Array< simEdgeEdgeEvent > myEdgeEdgeEvents
#define DECLARE_STANDARD_GETCASTTOTYPE()
#define DECLARE_CLASSNAME(DataClass, SuperClass)
bool hasTriEdgeIds() const
GT_API const UT_StringHolder time
simEdgeEdgeEvent(const SIM_Time &time, const UT_Vector3 &normal, fpreal distance, int eid0, int eid1, fpreal bary0, fpreal bary1)
A single potential-collision event involving a pair of primitives.
UT_Vector3T< float > UT_Vector3
void getCollisionsDeformable(SIM_IsectArray &collisions, SIM_Object &object, SIM_Object &affector, fpreal tolerance, const SIM_Time &startTime, const SIM_Time &endTime, bool doRepulsion) const
const UT_Vector3 & getPointStartPos(int pid) const
const GU_Detail & getGdp() const
const UT_Vector3 & getPointEndPos(int pid) const
const UT_Vector3 & getPointVel(int pid) const
int myEid[2]
id of edge within primitive. Vertices are eid and (eid+1)nvertices
int getTriPointId(int fid, int vid) const
Get point id of vertex on a given face. Optimized for triangles.
simFaceVertexEvent(const SIM_Time &time, const UT_Vector3 &normal, fpreal distance, bool firstIsFace, int vid, fpreal bary0, fpreal bary1)
const SIM_Time & getStartTime() const
virtual bool doCheckTangle() const
int getFusePointId(int pid) const
const SIM_Time getTimestep() const
bool hasFusePointIds() const
UT_Array< simFaceVertexEvent > myFaceVertexEvents
UT_Vector3 getBaryV3() const
Retrieve a barycentric vector for the face's primitive.
sim4PointEvent(const SIM_Time &time, const UT_Vector3 &normal, fpreal distance)
const SIM_Time & getEndTime() const
int getTriEdgeId(int fid, int vid) const
UT_Array< SIM_Isect > myTriTriEvents
fpreal myBary[2]
Barycentric position within the face.
bool operator==(const simDetail &rhs) const
SIM_API const UT_StringHolder distance
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