29#ifndef PX_CUSTOMGEOMETRY_H
30#define PX_CUSTOMGEOMETRY_H
35#include "geometry/PxGeometry.h"
36#include "geometry/PxGeometryHit.h"
37#include "geometry/PxGeometryQueryContext.h"
38#include "foundation/PxFoundationConfig.h"
44 class PxContactBuffer;
46 class PxMassProperties;
136 const PxReal contactDistance,
const PxReal meshContactMargin,
const PxReal toleranceLength,
281 return mType == PxGeometryType::eCUSTOM &&
callbacks != NULL;
291#define DECLARE_CUSTOM_GEOMETRY_TYPE \
292 static ::physx::PxCustomGeometry::Type TYPE(); \
293 virtual ::physx::PxCustomGeometry::Type getCustomType() const;
298#define IMPLEMENT_CUSTOM_GEOMETRY_TYPE(CLASS) \
299::physx::PxCustomGeometry::Type CLASS::TYPE() \
301 static ::physx::PxCustomGeometry::Type customType; \
304::physx::PxCustomGeometry::Type CLASS::getCustomType() const \
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Custom geometry class. This class allows user to create custom geometries by providing a set of virtu...
Definition PxCustomGeometry.h:52
PX_INLINE PxCustomGeometry(Callbacks &_callbacks)
Constructor.
Definition PxCustomGeometry.h:234
Callbacks * callbacks
A reference to the callbacks object.
Definition PxCustomGeometry.h:276
static PX_PHYSX_COMMON_API PxU32 getUniqueID()
For internal use.
Definition GuGeometryQuery.cpp:486
PX_INLINE bool isValid() const
Returns true if the geometry is valid.
Definition PxCustomGeometry.h:279
PX_INLINE PxCustomGeometry()
Default constructor.
Definition PxCustomGeometry.h:226
PX_INLINE void operator=(const PxCustomGeometry &that)
Assignment operator.
Definition PxCustomGeometry.h:252
PX_INLINE Type getCustomType() const
Returns the custom type of the custom geometry.
Definition PxCustomGeometry.h:270
PX_INLINE PxCustomGeometry(const PxCustomGeometry &that)
Copy constructor.
Definition PxCustomGeometry.h:244
A geometry object.
Definition PxGeometry.h:79
Utility class to compute and manipulate mass and inertia tensor properties.
Definition PxMassProperties.h:65
Definition PxRenderOutput.h:50
3 Element vector class.
Definition PxVec3.h:50
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Custom geometry callbacks structure. User should inherit this and implement all pure virtual function...
Definition PxCustomGeometry.h:102
virtual Type getCustomType() const =0
Return custom type. The type purpose is for user to differentiate custom geometries....
virtual bool usePersistentContactManifold(const PxGeometry &geometry, PxReal &breakingThreshold) const =0
Compatible with PhysX's PCM feature. Allows to optimize contact generation.
virtual void visualize(const PxGeometry &geometry, PxRenderOutput &out, const PxTransform &absPose, const PxBounds3 &cullbox) const =0
Visualize custom geometry for debugging. Optional.
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 void computeMassProperties(const PxGeometry &geometry, PxMassProperties &massProperties) const =0
Compute custom geometry mass properties. For geometries usable with dynamic rigidbodies.
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 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 PxBounds3 getLocalBounds(const PxGeometry &geometry) const =0
Return local bounds.
virtual bool overlap(const PxGeometry &geom0, const PxTransform &pose0, const PxGeometry &geom1, const PxTransform &pose1, PxOverlapThreadContext *threadContext) const =0
Overlap. Test if geometries overlap.
The type of a custom geometry. Allows to identify a particular kind of it.
Definition PxCustomGeometry.h:63
PX_INLINE Type & operator=(const Type &t)
Assigment operator.
Definition PxCustomGeometry.h:77
PX_INLINE bool operator!=(const Type &t) const
Inequality operator.
Definition PxCustomGeometry.h:87
static PX_INLINE Type INVALID()
Invalid type.
Definition PxCustomGeometry.h:92
PX_INLINE Type()
Default constructor.
Definition PxCustomGeometry.h:67
PX_INLINE Type(const Type &t)
Default constructor.
Definition PxCustomGeometry.h:72
PX_INLINE bool operator==(const Type &t) const
Equality operator.
Definition PxCustomGeometry.h:82
Stores results of raycast queries.
Definition PxGeometryHit.h:151
Stores results of sweep queries.
Definition PxGeometryHit.h:175
A geometry type.
Definition PxGeometry.h:50
A per-thread context passed to low-level query functions.
Definition PxGeometryQueryContext.h:52