AGX Dynamics  2.37.2.0
agxCollide::GeometryCollider Class Reference

The geometry collider is responsible for finding contacts between two geometries. More...

#include <GeometryCollider.h>

Static Public Member Functions

static void calculateContacts (Geometry *geom1, Geometry *geom2, LocalGeometryContact &result, const bool useContactAreaApproach=false, const agx::Bool &contactReductionEnable=false, const agx::UInt &contactReductionThreshold=12, const agx::UInt &contactReductionBinResolution=3)
 Calculates two geometries against each other. More...
 
static LocalGeometryContact calculateContacts (Geometry *geom1, Geometry *geom2, const bool useContactAreaApproach=false, const agx::Bool &contactReductionEnable=false, const agx::UInt &contactReductionThreshold=12, const agx::UInt &contactReductionBinResolution=3)
 Calculates two geometries against each other. More...
 

Detailed Description

The geometry collider is responsible for finding contacts between two geometries.

Each geometry may be composed of multiple shapes, so the geometry collider tests the individual shape bounds against each other and use shape colliders to test overlapping primitives.

This class is not used in the standard pipeline anymore, but can be used for manual collision detection.

Definition at line 40 of file GeometryCollider.h.

Member Function Documentation

◆ calculateContacts() [1/2]

static void agxCollide::GeometryCollider::calculateContacts ( Geometry *  geom1,
Geometry *  geom2,
LocalGeometryContact &  result,
const bool  useContactAreaApproach = false,
const agx::Bool &  contactReductionEnable = false,
const agx::UInt &  contactReductionThreshold = 12,
const agx::UInt &  contactReductionBinResolution = 3 
)
static

Calculates two geometries against each other.

Note that contact normals will point from the second to the first geometry. Contact reduction and explicit contact area computation are only done if enabled in the parameters. If the GeometryCollider is used to replicate the behavior of the default collision detection pipeline, it might be advisable to check if these parameters are available in the contact material for the two geometries. The material, hasInnerMaterial and solveImpact-properties of the LocalGeometryContact are not modified.

Parameters
geom1The first geometry
geom2The second geometry
resultThe resulting contact. Will be cleared before computation.
useContactAreaApproachIf true, will try to calculate the contact area and distribute it evenly over the points. If false, will distribute unit area over the contact points.
contactReductionEnableShould contacts be reduced?
contactReductionThresholdAt which number of contact points should we start reducing?
contactReductionBinResolutionThe bin resolution for contact reduction (check agxCollide::ContactReducer for details).

◆ calculateContacts() [2/2]

static LocalGeometryContact agxCollide::GeometryCollider::calculateContacts ( Geometry *  geom1,
Geometry *  geom2,
const bool  useContactAreaApproach = false,
const agx::Bool &  contactReductionEnable = false,
const agx::UInt &  contactReductionThreshold = 12,
const agx::UInt &  contactReductionBinResolution = 3 
)
static

Calculates two geometries against each other.

Note that contact normals will point from the second to the first geometry. Contact reduction and explicit contact area computation are only done if enabled in the parameters. If the GeometryCollider is used to replicate the behavior of the default collision detection pipeline, it might be advisable to check if these parameters are available in the contact material for the two geometries. The material, hasInnerMaterial and solveImpact-properties of the LocalGeometryContact are not modified.

Parameters
geom1The first geometry
geom2The second geometry
Return values
resultThe resulting contact.
Parameters
useContactAreaApproachIf true, will try to calculate the contact area and distribute it evenly over the points. If false, will distribute unit area over the contact points.
contactReductionEnableShould contacts be reduced?
contactReductionThresholdAt which number of contact points should we start reducing?
contactReductionBinResolutionThe bin resolution for contact reduction (check agxCollide::ContactReducer for details).

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