CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdGiCollisionDetector Class Reference

#include <GiIntersectionsCalculator.h>

Inheritance diagram for OdGiCollisionDetector:
OdGiIntersectionsCalculator OdGiExtentsSpaceTreeCallback< OdGeExtents3d, OdGiTriangleForIntersectTest >

Classes

struct  DetectedCollision
 

Public Member Functions

 OdGiCollisionDetector ()
 
virtual ~OdGiCollisionDetector ()
 
void detectCollisions (OdInt32 containerID, const OdGeExtents3d &extents)
 
void getCollisions (OdList< OdInt32 > &result)
 
bool getCollisionDistance (OdUInt32 collisionIndex, double &result) const
 
virtual void finalizeCalculations ()
 
void clearContainersToBeTested ()
 
void setIntersectionsOnly (bool b)
 
bool isIntersectionsOnly () const
 
void setClearance (double cl)
 
bool isClearance () const
 
double getClearance () const
 
void setCalcDistance (bool b)
 
bool getCalcDistance () const
 
void setCheckAll (bool b)
 
bool getCheckAll () const
 
- Public Member Functions inherited from OdGiIntersectionsCalculator
 OdGiIntersectionsCalculator ()
 
virtual ~OdGiIntersectionsCalculator ()
 
OdInt32 appendTriangleContainer (OdGiIntersectTrianglesVector *pContainer)
 
OdInt32 addTriangleToContainer (OdInt32 containerID, const OdGePoint3d *pTriangle)
 
OdInt32 addContainerToBeTested (OdInt32 containerID)
 
void computeIntersections (OdInt32 containerID, OdGeExtents3d &extents)
 
virtual void initializeCalculations (OdGeExtents3d &ext, OdInt32 nObjects)
 
void intermediatefinalizeCalculations ()
 
void processTrianglesIntoSpaceTree (OdUInt32 objID, bool bOtherObjectsProcessed)
 
void processPathCalculation (OdUInt32 idObjTested)
 
const OdGeToltolerance () const
 
void setTolerance (const OdGeTol &tol)
 
bool & facesActive ()
 
bool getSpaceTreeRootExtents (OdGeExtents3d &ext)
 
OdUInt32 triangleContainerSize () const
 
OdUInt32 containerToBeTestedSize () const
 
void removeEdgeInfo (OdInt32 objID)
 
OdList< OdGiExtents3dSpaceChainPolyline * > & finalIntersectionPathes ()
 
OdArray< OdGiExtents3dSpacePoint * > * intersectionVertices ()
 
OdArray< OdGiEdgeForIntersectTest * > * intersectionEdges ()
 

Protected Types

enum  CollisionOption { kOption_IntersectionOnly = 1 , kOption_Clearance = 2 , kOption_CalcDistance = 4 , kOption_CheckAll = 8 }
 

Protected Member Functions

virtual bool notifyObjectPlacedAtNode (OdGiTriangleForIntersectTest *pTriang, int objectType, OdGiExtents3dSpaceNode_Gi *pNode)
 
void computeIntersections (OdInt32 containerID, OdGeExtents3d &extents)
 
void processPathCalculation (OdUInt32 idObjTested)
 
void removeEdgeInfo (OdInt32 objID)
 
OdList< OdGiExtents3dSpaceChainPolyline * > & finalIntersectionPathes ()
 
OdArray< OdGiExtents3dSpacePoint * > * intersectionVertices ()
 
OdArray< OdGiEdgeForIntersectTest * > * intersectionEdges ()
 
bool collideTriangles (OdUInt32 idObjA, OdUInt32 trIdA, OdUInt32 idObjB, OdUInt32 trIdB, OdUInt32 idObjTested, const OdGeTol &tol)
 
OdUInt32 checkPointsPlacement (const OdGeVector3d *pPlaneNormalA, double D_A, const OdGePoint3d *pPointsTriangleB, const OdGeTol &tol)
 
- Protected Member Functions inherited from OdGiIntersectionsCalculator
void intersectTriangles (OdUInt32 idObjA, OdUInt32 trIdA, OdUInt32 idObjB, OdUInt32 trIdB, OdUInt32 idObjTested, const OdGeTol &tol)
 

Protected Attributes

OdVector< DetectedCollision, OdMemoryAllocator< DetectedCollision > > m_vectCollidedContainers
 
DetectedCollisionm_vectCollidedContainersAsPtr
 
OdGePoint3d m_ptA
 
OdGePoint3d m_ptB
 
OdUInt8 m_options
 
double m_dClearance
 
- Protected Attributes inherited from OdGiIntersectionsCalculator
OdGeTol m_tol
 
OdVector< bool, OdMemoryAllocator< bool > > m_vectTestedTriangles
 
OdUInt32Vector m_vectTestTriangles_objBoundary
 
OdUInt32Vector m_vectToBeTestedObjects
 
bool m_bSecondObjectProcessedInTree
 
OdVector< OdGiIntersectTrianglesVector * > m_containerTriangles
 
OdGiExtents3dSpaceTree_Gi m_spaceTriangTree
 
OdGiExtents3dSpaceTree m_spaceVertexTree
 
OdArray< OdGiExtents3dSpacePoint * > * m_intersectVertices
 
OdArray< OdGiEdgeForIntersectTest * > * m_intersectEdges
 
OdList< OdGiExtents3dSpaceChainPolyline * > m_finalIntersectPathes
 
bool m_b3dFacesActive
 

Detailed Description

This class is a detector for collision of triangular representations of entities.

<group OdGi_Classes>

See also
<link gs_collision_detection, Work with Collision Detection>

Definition at line 255 of file GiIntersectionsCalculator.h.

Member Enumeration Documentation

◆ CollisionOption

Enumerator
kOption_IntersectionOnly 
kOption_Clearance 
kOption_CalcDistance 
kOption_CheckAll 

Definition at line 397 of file GiIntersectionsCalculator.h.

Constructor & Destructor Documentation

◆ OdGiCollisionDetector()

OdGiCollisionDetector::OdGiCollisionDetector ( )

Default constructor for the OdGiCollisionDetector class.

◆ ~OdGiCollisionDetector()

virtual OdGiCollisionDetector::~OdGiCollisionDetector ( )
inlinevirtual

Destructor for the OdGiCollisionDetector class.

Definition at line 266 of file GiIntersectionsCalculator.h.

Member Function Documentation

◆ checkPointsPlacement()

OdUInt32 OdGiCollisionDetector::checkPointsPlacement ( const OdGeVector3d * pPlaneNormalA,
double D_A,
const OdGePoint3d * pPointsTriangleB,
const OdGeTol & tol )
protected

◆ clearContainersToBeTested()

void OdGiCollisionDetector::clearContainersToBeTested ( )

Clears all triangle containers that were marked for collision detection calculations.

◆ collideTriangles()

bool OdGiCollisionDetector::collideTriangles ( OdUInt32 idObjA,
OdUInt32 trIdA,
OdUInt32 idObjB,
OdUInt32 trIdB,
OdUInt32 idObjTested,
const OdGeTol & tol )
protected

◆ computeIntersections()

void OdGiCollisionDetector::computeIntersections ( OdInt32 containerID,
OdGeExtents3d & extents )
inlineprotected

Definition at line 273 of file GiIntersectionsCalculator.h.

◆ detectCollisions()

void OdGiCollisionDetector::detectCollisions ( OdInt32 containerID,
const OdGeExtents3d & extents )

Detects collisions between a specified triangle container and all triangle containers that are marked as "container to be tested".

Parameters
containerID[in] Triangle container.
extents[in] Not used.

◆ finalIntersectionPathes()

OdList< OdGiExtents3dSpaceChainPolyline * > & OdGiCollisionDetector::finalIntersectionPathes ( )
inlineprotected

Definition at line 276 of file GiIntersectionsCalculator.h.

◆ finalizeCalculations()

virtual void OdGiCollisionDetector::finalizeCalculations ( )
virtual

Finalizes calculations, i.e. resets the triangles tree, removes triangles info and releases all data related to collision detection.

Reimplemented from OdGiIntersectionsCalculator.

◆ getCalcDistance()

bool OdGiCollisionDetector::getCalcDistance ( ) const
inline

Checks whether collision detection calculates collision distance.

Returns
true if collision detection calculates collision distance, false otherwise.

Definition at line 360 of file GiIntersectionsCalculator.h.

◆ getCheckAll()

bool OdGiCollisionDetector::getCheckAll ( ) const
inline

Checks whether collision detection checks all faces instead of detecting the first collision.

Returns
true if collision detection checks all faces, false otherwise.

Definition at line 373 of file GiIntersectionsCalculator.h.

◆ getClearance()

double OdGiCollisionDetector::getClearance ( ) const
inline

Retrieves a distance for the clearance mode when objects that are "too close" are detected as intersections.

Definition at line 347 of file GiIntersectionsCalculator.h.

◆ getCollisionDistance()

bool OdGiCollisionDetector::getCollisionDistance ( OdUInt32 collisionIndex,
double & result ) const

Retrieves a collision distance at the specified index.

Parameters
collisionIndex[in] Index of a collision for which to get the distance.
result[out] Receives collision distance.
Returns
true if collision distance is sucessfully received. This method returns false if index exceeds the size of vector with collisions or if collision at the specified index is not detected.

◆ getCollisions()

void OdGiCollisionDetector::getCollisions ( OdList< OdInt32 > & result)

Gets a list of all detected collisions.

Parameters
result[out] Recieves results of collision detection.

◆ intersectionEdges()

OdArray< OdGiEdgeForIntersectTest * > * OdGiCollisionDetector::intersectionEdges ( )
inlineprotected

Definition at line 278 of file GiIntersectionsCalculator.h.

◆ intersectionVertices()

OdArray< OdGiExtents3dSpacePoint * > * OdGiCollisionDetector::intersectionVertices ( )
inlineprotected

Definition at line 277 of file GiIntersectionsCalculator.h.

◆ isClearance()

bool OdGiCollisionDetector::isClearance ( ) const
inline

Checks whether clearance mode for detecting collisions is enabled. This method detects collisions between intersectiong, touching and objects that are "too close".

Returns
true if clearance mode is enabled, false otherwise.

Definition at line 342 of file GiIntersectionsCalculator.h.

◆ isIntersectionsOnly()

bool OdGiCollisionDetector::isIntersectionsOnly ( ) const
inline

Checks whether only intersected objects are detected as collisions.

Returns
true if only intersected objects are detected as collisions, false otherwise.

Definition at line 325 of file GiIntersectionsCalculator.h.

◆ notifyObjectPlacedAtNode()

virtual bool OdGiCollisionDetector::notifyObjectPlacedAtNode ( OdGiTriangleForIntersectTest * pTriang,
int objectType,
OdGiExtents3dSpaceNode_Gi * pNode )
protectedvirtual

Reimplemented from OdGiIntersectionsCalculator.

◆ processPathCalculation()

void OdGiCollisionDetector::processPathCalculation ( OdUInt32 idObjTested)
inlineprotected

Definition at line 274 of file GiIntersectionsCalculator.h.

◆ removeEdgeInfo()

void OdGiCollisionDetector::removeEdgeInfo ( OdInt32 objID)
inlineprotected

Definition at line 275 of file GiIntersectionsCalculator.h.

◆ setCalcDistance()

void OdGiCollisionDetector::setCalcDistance ( bool b)
inline

Specifies whether collision detection should calculate collision distance.

Parameters
b[in] The flag that indicates that collision detection should calculate collision distance.

Definition at line 353 of file GiIntersectionsCalculator.h.

◆ setCheckAll()

void OdGiCollisionDetector::setCheckAll ( bool b)
inline

Specifies whether collision detection should check all faces instead of detecting the first collision.

Parameters
b[in] If true, collision detection checks all faces instead of detecting the first collision.

Definition at line 366 of file GiIntersectionsCalculator.h.

◆ setClearance()

void OdGiCollisionDetector::setClearance ( double cl)
inline

Specifies a distance for the clearance mode when objects that are "too close" are detected as intersections.

Parameters
cl[in] Clearance distance. Object which have less distance than this value are considered collided in the clearance mode.

Definition at line 331 of file GiIntersectionsCalculator.h.

◆ setIntersectionsOnly()

void OdGiCollisionDetector::setIntersectionsOnly ( bool b)
inline

Specifies whether to detect collisions only when collided objects intersect.

Parameters
b[in] Flag that specifies whether to detect only intersecting objects. If true, touches are not detected.

Definition at line 318 of file GiIntersectionsCalculator.h.

Member Data Documentation

◆ m_dClearance

double OdGiCollisionDetector::m_dClearance
protected

Definition at line 406 of file GiIntersectionsCalculator.h.

◆ m_options

OdUInt8 OdGiCollisionDetector::m_options
protected

Definition at line 404 of file GiIntersectionsCalculator.h.

◆ m_ptA

OdGePoint3d OdGiCollisionDetector::m_ptA
protected

Definition at line 389 of file GiIntersectionsCalculator.h.

◆ m_ptB

OdGePoint3d OdGiCollisionDetector::m_ptB
protected

Definition at line 390 of file GiIntersectionsCalculator.h.

◆ m_vectCollidedContainers

OdVector<DetectedCollision, OdMemoryAllocator<DetectedCollision> > OdGiCollisionDetector::m_vectCollidedContainers
protected

Definition at line 386 of file GiIntersectionsCalculator.h.

◆ m_vectCollidedContainersAsPtr

DetectedCollision* OdGiCollisionDetector::m_vectCollidedContainersAsPtr
protected

Definition at line 388 of file GiIntersectionsCalculator.h.


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