PxAnisotropyGenerator#

Defined in include/PxAnisotropy.h

class PxAnisotropyGenerator#

Computes anisotropy information for a particle system to improve rendering quality.

Public Functions

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

Schedules the compuation of anisotropy information 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 generateAnisotropy(
PxVec4 *particlePositionsGpu,
PxParticleNeighborhoodProvider &neighborhoodProvider,
PxU32 numParticles,
PxReal particleContactOffset,
CUstream stream,
) = 0#

Schedules the compuation of anisotropy information 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 *anisotropy1,
PxVec4 *anisotropy2,
PxVec4 *anisotropy3,
) = 0#

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

Parameters:
  • anisotropy1[in] A host buffer holding the first row of the anisotropy matrix with memory for all particles already allocated

  • anisotropy2[in] A host buffer holding the second row of the anisotropy matrix with memory for all particles already allocated

  • anisotropy3[in] A host buffer holding the third row of the anisotropy matrix with memory for all particles already allocated

virtual void setResultBufferDevice(
PxVec4 *anisotropy1,
PxVec4 *anisotropy2,
PxVec4 *anisotropy3,
) = 0#

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

Parameters:
  • anisotropy1[in] A device buffer holding the first row of the anisotropy matrix with memory for all particles already allocated

  • anisotropy2[in] A device buffer holding the second row of the anisotropy matrix with memory for all particles already allocated

  • anisotropy3[in] A device buffer holding the third row of the anisotropy matrix with memory for all particles already allocated

virtual void setAnisotropyMax(float maxAnisotropy) = 0#

Sets the maximum value anisotropy can reach in any direction.

Parameters:

maxAnisotropy[in] The maximum anisotropy value

virtual void setAnisotropyMin(float minAnisotropy) = 0#

Sets the minimum value anisotropy can reach in any direction.

Parameters:

minAnisotropy[in] The minimum anisotropy value

virtual void setAnisotropyScale(float anisotropyScale) = 0#

Sets the anisotropy scale.

Parameters:

anisotropyScale[in] The anisotropy scale

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 *getAnisotropy1DevicePointer() const = 0#

Gets the device pointer for the anisotropy in x direction.

Only available after calling setResultBufferHost or setResultBufferDevice

Returns:

The device pointer for the anisotropy x direction and scale (w component contains the scale)

virtual PxVec4 *getAnisotropy2DevicePointer() const = 0#

Gets the device pointer for the anisotropy in y direction.

Only available after calling setResultBufferHost or setResultBufferDevice

Returns:

The device pointer for the anisotropy y direction and scale (w component contains the scale)

virtual PxVec4 *getAnisotropy3DevicePointer() const = 0#

Gets the device pointer for the anisotropy in z direction.

Only available after calling setResultBufferHost or setResultBufferDevice

Returns:

The device pointer for the anisotropy z direction and scale (w component contains the scale)

virtual void setEnabled(bool enabled) = 0#

Enables or disables the anisotropy generator.

Parameters:

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

virtual bool isEnabled() const = 0#

Allows to query if the anisotropy generator is enabled.

Returns:

True if enabled, false otherwise

virtual void release() = 0#

Releases the instance and its data.

inline virtual ~PxAnisotropyGenerator()#

Destructor.