PxSmoothedPositionGenerator

Defined in include/PxSmoothing.h

class PxSmoothedPositionGenerator

Ccomputes smoothed positions for a particle system to improve rendering quality.

Public Functions

virtual void generateSmoothedPositions(PxGpuParticleSystem *gpuParticleSystem, PxU32 numParticles, CUstream stream) = 0

Schedules the compuation of smoothed positions on the specified cuda stream.

Parameters
  • gpuParticleSystem[in] A gpu pointer to access particle system data

  • numParticles[in] The number of particles

  • stream[in] The stream on which the cuda call gets scheduled

virtual void generateSmoothedPositions(PxVec4 *particlePositionsGpu, PxParticleNeighborhoodProvider &neighborhoodProvider, PxU32 numParticles, PxReal particleContactOffset, CUstream stream) = 0

Schedules the compuation of smoothed positions on the specified cuda stream.

Parameters
  • particlePositionsGpu[in] A gpu pointer containing the particle positions

  • neighborhoodProvider[in] A neighborhood provider object that supports fast neighborhood queries

  • numParticles[in] The number of particles

  • particleContactOffset[in] The particle contact offset

  • stream[in] The stream on which the cuda call gets scheduled

virtual void setResultBufferHost(PxVec4 *smoothedPositions) = 0

Set a host buffer that holds the smoothed position data after the timestep completed.

Parameters

smoothedPositions[in] A host buffer with memory for all particles already allocated

virtual void setResultBufferDevice(PxVec4 *smoothedPositions) = 0

Set a device buffer that holds the smoothed position data after the timestep completed.

Parameters

smoothedPositions[in] A device buffer with memory for all particles already allocated

virtual void setSmoothing(float smoothingStrenght) = 0

Sets the intensity of the position smoothing effect.

Parameters

smoothingStrenght[in] The strength of the smoothing effect

virtual PxU32 getMaxParticles() const = 0

Gets the maximal number of particles.

Returns

The maximal number of particles

virtual void setMaxParticles(PxU32 maxParticles) = 0

Sets the maximal number of particles.

Parameters

maxParticles[in] The maximal number of particles

virtual PxVec4 *getSmoothedPositionsDevicePointer() const = 0

Gets the device pointer for the smoothed positions.

Only available after calling setResultBufferHost or setResultBufferDevice

Returns

The device pointer for the smoothed positions

virtual void setEnabled(bool enabled) = 0

Enables or disables the smoothed position generator.

Parameters

enabled[in] The boolean to set the generator to enabled or disabled

virtual bool isEnabled() const = 0

Allows to query if the smoothed position generator is enabled.

Returns

True if enabled, false otherwise

virtual void release() = 0

Releases the instance and its data.

inline virtual ~PxSmoothedPositionGenerator()

Destructor.