Volumetric cache for local collision geometry.
More...
#include <PxVolumeCache.h>
|
virtual FillStatus | fill (const PxGeometry &cacheVolume, const PxTransform &pose)=0 |
| Fills the cache with objects intersecting the specified cacheVolume. More...
|
|
virtual bool | isValid () const =0 |
| Checks if the cache is valid (not over specified max capacity, for both statics and dynamics) and up-to-date. More...
|
|
virtual void | invalidate ()=0 |
| Invalidates the cache. More...
|
|
virtual bool | getCacheVolume (PxGeometryHolder &resultVolume, PxTransform &resultPose)=0 |
| Retrieves the last cached volume geometry. More...
|
|
virtual PxI32 | getNbCachedShapes ()=0 |
| Returns the total number of cached shapes. More...
|
|
virtual void | release ()=0 |
| Releases the cache object and its resources. More...
|
|
virtual void | forEach (Iterator &iter)=0 |
| Iterates over the scene shapes overlapping with the cache volume. More...
|
|
virtual void | setMaxNbStaticShapes (PxU32 maxCount)=0 |
| Sets the limit on the maximum number of static shapes allowed to be stored in the cache. More...
|
|
virtual void | setMaxNbDynamicShapes (PxU32 maxCount)=0 |
| Sets the limit on the maximum number of dynamic shapes allowed to be stored in the cache. More...
|
|
virtual PxU32 | getMaxNbStaticShapes ()=0 |
| Returns the current maximum number of static cached shapes. More...
|
|
virtual PxU32 | getMaxNbDynamicShapes ()=0 |
| Returns the current maximum number of dynamic cached shapes. More...
|
|
virtual bool | raycast (const PxVec3 &origin, const PxVec3 &unitDir, const PxReal distance, PxRaycastCallback &hitCall, PxHitFlags hitFlags=PxHitFlags(PxHitFlag::eDEFAULT), const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL) const =0 |
| Raycast against objects in the cache, returning results via PxRaycastCallback callback or PxRaycastBuffer object or a custom user callback implementation. More...
|
|
virtual bool | sweep (const PxGeometry &geometry, const PxTransform &pose, const PxVec3 &unitDir, const PxReal distance, PxSweepCallback &hitCall, PxHitFlags hitFlags=PxHitFlags(PxHitFlag::ePOSITION|PxHitFlag::eNORMAL|PxHitFlag::eDISTANCE), const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL, const PxReal inflation=0.f) const =0 |
| Sweep against objects in the cache, returning results via PxRaycastCallback callback or PxRaycastBuffer object or a custom user callback implementation. More...
|
|
virtual bool | overlap (const PxGeometry &geometry, const PxTransform &pose, PxOverlapCallback &hitCall, const PxQueryFilterData &filterData=PxQueryFilterData(), PxQueryFilterCallback *filterCall=NULL) const =0 |
| Test overlap between a geometry and objects in the cache. More...
|
|
Volumetric cache for local collision geometry.
Provides a mechanism for caching objects within a specified volume and performing raycast, sweep, overlap and forEach queries on the cached objects.
- See Also
- PxScene.createVolumeCache()
virtual PxVolumeCache::~PxVolumeCache |
( |
| ) |
|
|
inlineprotectedvirtual |
Fills the cache with objects intersecting the specified cacheVolume.
- Parameters
-
[in] | cacheVolume | Geometry of the cached volume (supported types are: sphere, box, capsule). |
[in] | pose | Pose of the cache volume. |
- Returns
- a FillStatus enum.
- See Also
- PxVolumeCache.FillStatus
virtual void PxVolumeCache::forEach |
( |
Iterator & |
iter | ) |
|
|
pure virtual |
Iterates over the scene shapes overlapping with the cache volume.
forEach will invoke PxVolumeCache::Iterator::processShapes virtual function, returning all overlapping shapes (possibly by issuing multiple callbacks) to the user. The size of reported blocks can change depending on internal SDK implementation. Any pointers to the contents of the buffer are only valid within the scope of a single processShapes() callback function. If forEach is invoked on an invalid cache (empty or out of date), this call will attempt to refill the cache within specified capacity. If the cache is over capacity, an attempt will be made to allocate a temp internal buffer, retrieve the results directly from the scene and return to the user via provided iterator. Results from forEach will be current for the last set cacheVolume provided in fill() even if the cache is invalid and refill fails. If the number of overlapping shapes is so high that the internal temporary allocation fails this call will produce an error and return.
- Parameters
-
iter | Iterator callback. forEach() will invokes iter.shapes() function (possibly multiple times) to return blocks of actor+shape pairs overlapped with cacheVolume to the user. |
Retrieves the last cached volume geometry.
- Returns
- False if the cache wasn't previously filled. True otherwise with cacheVolume from the last fill() call returned in resultVolume and corresponding transform in resultPose.
- See Also
- fill()
virtual PxU32 PxVolumeCache::getMaxNbDynamicShapes |
( |
| ) |
|
|
pure virtual |
Returns the current maximum number of dynamic cached shapes.
- Returns
- The max number of cached dynamics.
virtual PxU32 PxVolumeCache::getMaxNbStaticShapes |
( |
| ) |
|
|
pure virtual |
Returns the current maximum number of static cached shapes.
- Returns
- The max number of cached statics.
virtual PxI32 PxVolumeCache::getNbCachedShapes |
( |
| ) |
|
|
pure virtual |
Returns the total number of cached shapes.
- Returns
- The number of shapes stored in the cache (statics+dynamics). Returns -1 if the cache is invalid.
virtual void PxVolumeCache::invalidate |
( |
| ) |
|
|
pure virtual |
Invalidates the cache.
Marks the cache as invalid. Subsequent query will attempt to refill the cache from the scene.
virtual bool PxVolumeCache::isValid |
( |
| ) |
const |
|
pure virtual |
Checks if the cache is valid (not over specified max capacity, for both statics and dynamics) and up-to-date.
- Returns
- True if the cache is valid and up-to-date. Cache can become out-of-date if any statics or dynamics are moved or added or deleted from the scene.
- See Also
- PxVolumeCache.FillStatus
Test overlap between a geometry and objects in the cache.
- Note
- Filtering: Overlap tests do not distinguish between touching and blocking hit types (see PxQueryHitType). Both get written to the hit buffer.
- Parameters
-
[in] | geometry | Geometry of object to check for overlap (supported types are: box, sphere, capsule, convex). |
[in] | pose | Pose of the object. |
[out] | hitCall | Overlap hit callback or hit buffer object. |
[in] | filterData | Filtering data and simple logic. |
[in] | filterCall | Custom filtering logic (optional). Only used if the corresponding PxQueryFlag flags are set. If NULL, all hits are assumed to overlap. |
- Returns
- True if a blocking hit was found or any hit was found in case PxQueryFlag::eANY_HIT flag was specified.
- See Also
- PxOverlapCallback PxOverlapBuffer PxQueryFilterData PxQueryFilterCallback
Raycast against objects in the cache, returning results via PxRaycastCallback callback or PxRaycastBuffer object or a custom user callback implementation.
Returns whether any rigid actor is hit along the ray.
- Note
- Shooting a ray from within an object leads to different results depending on the shape type. Please check the details in user guide article SceneQuery. User can ignore such objects by employing one of the provided filter mechanisms.
- Parameters
-
[in] | origin | Origin of the ray. |
[in] | unitDir | Normalized direction of the ray. |
[in] | distance | Length of the ray. Needs to be larger than 0. |
[out] | hitCall | Raycast hit callback or hit buffer object. |
[in] | hitFlags | Specifies which properties per hit should be computed and returned via the hit callback. |
[in] | filterData | Filtering data and simple logic. |
[in] | filterCall | Custom filtering logic (optional). Only used if the corresponding PxQueryFlag flags are set. If NULL, all hits are assumed to be blocking. |
- Returns
- True if a blocking hit was found or any hit was found in case PxQueryFlag::eANY_HIT flag was used.
- See Also
- PxRaycastCallback PxRaycastBuffer PxQueryFilterData PxQueryFilterCallback PxQueryCache PxRaycastHit PxQueryFlag PxQueryFlag::eANY_HIT
virtual void PxVolumeCache::release |
( |
| ) |
|
|
pure virtual |
virtual void PxVolumeCache::setMaxNbDynamicShapes |
( |
PxU32 |
maxCount | ) |
|
|
pure virtual |
Sets the limit on the maximum number of dynamic shapes allowed to be stored in the cache.
If the number of cached objects goes over this limit, the query functions (forEach/raycast/sweep/overlap) will fall back to scene queries.
- Parameters
-
maxCount | Maximum number of dynamic shapes cached. |
virtual void PxVolumeCache::setMaxNbStaticShapes |
( |
PxU32 |
maxCount | ) |
|
|
pure virtual |
Sets the limit on the maximum number of static shapes allowed to be stored in the cache.
If the number of cached objects goes over this limit, the query functions (forEach/raycast/sweep/overlap) will fall back to scene queries.
- Parameters
-
maxCount | Maximum number of static shapes cached. |
Sweep against objects in the cache, returning results via PxRaycastCallback callback or PxRaycastBuffer object or a custom user callback implementation.
Returns whether any rigid actor is hit along the sweep path.
- Parameters
-
[in] | geometry | Geometry of object to sweep (supported types are: box, sphere, capsule, convex). |
[in] | pose | Pose of the sweep object. |
[in] | unitDir | Normalized direction of the sweep. |
[in] | distance | Sweep distance. Needs to be larger than 0. Will be clamped to PX_MAX_SWEEP_DISTANCE. |
[out] | hitCall | Sweep hit callback or hit buffer object. |
[in] | hitFlags | Specifies which properties per hit should be computed and returned via the hit callback. |
[in] | filterData | Filtering data and simple logic. |
[in] | filterCall | Custom filtering logic (optional). Only used if the corresponding PxQueryFlag flags are set. If NULL, all hits are assumed to be blocking. |
[in] | inflation | This parameter creates a skin around the swept geometry which increases its extents for sweeping. The sweep will register a hit as soon as the skin touches a shape, and will return the corresponding distance and normal. |
- Returns
- True if a blocking hit was found or any hit was found in case PxQueryFlag::eANY_HIT flag was specified.
- See Also
- PxSweepCallback PxSweepBuffer PxQueryFilterData PxQueryFilterCallback PxSweepHit PxQueryCache PxHitFlags
The documentation for this class was generated from the following file: