Custom geometry callbacks structure. User should inherit this and implement all pure virtual functions.
More...
#include <PxCustomGeometry.h>
|
| virtual Type | getCustomType () const =0 |
| | Return custom type. The type purpose is for user to differentiate custom geometries. Not used by PhysX.
|
| |
| virtual PxBounds3 | getLocalBounds (const PxGeometry &geometry) const =0 |
| | Return local bounds.
|
| |
| virtual bool | generateContacts (const PxGeometry &geom0, const PxGeometry &geom1, const PxTransform &pose0, const PxTransform &pose1, const PxReal contactDistance, const PxReal meshContactMargin, const PxReal toleranceLength, PxContactBuffer &contactBuffer) const =0 |
| | Contacts generation. Generate collision contacts between two geometries in given poses.
|
| |
| virtual PxU32 | raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxGeometry &geom, const PxTransform &pose, PxReal maxDist, PxHitFlags hitFlags, PxU32 maxHits, PxGeomRaycastHit *rayHits, PxU32 stride, PxRaycastThreadContext *threadContext) const =0 |
| | Raycast. Cast a ray against the geometry in given pose.
|
| |
| virtual bool | overlap (const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxOverlapThreadContext *threadContext) const =0 |
| | Overlap. Test if geometries overlap.
|
| |
| virtual bool | sweep (const PxVec3 &unitDir, const PxReal maxDist, const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxGeomSweepHit &sweepHit, PxHitFlags hitFlags, const PxReal inflation, PxSweepThreadContext *threadContext) const =0 |
| | Sweep. Sweep one geometry against the other.
|
| |
| virtual void | visualize (const PxGeometry &geometry, PxRenderOutput &out, const PxTransform &absPose, const PxBounds3 &cullbox) const =0 |
| | Visualize custom geometry for debugging. Optional.
|
| |
| virtual void | computeMassProperties (const PxGeometry &geometry, PxMassProperties &massProperties) const =0 |
| | Compute custom geometry mass properties. For geometries usable with dynamic rigidbodies.
|
| |
| virtual bool | usePersistentContactManifold (const PxGeometry &geometry, PxReal &breakingThreshold) const =0 |
| | Compatible with PhysX's PCM feature. Allows to optimize contact generation.
|
| |
Custom geometry callbacks structure. User should inherit this and implement all pure virtual functions.
◆ computeMassProperties()
| virtual void physx::PxCustomGeometry::Callbacks::computeMassProperties |
( |
const PxGeometry & |
geometry, |
|
|
PxMassProperties & |
massProperties |
|
) |
| const |
|
pure virtual |
Compute custom geometry mass properties. For geometries usable with dynamic rigidbodies.
- Parameters
-
| [in] | geometry | This geometry. |
| [out] | massProperties | Mass properties to compute. |
Implemented in VoxelMap, CustomCylinder, and CustomCone.
◆ generateContacts()
Contacts generation. Generate collision contacts between two geometries in given poses.
- Parameters
-
| [in] | geom0 | This custom geometry |
| [in] | geom1 | The other geometry |
| [in] | pose0 | This custom geometry pose |
| [in] | pose1 | The other geometry pose |
| [in] | contactDistance | The distance at which contacts begin to be generated between the pairs |
| [in] | meshContactMargin | The mesh contact margin. |
| [in] | toleranceLength | The toleranceLength. Used for scaling distance-based thresholds internally to produce appropriate results given simulations in different units |
| [out] | contactBuffer | A buffer to write contacts to. |
- Returns
- True if there are contacts. False otherwise.
Implemented in CustomConvex, and VoxelMap.
◆ getCustomType()
| virtual Type physx::PxCustomGeometry::Callbacks::getCustomType |
( |
| ) |
const |
|
pure virtual |
Return custom type. The type purpose is for user to differentiate custom geometries. Not used by PhysX.
- Returns
- Unique ID of a custom geometry type.
- Note
- User should use DECLARE_CUSTOM_GEOMETRY_TYPE and IMPLEMENT_CUSTOM_GEOMETRY_TYPE intead of overwriting this function.
◆ getLocalBounds()
| virtual PxBounds3 physx::PxCustomGeometry::Callbacks::getLocalBounds |
( |
const PxGeometry & |
geometry | ) |
const |
|
pure virtual |
Return local bounds.
- Parameters
-
| [in] | geometry | This geometry. |
- Returns
- Bounding box in the geometry local space.
Implemented in CustomConvex, and VoxelMap.
◆ overlap()
Overlap. Test if geometries overlap.
- Parameters
-
| [in] | geom0 | This custom geometry |
| [in] | pose0 | This custom geometry pose |
| [in] | geom1 | The other geometry |
| [in] | pose1 | The other geometry pose |
| [in] | threadContext | Optional user-defined per-thread context. |
- Returns
- True if there is overlap. False otherwise.
Implemented in CustomConvex, and VoxelMap.
◆ raycast()
Raycast. Cast a ray against the geometry in given pose.
- Parameters
-
| [in] | origin | Origin of the ray. |
| [in] | unitDir | Normalized direction of the ray. |
| [in] | geom | This custom geometry |
| [in] | pose | This custom geometry pose |
| [in] | maxDist | Length of the ray. Has to be in the [0, inf) range. |
| [in] | hitFlags | Specifies which properties per hit should be computed and returned via the hit callback. |
| [in] | maxHits | max number of returned hits = size of 'rayHits' buffer |
| [out] | rayHits | Ray hits. |
| [in] | stride | Ray hit structure stride. |
| [in] | threadContext | Optional user-defined per-thread context. |
- Returns
- Number of hits.
◆ sweep()
Sweep. Sweep one geometry against the other.
- Parameters
-
| [in] | unitDir | Normalized direction of the sweep. |
| [in] | maxDist | Length of the sweep. Has to be in the [0, inf) range. |
| [in] | geom0 | This custom geometry |
| [in] | pose0 | This custom geometry pose |
| [in] | geom1 | The other geometry |
| [in] | pose1 | The other geometry pose |
| [out] | sweepHit | Used to report the sweep hit. |
| [in] | hitFlags | Specifies which properties per hit should be computed and returned via the hit callback. |
| [in] | inflation | This parameter creates a skin around the swept geometry which increases its extents for sweeping. |
| [in] | threadContext | Optional user-defined per-thread context. |
- Returns
- True if there is hit. False otherwise.
◆ usePersistentContactManifold()
| virtual bool physx::PxCustomGeometry::Callbacks::usePersistentContactManifold |
( |
const PxGeometry & |
geometry, |
|
|
PxReal & |
breakingThreshold |
|
) |
| const |
|
pure virtual |
Compatible with PhysX's PCM feature. Allows to optimize contact generation.
- Parameters
-
| [in] | geometry | This geometry. |
| [out] | breakingThreshold | The threshold to trigger contacts re-generation. |
Implemented in CustomConvex, and VoxelMap.
◆ visualize()
Visualize custom geometry for debugging. Optional.
- Parameters
-
| [in] | geometry | This geometry. |
| [in] | out | Render output. |
| [in] | absPose | Geometry absolute transform. |
| [in] | cullbox | Region to visualize. |
Implemented in CustomConvex, and VoxelMap.
The documentation for this struct was generated from the following file: