Classes | Functions
FractureTools Namespace Reference

Classes

struct  MeshProcessingParameters
class  ICutoutSet
struct  NoiseParameters
struct  SliceParameters
struct  FractureSliceDesc
struct  CutoutParameters
struct  FractureCutoutDesc
struct  FractureVoronoiDesc

Functions

physx::IExplicitHierarchicalMesh * createExplicitHierarchicalMesh ()
physx::IExplicitHierarchicalMesh::IConvexHull * createExplicitHierarchicalMeshConvexHull ()
ICutoutSetcreateCutoutSet ()
void buildCutoutSet (ICutoutSet &cutoutSet, const physx::PxU8 *pixelBuffer, physx::PxU32 bufferWidth, physx::PxU32 bufferHeight, physx::PxF32 snapThreshold, bool periodic)
bool calculateCutoutUVMapping (const physx::NxExplicitRenderTriangle &triangle, physx::PxMat33 &theMapping)
bool calculateCutoutUVMapping (physx::IExplicitHierarchicalMesh &hMesh, const physx::PxVec3 &targetDirection, physx::PxMat33 &theMapping)
bool createVoronoiSplitMesh (physx::IExplicitHierarchicalMesh &hMesh, physx::IExplicitHierarchicalMesh &iHMeshCore, bool exportCoreMesh, physx::PxI32 coreMeshImprintSubmeshIndex, const MeshProcessingParameters &meshProcessingParams, const FractureVoronoiDesc &desc, const physx::NxCollisionDesc &collisionDesc, physx::PxU32 randomSeed, physx::IProgressListener &progressListener, volatile bool *cancel=NULL)
void createVoronoiSitesInsideMesh (physx::IExplicitHierarchicalMesh &hMesh, physx::PxVec3 *siteBuffer, physx::PxU32 siteCount, physx::PxU32 *randomSeed, physx::PxU32 *microgridSize, physx::IProgressListener &progressListener, physx::PxU32 chunkIndex=0xFFFFFFFF)
physx::PxU32 createScatterMeshSites (physx::PxU8 *meshIndices, physx::PxMat44 *relativeTransforms, physx::PxU32 *chunkMeshStarts, physx::PxU32 scatterMeshInstancesBufferSize, physx::IExplicitHierarchicalMesh &hMesh, physx::PxU32 targetChunkCount, const physx::PxU16 *targetChunkIndices, physx::PxU32 *randomSeed, physx::PxU32 scatterMeshAssetCount, physx::NxRenderMeshAsset **scatterMeshAssets, const physx::PxU32 *minCount, const physx::PxU32 *maxCount, const physx::PxF32 *minScales, const physx::PxF32 *maxScales, const physx::PxF32 *maxAngles)
void visualizeVoronoiCells (physx::NxApexRenderDebug &debugRender, const physx::PxVec3 *sites, physx::PxU32 siteCount, const physx::PxU32 *cellColors, physx::PxU32 cellColorCount, const physx::PxBounds3 &bounds, physx::PxU32 cellIndex=0xFFFFFFFF)
bool buildExplicitHierarchicalMesh (physx::IExplicitHierarchicalMesh &iHMesh, const physx::NxExplicitRenderTriangle *meshTriangles, physx::PxU32 meshTriangleCount, const physx::NxExplicitSubmeshData *submeshData, physx::PxU32 submeshCount, physx::PxU32 *meshPartition=NULL, physx::PxU32 meshPartitionCount=0, bool firstPartitionIsDepthZero=false)
void setBSPTolerances (physx::PxF32 linearTolerance, physx::PxF32 angularTolerance, physx::PxF32 baseTolerance, physx::PxF32 clipTolerance, physx::PxF32 cleaningTolerance)
void setBSPBuildParameters (physx::PxF32 logAreaSigmaThreshold, physx::PxU32 testSetSize, physx::PxF32 splitWeight, physx::PxF32 imbalanceWeight)
bool buildExplicitHierarchicalMeshFromRenderMeshAsset (physx::IExplicitHierarchicalMesh &iHMesh, const physx::NxRenderMeshAsset &renderMeshAsset, physx::PxU32 maxRootDepth=PX_MAX_U32)
bool buildExplicitHierarchicalMeshFromDestructibleAsset (physx::IExplicitHierarchicalMesh &iHMesh, const physx::NxDestructibleAsset &destructibleAsset, physx::PxU32 maxRootDepth=PX_MAX_U32)
bool createHierarchicallySplitMesh (physx::IExplicitHierarchicalMesh &hMesh, physx::IExplicitHierarchicalMesh &iHMeshCore, bool exportCoreMesh, physx::PxI32 coreMeshImprintSubmeshIndex, const MeshProcessingParameters &meshProcessingParams, const FractureSliceDesc &desc, const physx::NxCollisionDesc &collisionDesc, physx::PxU32 randomSeed, physx::IProgressListener &progressListener, volatile bool *cancel=NULL)
bool createChippedMesh (physx::IExplicitHierarchicalMesh &hMesh, const MeshProcessingParameters &meshProcessingParams, const FractureCutoutDesc &desc, const ICutoutSet &iCutoutSet, const FractureSliceDesc &sliceDesc, const FractureVoronoiDesc &voronoiDesc, const physx::NxCollisionDesc &collisionDesc, physx::PxU32 randomSeed, physx::IProgressListener &progressListener, volatile bool *cancel=NULL)
bool hierarchicallySplitChunk (physx::IExplicitHierarchicalMesh &hMesh, physx::PxU32 chunkIndex, const MeshProcessingParameters &meshProcessingParams, const FractureSliceDesc &desc, const physx::NxCollisionDesc &collisionDesc, physx::PxU32 *randomSeed, physx::IProgressListener &progressListener, volatile bool *cancel=NULL)
bool voronoiSplitChunk (physx::IExplicitHierarchicalMesh &hMesh, physx::PxU32 chunkIndex, const MeshProcessingParameters &meshProcessingParams, const FractureVoronoiDesc &desc, const physx::NxCollisionDesc &collisionDesc, physx::PxU32 *randomSeed, physx::IProgressListener &progressListener, volatile bool *cancel=NULL)
bool buildSliceMesh (physx::IntersectMesh &intersectMesh, physx::IExplicitHierarchicalMesh &referenceMesh, const physx::PxPlane &slicePlane, const FractureTools::NoiseParameters &noiseParameters, physx::PxU32 randomSeed)

Function Documentation

void FractureTools::buildCutoutSet ( ICutoutSet &  cutoutSet,
const physx::PxU8 *  pixelBuffer,
physx::PxU32  bufferWidth,
physx::PxU32  bufferHeight,
physx::PxF32  snapThreshold,
bool  periodic 
)

Builds a cutout set (which must have been initially created by createCutoutSet()). Uses a bitmap described by pixelBuffer, bufferWidth, and bufferHeight. Each pixel is represented by one byte in the buffer.

cutoutSet: the ICutoutSet to build pixelBuffer: pointer to be beginning of the pixel buffer bufferWidth: the width of the buffer in pixels bufferHeight: the height of the buffer in pixels snapThreshold: the pixel distance at which neighboring cutout vertices and segments may be fudged into alignment. periodic: whether or not to use periodic boundary conditions when creating cutouts from the map

bool FractureTools::buildExplicitHierarchicalMesh ( physx::IExplicitHierarchicalMesh &  iHMesh,
const physx::NxExplicitRenderTriangle *  meshTriangles,
physx::PxU32  meshTriangleCount,
const physx::NxExplicitSubmeshData *  submeshData,
physx::PxU32  submeshCount,
physx::PxU32 *  meshPartition = NULL,
physx::PxU32  meshPartitionCount = 0,
bool  firstPartitionIsDepthZero = false 
)

Builds a new IExplicitHierarchicalMesh from an array of triangles.

iHMesh: the IExplicitHierarchicalMesh to build meshTriangles: pointer to array of NxExplicitRenderTriangles which make up the mesh meshTriangleCount the size of the meshTriangles array submeshData: pointer to array of NxExplicitSubmeshData, describing the submeshes submeshCount: the size of the submeshData array meshPartition: if not NULL, an array of size meshPartitionCount, giving the end elements of contiguous subsets of meshTriangles. If meshPartition is NULL, one partition is assumed. When there is one partition, these triangles become the level 0 part. When there is more than one partition, these triangles become level 1 parts, the behavior is determined by firstPartitionIsDepthZero (see below). meshPartitionCount: if meshPartition is not NULL, this is the size of the meshPartition array. firstPartitionIsDepthZero: if a meshPartition is given and there is more than one part, then if firstPartitionIsDepthZero = true, the first partition is the depth 0 chunk. Otherwise, all parts created from the input partition will be depth 1, and the depth 0 chunk will be created from the union of the depth 1 chunks.

bool FractureTools::buildExplicitHierarchicalMeshFromDestructibleAsset ( physx::IExplicitHierarchicalMesh &  iHMesh,
const physx::NxDestructibleAsset &  destructibleAsset,
physx::PxU32  maxRootDepth = PX_MAX_U32 
)

Builds the root IExplicitHierarchicalMesh from an NxDestructibleAsset. Since an NxDestructibleAsset contains hierarchy information, the explicit mesh formed will have this hierarchy structure.

iHMesh: the IExplicitHierarchicalMesh to build destructibleAsset: Input Destructible asset maxRootDepth: cap the root depth at this value. Re-fracturing of the mesh will occur at this depth. Default = PX_MAX_U32

bool FractureTools::buildExplicitHierarchicalMeshFromRenderMeshAsset ( physx::IExplicitHierarchicalMesh &  iHMesh,
const physx::NxRenderMeshAsset &  renderMeshAsset,
physx::PxU32  maxRootDepth = PX_MAX_U32 
)

Builds the root IExplicitHierarchicalMesh from an NxRenderMeshAsset. Since an NxDestructibleAsset contains no hierarchy information, the input mesh must have only one part.

iHMesh: the IExplicitHierarchicalMesh to build renderMeshAsset: Input RenderMesh asset maxRootDepth: cap the root depth at this value. Re-fracturing of the mesh will occur at this depth. Default = PX_MAX_U32

bool FractureTools::buildSliceMesh ( physx::IntersectMesh &  intersectMesh,
physx::IExplicitHierarchicalMesh &  referenceMesh,
const physx::PxPlane &  slicePlane,
const FractureTools::NoiseParameters noiseParameters,
physx::PxU32  randomSeed 
)

Builds a mesh used for slice fracturing, given the noise parameters and random seed. This function is mostly intended for visualization - to give the user a "typical" slice surface used for fracturing.

bool FractureTools::calculateCutoutUVMapping ( const physx::NxExplicitRenderTriangle &  triangle,
physx::PxMat33 &  theMapping 
)

Calculate the mapping between a cutout fracture map and a given triangle. The result is a 3 by 3 matrix M composed by an affine transformation and a rotation, we can get the 3-D projection for a texture coordinate pair (u,v) with such a formula: (x,y,z) = M*PxVec3(u,v,1)

triangle: the target face's normal theMapping: resulted mapping, composed by an affine transformation and a rotation

bool FractureTools::calculateCutoutUVMapping ( physx::IExplicitHierarchicalMesh &  hMesh,
const physx::PxVec3 &  targetDirection,
physx::PxMat33 &  theMapping 
)

Uses the passed-in target direction to find the best triangle in the root mesh with normal near the given targetDirection. If triangles exist with normals within one degree of the given target direction, then one with the greatest area of such triangles is used. Otherwise, the triangle with normal closest to the given target direction is used. The resulting triangle is used to calculate a UV mapping as in the function calculateCutoutUVMapping (above).

The assumption is that there exists a single mapping for all triangles on a specified face, for this feature to be useful.

hMesh: the explicit mesh with well rectangle-shaped faces targetDirection: the target face's normal theMapping: resulted mapping, composed by an affine transformation and a rotation

bool FractureTools::createChippedMesh ( physx::IExplicitHierarchicalMesh &  hMesh,
const MeshProcessingParameters &  meshProcessingParams,
const FractureCutoutDesc &  desc,
const ICutoutSet &  iCutoutSet,
const FractureSliceDesc &  sliceDesc,
const FractureVoronoiDesc &  voronoiDesc,
const physx::NxCollisionDesc &  collisionDesc,
physx::PxU32  randomSeed,
physx::IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
)

Chips the mesh in chunk[0], forming a hierarchy of fractured meshes in chunks[1...]

hMesh: the mesh to split meshProcessingParams: describes generic mesh processing directives desc: describes the slicing surfaces (see FractureCutoutDesc) iCutoutSet: the cutout set to use for fracturing (see ICutoutSet) sliceDesc: used if desc.chunkFracturingMethod = SliceFractureCutoutChunks voronoiDesc: used if desc.chunkFracturingMethod = VoronoiFractureCutoutChunks collisionDesc: convex hulls will be generated for each chunk using the method. See NxCollisionDesc. randomSeed: seed for the random number generator, to ensure reproducibility. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation cancel: if not NULL and *cancel is set to true, the root mesh will be restored to its original state, and the function will return at its earliest opportunity. Meant to be set from another thread.

returns true if successful.

ICutoutSet* FractureTools::createCutoutSet ( )

Tools for fracturing meshes. Instantiates a blank ICutoutSet

physx::IExplicitHierarchicalMesh* FractureTools::createExplicitHierarchicalMesh ( )

Instantiates an IExplicitHierarchicalMesh

physx::IExplicitHierarchicalMesh::IConvexHull* FractureTools::createExplicitHierarchicalMeshConvexHull ( )

Instantiates an IExplicitHierarchicalMesh::IConvexHull

bool FractureTools::createHierarchicallySplitMesh ( physx::IExplicitHierarchicalMesh &  hMesh,
physx::IExplicitHierarchicalMesh &  iHMeshCore,
bool  exportCoreMesh,
physx::PxI32  coreMeshImprintSubmeshIndex,
const MeshProcessingParameters &  meshProcessingParams,
const FractureSliceDesc &  desc,
const physx::NxCollisionDesc &  collisionDesc,
physx::PxU32  randomSeed,
physx::IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
)

Splits the mesh in chunk[0], forming a hierarchy of fractured meshes in chunks[1...]

hMesh: the mesh to split iHMeshCore: if this mesh is not empty, chunk 0 will be used as an indestructible "core" of the fractured mesh. That is, it will be subtracted from hMesh, and placed at level 1 of the hierarchy. The remainder of hMesh will be split as usual, creating chunks at level 1 (and possibly deeper). exportCoreMesh: if true, a core mesh chunk will be created from iHMeshCore coreMeshImprintSubmeshIndex: if this is < 0, use the core mesh materials (was applyCoreMeshMaterialToNeighborChunks). Otherwise, use the given submesh meshProcessingParams: describes generic mesh processing directives desc: describes the slicing surfaces (see FractureSliceDesc) collisionDesc: convex hulls will be generated for each chunk using the method. See NxCollisionDesc. randomSeed: seed for the random number generator, to ensure reproducibility. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation cancel: if not NULL and *cancel is set to true, the root mesh will be restored to its original state, and the function will return at its earliest opportunity. Meant to be set from another thread.

returns true if successful.

physx::PxU32 FractureTools::createScatterMeshSites ( physx::PxU8 *  meshIndices,
physx::PxMat44 *  relativeTransforms,
physx::PxU32 *  chunkMeshStarts,
physx::PxU32  scatterMeshInstancesBufferSize,
physx::IExplicitHierarchicalMesh &  hMesh,
physx::PxU32  targetChunkCount,
const physx::PxU16 *  targetChunkIndices,
physx::PxU32 *  randomSeed,
physx::PxU32  scatterMeshAssetCount,
physx::NxRenderMeshAsset **  scatterMeshAssets,
const physx::PxU32 *  minCount,
const physx::PxU32 *  maxCount,
const physx::PxF32 *  minScales,
const physx::PxF32 *  maxScales,
const physx::PxF32 *  maxAngles 
)

Creates scatter mesh sites randomly distributed on the mesh.

meshIndices: user-allocated array of size scatterMeshInstancesBufferSize which will be filled in by this function, giving the scatter mesh index used relativeTransforms: user-allocated array of size scatterMeshInstancesBufferSize which will be filled in by this function, giving the chunk-relative transform for each chunk instance chunkMeshStarts: user-allocated array which will be filled in with offsets into the meshIndices and relativeTransforms array. For a chunk indexed by i, the corresponding range [chunkMeshStart[i], chunkMeshStart[i+1]-1] in meshIndices and relativeTransforms is used. NOTE*: chunkMeshStart array must be of at least size N+1, where N is the number of chunks in the base explicit hierarchical mesh. scatterMeshInstancesBufferSize: the size of meshIndices and relativeTransforms array. scatterMeshInstancesBufferSize: the size of meshIndices and relativeTransforms array. hMesh: the mesh in which to distribute sites targetChunkCount: how many chunks are in the array targetChunkIndices targetChunkIndices: an array of chunk indices which are candidates for scatter meshes. The elements in the array chunkIndices will come from this array randomSeed: pointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded. scatterMeshAssetCount: the number of different scatter meshes (not instances). Should not exceed 255. If scatterMeshAssetCount > 255, only the first 255 will be used. scatterMeshAssets: an array of size scatterMeshAssetCount, of the render mesh assets which will be used for the scatter meshes minCount: an array of size scatterMeshAssetCount, giving the minimum number of instances to place for each mesh maxCount: an array of size scatterMeshAssetCount, giving the maximum number of instances to place for each mesh minScales: an array of size scatterMeshAssetCount, giving the minimum scale to apply to each scatter mesh maxScales: an array of size scatterMeshAssetCount, giving the maximum scale to apply to each scatter mesh maxAngles: an array of size scatterMeshAssetCount, giving a maximum deviation angle (in degrees) from the surface normal to apply to each scatter mesh

return value: the number of instances placed in indices and relativeTransforms (will not exceed scatterMeshInstancesBufferSize)

void FractureTools::createVoronoiSitesInsideMesh ( physx::IExplicitHierarchicalMesh &  hMesh,
physx::PxVec3 *  siteBuffer,
physx::PxU32  siteCount,
physx::PxU32 *  randomSeed,
physx::PxU32 *  microgridSize,
physx::IProgressListener &  progressListener,
physx::PxU32  chunkIndex = 0xFFFFFFFF 
)

Generates a set of uniformly distributed points in the interior of the root mesh.

hMesh: the mesh in which to distribute sites siteBuffer: an array of PxVec3, at least the size of siteCount siteCount: the number of points to write into siteBuffer randomSeed: pointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded. microgridSize: pointer to a grid size used for BSP creation. If NULL, the default settings will be used. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation chunkIndex: If this is a valid index, the voronoi sites will only be created within the volume of the indexed chunk. Otherwise, the sites will be created within each of the root-level chunks. Default value is an invalid index.

bool FractureTools::createVoronoiSplitMesh ( physx::IExplicitHierarchicalMesh &  hMesh,
physx::IExplicitHierarchicalMesh &  iHMeshCore,
bool  exportCoreMesh,
physx::PxI32  coreMeshImprintSubmeshIndex,
const MeshProcessingParameters &  meshProcessingParams,
const FractureVoronoiDesc &  desc,
const physx::NxCollisionDesc &  collisionDesc,
physx::PxU32  randomSeed,
physx::IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
)

Splits the mesh in chunk[0], forming fractured pieces chunks[1...] using Voronoi decomposition fracturing.

hMesh: the mesh to split iHMeshCore: if this mesh is not empty, chunk 0 will be used as an indestructible "core" of the fractured mesh. That is, it will be subtracted from hMesh, and placed at level 1 of the hierarchy. The remainder of hMesh will be split as usual, creating chunks at level 1 (and possibly deeper). exportCoreMesh: if true, a core mesh chunk will be created from iHMeshCore coreMeshImprintSubmeshIndex: if this is < 0, use the core mesh materials (was applyCoreMeshMaterialToNeighborChunks). Otherwise, use the given submesh meshProcessingParams: describes generic mesh processing directives desc: describes the voronoi splitting parameters surfaces (see FractureVoronoiDesc) collisionDesc: convex hulls will be generated for each chunk using the method. See NxCollisionDesc. randomSeed: seed for the random number generator, to ensure reproducibility. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation cancel: if not NULL and *cancel is set to true, the root mesh will be restored to its original state, and the function will return at its earliest opportunity. Meant to be set from another thread.

returns true if successful.

bool FractureTools::hierarchicallySplitChunk ( physx::IExplicitHierarchicalMesh &  hMesh,
physx::PxU32  chunkIndex,
const MeshProcessingParameters &  meshProcessingParams,
const FractureSliceDesc &  desc,
const physx::NxCollisionDesc &  collisionDesc,
physx::PxU32 *  randomSeed,
physx::IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
)

Splits the chunk in chunk[chunkIndex], forming a hierarchy of fractured chunks using slice-mode fracturing. The chunks will be rearranged so that they are in breadth-first order.

hMesh: the ExplicitHierarchicalMesh to act upon chunkIndex: index of chunk to be split meshProcessingParams: used to create a BSP for this chunk desc: describes the slicing surfaces (see FractureSliceDesc) collisionDesc: convex hulls will be generated for each chunk using the method. See NxCollisionDesc. randomSeed: pointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation cancel: if not NULL and *cancel is set to true, the root mesh will be restored to its original state, and the function will return at its earliest opportunity. Meant to be set from another thread.

returns true if successful.

void FractureTools::setBSPBuildParameters ( physx::PxF32  logAreaSigmaThreshold,
physx::PxU32  testSetSize,
physx::PxF32  splitWeight,
physx::PxF32  imbalanceWeight 
)

Set the parameters used in BSP building operations.

logAreaSigmaThreshold: At each step in the tree building process, the surface with maximum triangle area is compared to the other surface triangle areas. If the maximum area surface is far from the "typical" set of surface areas, then that surface is chosen as the next splitting plane. Otherwise, a random test set is chosen and a winner determined based upon the weightings below. The value logAreaSigmaThreshold determines how "atypical" the maximum area surface must be to be chosen in this manner. Default value = 2.0. testSetSize: Larger values of testSetSize may find better BSP trees, but will take more time to create. testSetSize = 0 is treated as infinity (all surfaces will be tested for each branch). Default value = 10. splitWeight: How much to weigh the relative number of triangle splits when searching for a BSP surface. Default value = 0.5. imbalanceWeight: How much to weigh the relative triangle imbalance when searching for a BSP surface. Default value = 0.0.

void FractureTools::setBSPTolerances ( physx::PxF32  linearTolerance,
physx::PxF32  angularTolerance,
physx::PxF32  baseTolerance,
physx::PxF32  clipTolerance,
physx::PxF32  cleaningTolerance 
)

Set the tolerances used in CSG calculations with BSPs.

linearTolerance: relative (to mesh size) tolerance used with angularTolerance to determine coplanarity. Default = 1.0e-4. angularTolerance: used with linearTolerance to determine coplanarity. Default = 1.0e-3 baseTolerance: relative (to mesh size) tolerance used for spatial partitioning clipTolerance: relative (to mesh size) tolerance used when clipping triangles for CSG mesh building operations. Default = 1.0e-4. cleaningTolerance: relative (to mesh size) tolerance used when cleaning the out put mesh generated from the toMesh() function. Default = 1.0e-7.

void FractureTools::visualizeVoronoiCells ( physx::NxApexRenderDebug &  debugRender,
const physx::PxVec3 *  sites,
physx::PxU32  siteCount,
const physx::PxU32 *  cellColors,
physx::PxU32  cellColorCount,
const physx::PxBounds3 &  bounds,
physx::PxU32  cellIndex = 0xFFFFFFFF 
)

Utility to visualize Voronoi cells for a given set of sites.

debugRender: rendering object which will receive the drawing primitives associated with this cell visualization sites: an array of Voronoi cell sites, of length siteCount siteCount: the number of Voronoi cell sites (length of sites array) cellColors: an optional array of colors (see NxApexRenderDebug for format) for the cells. If NULL, the white (0xFFFFFFFF) color will be used. If not NULL, this (of length cellColorCount) is used to color the cell graphics. The number cellColorCount need not match siteCount. If cellColorCount is less than siteCount, the cell colors will cycle. That is, site N gets cellColor[NcellColorCount]. cellColorCount: the number of cell colors (the length of cellColors array) bounds: defines an axis-aligned bounding box which clips the visualization, since some cells extend to infinity cellIndex: if this is a valid index (cellIndex < siteCount), then only the cell corresponding to sites[cellIndex] will be drawn. Otherwise, all cells will be drawn.

bool FractureTools::voronoiSplitChunk ( physx::IExplicitHierarchicalMesh &  hMesh,
physx::PxU32  chunkIndex,
const MeshProcessingParameters &  meshProcessingParams,
const FractureVoronoiDesc &  desc,
const physx::NxCollisionDesc &  collisionDesc,
physx::PxU32 *  randomSeed,
physx::IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
)

Splits the chunk in chunk[chunkIndex], forming fractured chunks using Voronoi decomposition fracturing. The chunks will be rearranged so that they are in breadth-first order.

hMesh: the ExplicitHierarchicalMesh to act upon chunkIndex: index of chunk to be split meshProcessingParams: describes generic mesh processing directives desc: describes the voronoi splitting parameters surfaces (see FractureVoronoiDesc) collisionDesc: convex hulls will be generated for each chunk using the method. See NxCollisionDesc. randomSeed: pointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded. progressListener: The user must instantiate an IProgressListener, so that this function may report progress of this operation cancel: if not NULL and *cancel is set to true, the root mesh will be restored to its original state, and the function will return at its earliest opportunity. Meant to be set from another thread.

returns true if successful.


Generated on Mon Apr 28 2014 08:01:20

Copyright © 2012-2014 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.