RavEngine
Loading...
Searching...
No Matches
physx::Sq::BVHCompoundPruner Class Reference
Inheritance diagram for physx::Sq::BVHCompoundPruner:
[legend]
Collaboration diagram for physx::Sq::BVHCompoundPruner:
[legend]

Public Member Functions

 BVHCompoundPruner (PxU64 contextID)
 
void release ()
 
virtual DECLARE_BASE_PRUNER_API bool addCompound (Gu::PrunerHandle *results, const Gu::BVH &bvh, PrunerCompoundId compoundId, const PxTransform &transform, bool isDynamic, const Gu::PrunerPayload *data, const PxTransform *transforms)
 Adds compound to the pruner.
 
virtual bool removeCompound (PrunerCompoundId compoundId, Gu::PrunerPayloadRemovalCallback *removalCallback)
 
virtual bool updateCompound (PrunerCompoundId compoundId, const PxTransform &transform)
 
virtual void updateObjectAfterManualBoundsUpdates (PrunerCompoundId compoundId, const Gu::PrunerHandle handle)
 
virtual void removeObject (PrunerCompoundId compoundId, const Gu::PrunerHandle handle, Gu::PrunerPayloadRemovalCallback *removalCallback)
 
virtual bool addObject (PrunerCompoundId compoundId, Gu::PrunerHandle &result, const PxBounds3 &bounds, const Gu::PrunerPayload userData, const PxTransform &transform)
 Adds object to the pruner.
 
virtual bool raycast (const PxVec3 &origin, const PxVec3 &unitDir, PxReal &inOutDistance, CompoundPrunerRaycastCallback &, PxCompoundPrunerQueryFlags flags) const
 
virtual bool overlap (const Gu::ShapeData &queryVolume, CompoundPrunerOverlapCallback &, PxCompoundPrunerQueryFlags flags) const
 
virtual bool sweep (const Gu::ShapeData &queryVolume, const PxVec3 &unitDir, PxReal &inOutDistance, CompoundPrunerRaycastCallback &, PxCompoundPrunerQueryFlags flags) const
 
virtual const Gu::PrunerPayload & getPayloadData (Gu::PrunerHandle handle, PrunerCompoundId compoundId, Gu::PrunerPayloadData *data) const
 Retrieves the object's payload and data associated with the handle.
 
virtual void preallocate (PxU32 nbEntries)
 Preallocate space.
 
virtual bool setTransform (Gu::PrunerHandle handle, PrunerCompoundId compoundId, const PxTransform &transform)
 
virtual const PxTransform & getTransform (PrunerCompoundId compoundId) const
 
virtual void visualizeEx (PxRenderOutput &out, PxU32 color, bool drawStatic, bool drawDynamic) const
 
- 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

◆ addCompound()

bool BVHCompoundPruner::addCompound ( Gu::PrunerHandle *  results,
const Gu::BVH &  bvh,
PrunerCompoundId  compoundId,
const PxTransform &  transform,
bool  isDynamic,
const Gu::PrunerPayload *  data,
const PxTransform *  transforms 
)
virtual

Adds compound to the pruner.

Parameters
results[out] an array for resulting handles
bvh[in] BVH
compoundId[in] compound id
transform[in] compound transform
data[in] an array of object data
Returns
true if success, false if internal allocation failed. The first failing add results in a INVALID_PRUNERHANDLE.

Handles are usable as indices. Each handle is either be a recycled handle returned by the client via removeObjects(), or a fresh handle that is either zero, or one greater than the last fresh handle returned.

Implements physx::Sq::CompoundPruner.

◆ addObject()

bool BVHCompoundPruner::addObject ( PrunerCompoundId  compoundId,
Gu::PrunerHandle &  result,
const PxBounds3 &  bounds,
const Gu::PrunerPayload  userData,
const PxTransform &  transform 
)
virtual

Adds object to the pruner.

Parameters
compoundId[in] compound that the object belongs to
result[out] an array for resulting handles
bounds[in] an array of bounds. These bounds are used as-is so they should be pre-inflated if inflation is needed.
userData[in] an array of object data
Returns
true if success, false if internal allocation failed. The first failing add results in a INVALID_PRUNERHANDLE.

Implements physx::Sq::CompoundPruner.

◆ getPayloadData()

const PrunerPayload & BVHCompoundPruner::getPayloadData ( Gu::PrunerHandle  handle,
PrunerCompoundId  compoundId,
Gu::PrunerPayloadData *  data 
) const
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())
[in]compoundIdThe compound id
[out]dataOptional location where to store the internal data associated with the payload.
Returns
The payload associated with the given handle.

Implements physx::Sq::CompoundPruner.

◆ getTransform()

const PxTransform & BVHCompoundPruner::getTransform ( PrunerCompoundId  compoundId) const
virtual

◆ overlap()

bool BVHCompoundPruner::overlap ( const Gu::ShapeData &  queryVolume,
CompoundPrunerOverlapCallback &  prunerCallback,
PxCompoundPrunerQueryFlags  flags 
) const
virtual

◆ preallocate()

void BVHCompoundPruner::preallocate ( PxU32  nbEntries)
virtual

Preallocate space.

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

Implements physx::Sq::CompoundPruner.

◆ raycast()

bool BVHCompoundPruner::raycast ( const PxVec3 &  origin,
const PxVec3 &  unitDir,
PxReal &  inOutDistance,
CompoundPrunerRaycastCallback &  ,
PxCompoundPrunerQueryFlags  flags 
) const
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)

Implements physx::Sq::CompoundPruner.

◆ removeCompound()

bool BVHCompoundPruner::removeCompound ( PrunerCompoundId  compoundId,
Gu::PrunerPayloadRemovalCallback *  removalCallback 
)
virtual

Removes compound from the pruner.

Parameters
compoundId[in] compound to remove

Implements physx::Sq::CompoundPruner.

◆ removeObject()

void BVHCompoundPruner::removeObject ( PrunerCompoundId  compoundId,
const Gu::PrunerHandle  handle,
Gu::PrunerPayloadRemovalCallback *  removalCallback 
)
virtual

Removes object from compound pruner.

Parameters
compoundId[in] compound that the object belongs to
handle[in] the object to remove

Implements physx::Sq::CompoundPruner.

◆ setTransform()

bool BVHCompoundPruner::setTransform ( Gu::PrunerHandle  handle,
PrunerCompoundId  compoundId,
const PxTransform &  transform 
)
virtual

◆ sweep()

bool BVHCompoundPruner::sweep ( const Gu::ShapeData &  queryVolume,
const PxVec3 &  unitDir,
PxReal &  inOutDistance,
CompoundPrunerRaycastCallback &  prunerCallback,
PxCompoundPrunerQueryFlags  flags 
) const
virtual

◆ updateCompound()

bool BVHCompoundPruner::updateCompound ( PrunerCompoundId  compoundId,
const PxTransform &  transform 
)
virtual

Updates compound object

Parameters
compoundId[in] compound to update
transform[in] compound transformation

Implements physx::Sq::CompoundPruner.

◆ updateObjectAfterManualBoundsUpdates()

void BVHCompoundPruner::updateObjectAfterManualBoundsUpdates ( PrunerCompoundId  compoundId,
const Gu::PrunerHandle  handle 
)
virtual

Updates object after manually updating their bounds via "getPayload" calls.

Parameters
compoundId[in] compound that the object belongs to
handle[in] the object to update

Implements physx::Sq::CompoundPruner.

◆ visualizeEx()

void BVHCompoundPruner::visualizeEx ( PxRenderOutput &  out,
PxU32  color,
bool  drawStatic,
bool  drawDynamic 
) const
virtual

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