PxPhysicsGpu
Defined in include/gpu/PxPhysicsGpu.h
-
class PxPhysicsGpu
Public Functions
-
virtual PxIsosurfaceExtractor *createDenseGridIsosurfaceExtractor(PxCudaContextManager *cudaContextManager, const PxBounds3 &worldBounds, PxReal cellSize, const PxIsosurfaceParams &isosurfaceParams, PxU32 maxNumParticles, PxU32 maxNumVertices = 512 * 1024, PxU32 maxNumTriangles = 1024 * 1024) = 0
Creates an isosurface extractor operating on a dense grid.
- Parameters
cudaContextManager – [in] A cuda context manager
worldBounds – [in] The bounds of the internally used dense grid. The isosurface can only be generated inside those bounds.
cellSize – [in] The size of a single grid cell
isosurfaceParams – [in] The isosurface parameters to control the isolevel etc.
maxNumParticles – [in] The maximal number of particles that can be processed
maxNumVertices – [in] The maximal number of vertices the output buffer can hold
maxNumTriangles – [in] The maximal number of triangles the output buffer can hold
-
virtual PxSparseGridIsosurfaceExtractor *createSparseGridIsosurfaceExtractor(PxCudaContextManager *cudaContextManager, const PxSparseGridParams &sparseGridParams, const PxIsosurfaceParams &isosurfaceParams, PxU32 maxNumParticles, PxU32 maxNumVertices = 512 * 1024, PxU32 maxNumTriangles = 1024 * 1024) = 0
Creates an isosurface extractor operating on a sparse grid.
- Parameters
cudaContextManager – [in] A cuda context manager
sparseGridParams – [in] The sparse grid parameters defining the cell size etc.
isosurfaceParams – [in] The isosurface parameters to control the isolevel etc.
maxNumParticles – [in] The maximal number of particles that can be processed
maxNumVertices – [in] The maximal number of vertices the output buffer can hold
maxNumTriangles – [in] The maximal number of triangles the output buffer can hold
-
virtual PxAnisotropyGenerator *createAnisotropyGenerator(PxCudaContextManager *cudaContextManager, PxU32 maxNumParticles, PxReal anisotropyScale = 1.0f, PxReal minAnisotropy = 0.1f, PxReal maxAnisotropy = 2.0f) = 0
Creates an anisotropy generator.
- Parameters
cudaContextManager – [in] A cuda context manager
maxNumParticles – [in] The number of particles
anisotropyScale – [in] A uniform scaling factor to increase or decrease anisotropy
minAnisotropy – [in] The minimum scaling factor in any dimension that anisotropy can have
maxAnisotropy – [in] The maximum scaling factor in any dimension that anisotropy can have
-
virtual PxSmoothedPositionGenerator *createSmoothedPositionGenerator(PxCudaContextManager *cudaContextManager, PxU32 maxNumParticles, PxReal smoothingStrength = 0.5f) = 0
Creates a smoothed position generator.
- Parameters
cudaContextManager – [in] A cuda context manager
maxNumParticles – [in] The number of particles
smoothingStrength – [in] Controls the strength of the smoothing effect
-
virtual PxParticleNeighborhoodProvider *createParticleNeighborhoodProvider(PxCudaContextManager *cudaContextManager, const PxU32 maxNumParticles, const PxReal cellSize, const PxU32 maxNumSparseGridCells = 262144) = 0
Creates a neighborhood provider.
- Parameters
cudaContextManager – [in] A cuda context manager
maxNumParticles – [in] The number of particles
cellSize – [in] The grid cell size. Should be equal to 2*contactOffset for PBD particle systems.
maxNumSparseGridCells – [in] The maximal number of cells the internally used sparse grid can provide
-
virtual PxArrayConverter *createArrayConverter(PxCudaContextManager *cudaContextManager) = 0
Creates an array converter.
If not used anymore, the caller needs to delete the returned pointer.
- Parameters
cudaContextManager – [in] A cuda context manager
-
virtual PxLineStripSkinning *createLineStripSkinning(PxCudaContextManager *cudaContextManager) = 0
Creates an line strip embedding helper.
If not used anymore, the caller needs to delete the returned pointer.
- Parameters
cudaContextManager – [in] A cuda context manager
- Returns
Pointer to a new instance of a PxLineStripSkinning
-
virtual PxSDFBuilder *createSDFBuilder(PxCudaContextManager *cudaContextManager) = 0
Creates sdf builder to construct sdfs quickly on the GPU.
If not used anymore, the caller needs to delete the returned pointer.
- Parameters
cudaContextManager – [in] A cuda context manager
- Returns
Pointer to a new instance of a PxSDFBuilder
-
virtual PxU64 estimateSceneCreationGpuMemoryRequirements(const PxSceneDesc &sceneDesc) = 0
Estimates the amount of GPU memory needed to create a scene for the given descriptor.
- Deprecated:
This function is deprecated, creating a PxPhyics::createScene will return a null pointer if scene creation fails due to low GPU memory availability.
Note
While this is a conservative estimate, scene allocation may still fail even though there is enough memory - this function does not contain the potential overhead coming from the CUDA allocator. Additionally, there may be fragmentation issues. Generally, this is not an issue for scene allocation sizes < 500Mb, but may become problematic for larger scenes.
- Parameters
sceneDesc – [in] a valid scene desriptor
- Returns
A conservative estimate for the amount of GPU memory needed to create a scene for the given descriptor.
-
virtual void release() = 0
-
inline virtual ~PxPhysicsGpu()
-
virtual PxIsosurfaceExtractor *createDenseGridIsosurfaceExtractor(PxCudaContextManager *cudaContextManager, const PxBounds3 &worldBounds, PxReal cellSize, const PxIsosurfaceParams &isosurfaceParams, PxU32 maxNumParticles, PxU32 maxNumVertices = 512 * 1024, PxU32 maxNumTriangles = 1024 * 1024) = 0