RavEngine
Loading...
Searching...
No Matches
physx::PxSamplingExt Class Reference

utility functions to sample vertices on or inside a triangle mesh or other geometries More...

#include <PxSamplingExt.h>

Static Public Member Functions

static void poissonSample (const PxSimpleTriangleMesh &mesh, PxReal r, PxArray< PxVec3 > &result, PxReal rVolume=0.0f, PxArray< PxI32 > *triangleIds=NULL, PxArray< PxVec3 > *barycentricCoordinates=NULL, const PxBounds3 *axisAlignedBox=NULL, const PxQuat *boxOrientation=NULL, PxU32 maxNumSamples=0, PxU32 numSampleAttemptsAroundPoint=30)
 
static void poissonSample (const PxGeometry &geometry, const PxTransform &transform, const PxBounds3 &worldBounds, PxReal r, PxArray< PxVec3 > &result, PxReal rVolume=0.0f, const PxBounds3 *axisAlignedBox=NULL, const PxQuat *boxOrientation=NULL, PxU32 maxNumSamples=0, PxU32 numSampleAttemptsAroundPoint=30)
 

Detailed Description

utility functions to sample vertices on or inside a triangle mesh or other geometries

Member Function Documentation

◆ poissonSample() [1/2]

void physx::PxSamplingExt::poissonSample ( const PxGeometry &  geometry,
const PxTransform &  transform,
const PxBounds3 &  worldBounds,
PxReal  r,
PxArray< PxVec3 > &  result,
PxReal  rVolume = 0.0f,
const PxBounds3 *  axisAlignedBox = NULL,
const PxQuat *  boxOrientation = NULL,
PxU32  maxNumSamples = 0,
PxU32  numSampleAttemptsAroundPoint = 30 
)
static

Computes samples on a geometry's surface that are not closer to each other than a given distance.

Parameters
[in]geometryThe geometry that defines the surface on which the samples get created
[in]transformThe geometry's global pose
[in]worldBoundsThe geometry's bounding box
[in]rThe closest distance two surface samples are allowed to have
[out]resultEqually distributed samples on and if specified inside the triangle mesh
[in]rVolumeThe average distance of samples inside the mesh. If set to zero, samples will only be placed on the mesh's surface
[in]axisAlignedBoxA box that limits the space where samples can get created
[in]boxOrientationThe orientation of the box that limits the space where samples can get created
[in]maxNumSamplesIf larger than zero, the sampler will stop when the sample count reaches maxNumSamples
[in]numSampleAttemptsAroundPointNumber of repetitions the underlying algorithm performs to find a new valid sample that matches all criteria like minimal distance to existing samples etc.

◆ poissonSample() [2/2]

void physx::PxSamplingExt::poissonSample ( const PxSimpleTriangleMesh &  mesh,
PxReal  r,
PxArray< PxVec3 > &  result,
PxReal  rVolume = 0.0f,
PxArray< PxI32 > *  triangleIds = NULL,
PxArray< PxVec3 > *  barycentricCoordinates = NULL,
const PxBounds3 *  axisAlignedBox = NULL,
const PxQuat *  boxOrientation = NULL,
PxU32  maxNumSamples = 0,
PxU32  numSampleAttemptsAroundPoint = 30 
)
static

Computes samples on a triangle mesh's surface that are not closer to each other than a given distance. Optionally the mesh's interior can be filled with samples as well.

Parameters
[in]meshThe triangle mesh
[in]rThe closest distance two surface samples are allowed to have
[out]resultEqually distributed samples on and if specified inside the triangle mesh
[in]rVolumeThe average distance of samples inside the mesh. If set to zero, samples will only be placed on the mesh's surface
[out]triangleIdsOptional output containing the index of the triangle for all samples on the mesh's surface. The array will contain less entries than output vertices if volume samples are active since volume samples are not on the surface.
[out]barycentricCoordinatesOptional output containing the barycentric coordinates for all samples on the mesh's surface. The array will contain less entries than output vertices if volume samples are active since volume samples are not on the surface.
[in]axisAlignedBoxA box that limits the space where samples can get created
[in]boxOrientationThe orientation of the box that limits the space where samples can get created
[in]maxNumSamplesIf larger than zero, the sampler will stop when the sample count reaches maxNumSamples
[in]numSampleAttemptsAroundPointNumber of repetitions the underlying algorithm performs to find a new valid sample that matches all criteria like minimal distance to existing samples etc.

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