RavEngine
Loading...
Searching...
No Matches
physx::Gu::Pruner Class Referenceabstract
Inheritance diagram for physx::Gu::Pruner:
[legend]
Collaboration diagram for physx::Gu::Pruner:
[legend]

Public Member Functions

virtual bool addObjects (PrunerHandle *results, const PxBounds3 *bounds, const PrunerPayload *data, const PxTransform *transforms, PxU32 count, bool hasPruningStructure)=0
 Adds objects to the pruner.
 
virtual void removeObjects (const PrunerHandle *handles, PxU32 count, PrunerPayloadRemovalCallback *removalCallback)=0
 Removes objects from the pruner.
 
virtual void updateObjects (const PrunerHandle *handles, PxU32 count, float inflation=0.0f, const PxU32 *boundsIndices=NULL, const PxBounds3 *newBounds=NULL, const PxTransform32 *newTransforms=NULL)=0
 Updates objects with new bounds & transforms.
 
virtual void purge ()=0
 Gets rid of internal accel struct.

 
virtual void commit ()=0
 Makes the queries consistent with previous changes.
 
virtual void merge (const void *mergeParams)=0
 Merges pruning structure to current pruner, parameters may differ for each pruner implementation.
 
virtual bool raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal &inOutDistance, PrunerRaycastCallback &) const =0
 
virtual bool overlap (const Gu::ShapeData &queryVolume, PrunerOverlapCallback &) const =0
 
virtual bool sweep (const Gu::ShapeData &queryVolume, const PxVec3 &unitDir, PxReal &inOutDistance, PrunerRaycastCallback &) const =0
 
virtual const PrunerPayload & getPayloadData (PrunerHandle handle, PrunerPayloadData *data=NULL) const =0
 Retrieves the object's payload and data associated with the handle.
 
virtual void preallocate (PxU32 nbEntries)=0
 Preallocate space.
 
virtual bool setTransform (PrunerHandle handle, const PxTransform &transform)=0
 Sets object's transform.
 
virtual bool isDynamic () const
 
virtual void getGlobalBounds (PxBounds3 &) const =0
 
- Public Member Functions inherited from physx::Gu::BasePruner
virtual void shiftOrigin (const PxVec3 &shift)=0
 
virtual void visualize (PxRenderOutput &, PxU32, PxU32) const
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Member Function Documentation

◆ addObjects()

virtual bool physx::Gu::Pruner::addObjects ( PrunerHandle *  results,
const PxBounds3 *  bounds,
const PrunerPayload *  data,
const PxTransform *  transforms,
PxU32  count,
bool  hasPruningStructure 
)
pure virtual

Adds objects to the pruner.

Parameters
[out]resultsReturned handles for added objects
[in]boundsBounds of added objects. These bounds are used as-is so they should be pre-inflated if inflation is needed.
[in]dataPayloads for added objects.
[in]transformsTransforms of added objects.
[in]countNumber of objects in the arrays
[in]hasPruningStructureTrue if added objects have pruning structure. The structure will be merged later, adding the objects will not invalidate the pruner.
Returns
true if success, false if internal allocation failed. The first failing add results in a INVALID_PRUNERHANDLE.
See also
PxPruningStructure

◆ commit()

virtual void physx::Gu::Pruner::commit ( )
pure virtual

Makes the queries consistent with previous changes.

This function must be called before starting queries on an updated Pruner and assert otherwise.

◆ getPayloadData()

virtual const PrunerPayload & physx::Gu::Pruner::getPayloadData ( PrunerHandle  handle,
PrunerPayloadData *  data = NULL 
) const
pure virtual

Retrieves the object's payload and data associated with the handle.

This function returns the payload associated with a given handle. Additionally it can return the destination addresses for the object's bounds & transform. The user can then write the new bounds and transform there, before eventually calling updateObjects().

Parameters
[in]handleObject handle (initially returned by addObjects())
[out]dataOptional location where to store the internal data associated with the payload.
Returns
The payload associated with the given handle.

◆ merge()

virtual void physx::Gu::Pruner::merge ( const void *  mergeParams)
pure virtual

Merges pruning structure to current pruner, parameters may differ for each pruner implementation.

Parameters
[in]mergeParamsImplementation-dependent merge data

◆ preallocate()

virtual void physx::Gu::Pruner::preallocate ( PxU32  nbEntries)
pure virtual

Preallocate space.

Parameters
[in]nbEntriesThe number of entries to preallocate space for

◆ raycast()

virtual bool physx::Gu::Pruner::raycast ( const PxVec3 &  origin,
const PxVec3 &  unitDir,
PxReal &  inOutDistance,
PrunerRaycastCallback &   
) const
pure virtual

Query functions

Note: return value may disappear if PrunerCallback contains the necessary information currently it is still used for the dynamic pruner internally (to decide if added objects must be queried)

◆ removeObjects()

virtual void physx::Gu::Pruner::removeObjects ( const PrunerHandle *  handles,
PxU32  count,
PrunerPayloadRemovalCallback *  removalCallback 
)
pure virtual

Removes objects from the pruner.

Parameters
[in]handlesThe objects to remove
[in]countThe number of objects to remove
[in]removalCallbackOptional callback, called for each removed object (giving access to its payload for keeping external structures in sync)

◆ setTransform()

virtual bool physx::Gu::Pruner::setTransform ( PrunerHandle  handle,
const PxTransform &  transform 
)
pure virtual

Sets object's transform.

Note
This is equivalent to retrieving the transform's address with "getPayloadData" and writing the transform there.
Parameters
[in]handleObject handle (initially returned by addObjects())
[in]transformNew transform
Returns
True if success

◆ updateObjects()

virtual void physx::Gu::Pruner::updateObjects ( const PrunerHandle *  handles,
PxU32  count,
float  inflation = 0.0f,
const PxU32 *  boundsIndices = NULL,
const PxBounds3 *  newBounds = NULL,
const PxTransform32 *  newTransforms = NULL 
)
pure virtual

Updates objects with new bounds & transforms.

There are two ways to use this function:

1) manual bounds update: you can manually update the bounds via "getPayloadData" calls prior to calling "updateObjects". In this case "updateObjects" only notifies the system that the data for these objects has changed. In this mode the "inflation", "boundsIndices", "newBounds" and "newTransforms" parameters should remain null.

2) synchronization mode: in this case the new bounds (and optionally the new transforms) have been computed by an external source and "updateObjects" tells the system to update its data from passed buffers. The new bounds are always inflated by the "inflation" parameter while being copied. "boundsIndices" is an optional remap table, allowing this call to only update a subset of the existing bounds (i.e. the updated bounds don't have to be first copied to a separate contiguous buffer).

Parameters
[in]handlesThe objects to update
[in]countThe number of objects to update
[in]inflationBounds inflation value
[in]boundsIndicesThe indices of the bounds in the bounds array (or NULL)
[in]newBoundsUpdated bounds array (or NULL)
[in]newTransformsUpdated transforms array (or NULL)

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