Public Member Functions
nvidia::apex::DestructibleAssetAuthoring Class Reference

#include <DestructibleAsset.h>

List of all members.

Public Member Functions

virtual ExplicitHierarchicalMeshgetExplicitHierarchicalMesh ()=0
virtual ExplicitHierarchicalMeshgetCoreExplicitHierarchicalMesh ()=0
virtual FractureTools::CutoutSetgetCutoutSet ()=0
virtual uint32_t partitionMeshByIslands (nvidia::ExplicitRenderTriangle *mesh, uint32_t meshTriangleCount, uint32_t *meshPartition, uint32_t meshPartitionMaxCount, float padding=0.0001f)=0
virtual bool setRootMesh (const ExplicitRenderTriangle *meshTriangles, uint32_t meshTriangleCount, const ExplicitSubmeshData *submeshData, uint32_t submeshCount, uint32_t *meshPartition=NULL, uint32_t meshPartitionCount=0, int32_t *parentIndices=NULL, uint32_t parentIndexCount=0)=0
virtual bool importRenderMeshAssetToRootMesh (const nvidia::RenderMeshAsset &renderMeshAsset, uint32_t maxRootDepth=UINT32_MAX)=0
virtual bool importDestructibleAssetToRootMesh (const nvidia::DestructibleAsset &destructibleAsset, uint32_t maxRootDepth=UINT32_MAX)=0
virtual bool setCoreMesh (const ExplicitRenderTriangle *mesh, uint32_t meshTriangleCount, const ExplicitSubmeshData *submeshData, uint32_t submeshCount, uint32_t *meshPartition=NULL, uint32_t meshPartitionCount=0)=0
virtual bool buildExplicitHierarchicalMesh (ExplicitHierarchicalMesh &hMesh, const ExplicitRenderTriangle *meshTriangles, uint32_t meshTriangleCount, const ExplicitSubmeshData *submeshData, uint32_t submeshCount, uint32_t *meshPartition=NULL, uint32_t meshPartitionCount=0, int32_t *parentIndices=NULL, uint32_t parentIndexCount=0)=0
virtual bool createHierarchicallySplitMesh (const FractureTools::MeshProcessingParameters &meshProcessingParams, const FractureTools::FractureSliceDesc &desc, const CollisionDesc &collisionDesc, bool exportCoreMesh, int32_t coreMeshImprintSubmeshIndex, uint32_t randomSeed, IProgressListener &progressListener, volatile bool *cancel=NULL)=0
virtual bool createChippedMesh (const FractureTools::MeshProcessingParameters &meshProcessingParams, const FractureTools::FractureCutoutDesc &desc, const FractureTools::CutoutSet &cutoutSet, const FractureTools::FractureSliceDesc &sliceDesc, const FractureTools::FractureVoronoiDesc &voronoiDesc, const CollisionDesc &collisionDesc, uint32_t randomSeed, IProgressListener &progressListener, volatile bool *cancel=NULL)=0
virtual void buildCutoutSet (const uint8_t *pixelBuffer, uint32_t bufferWidth, uint32_t bufferHeight, float snapThreshold, bool periodic)=0
virtual bool calculateCutoutUVMapping (PxMat33 &mapping, const nvidia::ExplicitRenderTriangle &triangle)=0
virtual bool calculateCutoutUVMapping (PxMat33 &mapping, const PxVec3 &targetDirection)=0
virtual bool createVoronoiSplitMesh (const FractureTools::MeshProcessingParameters &meshProcessingParams, const FractureTools::FractureVoronoiDesc &desc, const CollisionDesc &collisionDesc, bool exportCoreMesh, int32_t coreMeshImprintSubmeshIndex, uint32_t randomSeed, IProgressListener &progressListener, volatile bool *cancel=NULL)=0
virtual uint32_t createVoronoiSitesInsideMesh (PxVec3 *siteBuffer, uint32_t *siteChunkIndices, uint32_t siteCount, uint32_t *randomSeed, uint32_t *microgridSize, BSPOpenMode::Enum meshMode, IProgressListener &progressListener, uint32_t chunkIndex=0xFFFFFFFF)=0
virtual uint32_t createScatterMeshSites (uint8_t *meshIndices, PxMat44 *relativeTransforms, uint32_t *chunkMeshStarts, uint32_t scatterMeshInstancesBufferSize, uint32_t targetChunkCount, const uint16_t *targetChunkIndices, uint32_t *randomSeed, uint32_t scatterMeshAssetCount, nvidia::RenderMeshAsset **scatterMeshAssets, const uint32_t *minCount, const uint32_t *maxCount, const float *minScales, const float *maxScales, const float *maxAngles)=0
virtual void visualizeVoronoiCells (nvidia::RenderDebugInterface &debugRender, const PxVec3 *sites, uint32_t siteCount, const uint32_t *cellColors, uint32_t cellColorCount, const PxBounds3 &bounds, uint32_t cellIndex=0xFFFFFFFF)=0
virtual bool hierarchicallySplitChunk (uint32_t chunkIndex, const FractureTools::MeshProcessingParameters &meshProcessingParams, const FractureTools::FractureSliceDesc &desc, const CollisionDesc &collisionDesc, uint32_t *randomSeed, IProgressListener &progressListener, volatile bool *cancel=NULL)=0
virtual bool voronoiSplitChunk (uint32_t chunkIndex, const FractureTools::MeshProcessingParameters &meshProcessingParams, const FractureTools::FractureVoronoiDesc &desc, const CollisionDesc &collisionDesc, uint32_t *randomSeed, IProgressListener &progressListener, volatile bool *cancel=NULL)=0
virtual void setBSPTolerances (float linearTolerance, float angularTolerance, float baseTolerance, float clipTolerance, float cleaningTolerance)=0
virtual void setBSPBuildParameters (float logAreaSigmaThreshold, uint32_t testSetSize, float splitWeight, float imbalanceWeight)=0
virtual
ExplicitHierarchicalMesh::ConvexHull
createExplicitHierarchicalMeshConvexHull ()=0
virtual uint32_t buildSliceMesh (const ExplicitRenderTriangle *&mesh, const FractureTools::NoiseParameters &noiseParameters, const PxPlane &slicePlane, uint32_t randomSeed)=0
virtual void serializeFractureToolState (PxFileBuf &stream, nvidia::ExplicitHierarchicalMesh::Embedding &embedding) const =0
virtual void deserializeFractureToolState (PxFileBuf &stream, nvidia::ExplicitHierarchicalMesh::Embedding &embedding)=0
virtual void setChunkOverlapsCacheDepth (int32_t depth=-1)=0
virtual const RenderMeshAsset * getRenderMeshAsset () const =0
virtual bool setRenderMeshAsset (RenderMeshAsset *)=0
virtual bool setScatterMeshAssets (RenderMeshAsset **scatterMeshAssetArray, uint32_t scatterMeshAssetArraySize)=0
virtual uint32_t getScatterMeshAssetCount () const =0
virtual RenderMeshAsset *const getScatterMeshAssets () const =0
virtual uint32_t getInstancedChunkMeshCount () const =0
virtual void setDestructibleParameters (const DestructibleParameters &)=0
virtual DestructibleParameters getDestructibleParameters () const =0
virtual void setDestructibleInitParameters (const DestructibleInitParameters &)=0
virtual DestructibleInitParameters getDestructibleInitParameters () const =0
virtual void setCrumbleEmitterName (const char *)=0
virtual void setDustEmitterName (const char *)=0
virtual void setFracturePatternName (const char *)=0
virtual void setNeighborPadding (float neighborPadding)=0
virtual float getNeighborPadding () const =0
virtual void cookChunks (const DestructibleAssetCookingDesc &cookingDesc, bool cacheOverlaps=true, uint32_t *chunkIndexMapUser2Apex=NULL, uint32_t *chunkIndexMapApex2User=NULL, uint32_t chunkIndexMapCount=0)=0
virtual float getFractureImpulseScale () const =0
virtual float getImpactVelocityThreshold () const =0
virtual uint32_t getChunkCount () const =0
virtual uint32_t getDepthCount () const =0
virtual uint32_t getChunkChildCount (uint32_t chunkIndex) const =0
virtual int32_t getChunkChild (uint32_t chunkIndex, uint32_t childIndex) const =0
virtual PxVec3 getChunkPositionOffset (uint32_t chunkIndex) const =0
virtual PxVec2 getChunkUVOffset (uint32_t chunkIndex) const =0
virtual uint32_t getPartIndex (uint32_t chunkIndex) const =0
virtual void trimCollisionGeometry (const uint32_t *partIndices, uint32_t partIndexCount, float maxTrimFraction=0.2f)=0
virtual void getStats (DestructibleAssetStats &stats) const =0
virtual void cacheChunkOverlapsUpToDepth (int32_t depth=-1)=0
virtual void clearChunkOverlaps (int32_t depth=-1, bool keepCachedFlag=false)=0
virtual void addChunkOverlaps (IntPair *supportGraphEdges, uint32_t numSupportGraphEdges)=0
virtual void removeChunkOverlaps (IntPair *supportGraphEdges, uint32_t numSupportGraphEdges, bool keepCachedFlagIfEmpty)=0
virtual uint32_t getCachedOverlapCountAtDepth (uint32_t depth)=0
virtual const IntPair * getCachedOverlapsAtDepth (uint32_t depth)=0
virtual void applyTransformation (const PxMat44 &transformation, float scale)=0
 Apply a transformation to destructible asset.
virtual void applyTransformation (const PxMat44 &transformation)=0
 Apply an arbitrary affine transformation to destructible asset.
virtual bool setPlatformMaxDepth (PlatformTag platform, uint32_t maxDepth)=0
 Set a maximum fracture depth for a given platform string.
virtual bool removePlatformMaxDepth (PlatformTag platform)=0
 Removes the maximum fracture depth limit for a given platform string.
virtual uint32_t getActorTransformCount () const =0
 Returns the size of the actor transform array. See getActorTransforms() for a description of this data.
virtual const PxMat44 * getActorTransforms () const =0
 Returns the head of the actor transform array. This list is a convenience for placing actors in a level from poses authored in a level editor. The transforms may contain scaling.
virtual void appendActorTransforms (const PxMat44 *transforms, uint32_t transformCount)=0
 Append transforms to the actor transform list. See getActorTransforms() for a description of this data.
virtual void clearActorTransforms ()=0
 Clear the actor transform array. See getActorTransforms() for a description of this data.

Detailed Description

Authoring API for a destructible asset.


Member Function Documentation

virtual void nvidia::apex::DestructibleAssetAuthoring::addChunkOverlaps ( IntPair *  supportGraphEdges,
uint32_t  numSupportGraphEdges 
) [pure virtual]

Adds edges to the support graph. Edges must connect chunks of equal depth. The indices refer to the reordered chunk array, a mapping is provided in cookChunks.

virtual void nvidia::apex::DestructibleAssetAuthoring::appendActorTransforms ( const PxMat44 *  transforms,
uint32_t  transformCount 
) [pure virtual]

Append transforms to the actor transform list. See getActorTransforms() for a description of this data.

Parameters:
transformsHead of an array of transforms
transformCountSize of transforms
virtual void nvidia::apex::DestructibleAssetAuthoring::applyTransformation ( const PxMat44 &  transformation,
float  scale 
) [pure virtual]

Apply a transformation to destructible asset.

This is a permanent transformation and it changes the object state. Should only be called immediately before serialization and without further modifying the object later on.

Parameters:
transformationThis matrix is allowed to contain a translation and a rotation
scaleApply a uniform scaling as well
virtual void nvidia::apex::DestructibleAssetAuthoring::applyTransformation ( const PxMat44 &  transformation) [pure virtual]

Apply an arbitrary affine transformation to destructible asset.

This is a permanent transformation and it changes the object state. Should only be called immediately before serialization and without further modifying the object later on.

Parameters:
transformationThis matrix is allowed to contain translation, rotation, scale and skew
virtual void nvidia::apex::DestructibleAssetAuthoring::buildCutoutSet ( const uint8_t *  pixelBuffer,
uint32_t  bufferWidth,
uint32_t  bufferHeight,
float  snapThreshold,
bool  periodic 
) [pure virtual]

Builds an internal cutout set.

Parameters:
pixelBufferpointer to be beginning of the pixel buffer
bufferWidththe width of the buffer in pixels
bufferHeightthe height of the buffer in pixels
snapThresholdthe pixel distance at which neighboring cutout vertices and segments may be fudged into alignment.
periodicwhether or not to use periodic boundary conditions when creating cutouts from the map
virtual bool nvidia::apex::DestructibleAssetAuthoring::buildExplicitHierarchicalMesh ( ExplicitHierarchicalMesh hMesh,
const ExplicitRenderTriangle *  meshTriangles,
uint32_t  meshTriangleCount,
const ExplicitSubmeshData submeshData,
uint32_t  submeshCount,
uint32_t *  meshPartition = NULL,
uint32_t  meshPartitionCount = 0,
int32_t *  parentIndices = NULL,
uint32_t  parentIndexCount = 0 
) [pure virtual]

Builds a new ExplicitHierarchicalMesh from an array of triangles, externally provided by the user. Note: setRootMesh and setCoreMesh may be implemented as follows: setRootMesh(x) <-> buildExplicitHierarchicalMesh( getExplicitHierarchicalMesh(), x) setCoreMesh(x) <-> buildExplicitHierarchicalMesh( getCoreExplicitHierarchicalMesh(), x)

Parameters:
hMeshnew ExplicitHierarchicalMesh
meshTrianglespointer to array of ExplicitRenderTriangles which make up the mesh
meshTriangleCountthe size of the meshTriangles array
submeshDatapointer to array of ExplicitSubmeshData, describing the submeshes
submeshCountthe size of the submeshData array
meshPartitionif 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, while the union of the parts will be the level 0 part.
meshPartitionCountif meshPartition is not NULL, this is the size of the meshPartition array.
parentIndicesif not NULL, the parent indices for each chunk (corresponding to a partition in the mesh partition).
parentIndexCountthe size of the parentIndices array. This does not need to match meshPartitionCount. If a mesh partition has an index beyond the end of parentIndices, then the parentIndex is considered to be 0. Therefore, if parentIndexCount = 0, all parents are 0 and so all chunks created will be depth 1. This will cause a depth 0 chunk to be created that is the aggregate of the depth 1 chunks. If parentIndexCount > 0, then the depth-0 chunk must have a parentIndex of -1. To reproduce the effect of the old parameter 'firstPartitionIsDepthZero' = true, set parentIndices to the address of a int32_t containing the value -1, and set parentIndexCount = 1. To reproduce the effect of the old parameter 'firstPartitionIsDepthZero' = false, set parentIndexCount = 0. Note: if parent indices are given, the first one must be -1, and *only* that index may be negative. That is, there may be only one depth-0 mesh and it must be the first mesh.
virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::buildSliceMesh ( const ExplicitRenderTriangle *&  mesh,
const FractureTools::NoiseParameters noiseParameters,
const PxPlane &  slicePlane,
uint32_t  randomSeed 
) [pure virtual]

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.

Returns:
Returns the head of an array of ExplicitRenderTriangles, of length given by the return value.
virtual void nvidia::apex::DestructibleAssetAuthoring::cacheChunkOverlapsUpToDepth ( int32_t  depth = -1) [pure virtual]

Ensures that the asset has chunk overlap information cached up to the given depth. If depth < 0 (as it is by default), the depth will be taken to be the supportDepth given in the asset's destructibleParameters. It is ok to pass in a depth greater than any chunk depth in the asset.

virtual bool nvidia::apex::DestructibleAssetAuthoring::calculateCutoutUVMapping ( PxMat33 &  mapping,
const nvidia::ExplicitRenderTriangle &  triangle 
) [pure virtual]

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)

Parameters:
mappingresulted mapping, composed by an affine transformation and a rotation
triangletriangle
virtual bool nvidia::apex::DestructibleAssetAuthoring::calculateCutoutUVMapping ( PxMat33 &  mapping,
const PxVec3 &  targetDirection 
) [pure virtual]

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.

Parameters:
mappingresulted mapping, composed by an affine transformation and a rotation
targetDirection,:the target face's normal
virtual void nvidia::apex::DestructibleAssetAuthoring::clearActorTransforms ( ) [pure virtual]

Clear the actor transform array. See getActorTransforms() for a description of this data.

virtual void nvidia::apex::DestructibleAssetAuthoring::clearChunkOverlaps ( int32_t  depth = -1,
bool  keepCachedFlag = false 
) [pure virtual]

Clears the chunk overlap cache.

Parameters:
depthDepth to be cleared. -1 for all depths.
keepCachedFlagIf the flag is set, the depth is considered to be cached even if the overlaps list is empty.
virtual void nvidia::apex::DestructibleAssetAuthoring::cookChunks ( const DestructibleAssetCookingDesc cookingDesc,
bool  cacheOverlaps = true,
uint32_t *  chunkIndexMapUser2Apex = NULL,
uint32_t *  chunkIndexMapApex2User = NULL,
uint32_t  chunkIndexMapCount = 0 
) [pure virtual]

Once the internal ExplicitHierarchicalMesh is built using the fracture tools functions and all emitter names and parameters set, this functions builds the destructible asset. Every chunk (corresponding to a part in the ExplicitHierarchicalMesh) must have destruction-specific data set through the descriptor passed into this function. See DestructibleAssetCookingDesc.

Parameters:
cookingDesccooking setup
cacheOverlapswhether the chunk overlaps up to chunkOverlapCacheDepth should be cached in this call
chunkIndexMapUser2Apexoptional user provided uint32_t array that will contains the mapping from user chunk indices (referring to chunks in cookingDesc) to Apex internal chunk indices (referring to chunk is internal chunk array)
chunkIndexMapApex2Usersame as chunkIndexMapUser2Apex, but opposite direction
chunkIndexMapCountsize of the user provided mapping arrays
virtual bool nvidia::apex::DestructibleAssetAuthoring::createChippedMesh ( const FractureTools::MeshProcessingParameters meshProcessingParams,
const FractureTools::FractureCutoutDesc desc,
const FractureTools::CutoutSet cutoutSet,
const FractureTools::FractureSliceDesc sliceDesc,
const FractureTools::FractureVoronoiDesc voronoiDesc,
const CollisionDesc collisionDesc,
uint32_t  randomSeed,
IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
) [pure virtual]

Splits the mesh in chunk[0], forming a hierarchy of fractured meshes in chunks[1...] using cutout-mode (chippable) fracturing.

Parameters:
meshProcessingParamsdescribes generic mesh processing directives
descdescribes the slicing surfaces (see FractureCutoutDesc)
cutoutSetthe cutout set to use for fracturing (see CutoutSet)
sliceDescused if desc.chunkFracturingMethod = SliceFractureCutoutChunks
voronoiDescused if desc.chunkFracturingMethod = VoronoiFractureCutoutChunks
collisionDescconvex hulls will be generated for each chunk using the method See CollisionDesc.
randomSeedseed for the random number generator, to ensure reproducibility.
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
cancelif 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:
returns true if successful.
virtual ExplicitHierarchicalMesh::ConvexHull* nvidia::apex::DestructibleAssetAuthoring::createExplicitHierarchicalMeshConvexHull ( ) [pure virtual]

Instantiates an ExplicitHierarchicalMesh::ConvexHull

See the ConvexHull API for its functionality. Can be used to author chunk hulls in the cookChunks function.

Use ConvexHull::release() to delete the object.

virtual bool nvidia::apex::DestructibleAssetAuthoring::createHierarchicallySplitMesh ( const FractureTools::MeshProcessingParameters meshProcessingParams,
const FractureTools::FractureSliceDesc desc,
const CollisionDesc collisionDesc,
bool  exportCoreMesh,
int32_t  coreMeshImprintSubmeshIndex,
uint32_t  randomSeed,
IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
) [pure virtual]

Splits the chunk in chunk[0], forming a hierarchy of fractured chunks in chunks[1...] using slice-mode fracturing.

Parameters:
meshProcessingParamsdescribes generic mesh processing directives
descdescribes the slicing surfaces (see FractureSliceDesc)
collisionDescconvex hulls will be generated for each chunk using the method See CollisionDesc.
exportCoreMeshif true, the core mesh will be included (at depth 1) in the hierarchically split mesh. Otherwise, it will only be used to create a hollow space.
coreMeshImprintSubmeshIndexif this is < 0, use the core mesh materials (was applyCoreMeshMaterialToNeighborChunks). Otherwise, use the given submesh
randomSeedseed for the random number generator, to ensure reproducibility.
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
cancelif 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:
returns true if successful.
virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::createScatterMeshSites ( uint8_t *  meshIndices,
PxMat44 *  relativeTransforms,
uint32_t *  chunkMeshStarts,
uint32_t  scatterMeshInstancesBufferSize,
uint32_t  targetChunkCount,
const uint16_t *  targetChunkIndices,
uint32_t *  randomSeed,
uint32_t  scatterMeshAssetCount,
nvidia::RenderMeshAsset **  scatterMeshAssets,
const uint32_t *  minCount,
const uint32_t *  maxCount,
const float *  minScales,
const float *  maxScales,
const float *  maxAngles 
) [pure virtual]

Creates scatter mesh sites randomly distributed on the mesh.

Parameters:
meshIndicesuser-allocated array of size scatterMeshInstancesBufferSize which will be filled in by this function, giving the scatter mesh index used
relativeTransformsuser-allocated array of size scatterMeshInstancesBufferSize which will be filled in by this function, giving the chunk-relative transform for each chunk instance
chunkMeshStartsuser-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.
scatterMeshInstancesBufferSizethe size of meshIndices and relativeTransforms array.
targetChunkCounthow many chunks are in the array targetChunkIndices
targetChunkIndicesan array of chunk indices which are candidates for scatter meshes. The elements in the array chunkIndices will come from this array
randomSeedpointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded.
scatterMeshAssetCountthe number of different scatter meshes (not instances). Should not exceed 255. If scatterMeshAssetCount > 255, only the first 255 will be used.
scatterMeshAssetsan array of size scatterMeshAssetCount, of the render mesh assets which will be used for the scatter meshes
minCountan array of size scatterMeshAssetCount, giving the minimum number of instances to place for each mesh
maxCountan array of size scatterMeshAssetCount, giving the maximum number of instances to place for each mesh
minScalesan array of size scatterMeshAssetCount, giving the minimum scale to apply to each scatter mesh
maxScalesan array of size scatterMeshAssetCount, giving the maximum scale to apply to each scatter mesh
maxAnglesan array of size scatterMeshAssetCount, giving a maximum deviation angle (in degrees) from the surface normal to apply to each scatter mesh
Returns:
return value: the number of instances placed in indices and relativeTransforms (will not exceed scatterMeshInstancesBufferSize)
virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::createVoronoiSitesInsideMesh ( PxVec3 *  siteBuffer,
uint32_t *  siteChunkIndices,
uint32_t  siteCount,
uint32_t *  randomSeed,
uint32_t *  microgridSize,
BSPOpenMode::Enum  meshMode,
IProgressListener &  progressListener,
uint32_t  chunkIndex = 0xFFFFFFFF 
) [pure virtual]

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

Parameters:
siteBufferAn array of PxVec3, at least the size of siteCount.
siteChunkIndicesIf not NULL, it must be at least the size of siteCount. siteCount indices will be written to this buffer, associating each site with a chunk that contains it.
siteCountThe number of points to write into siteBuffer.
randomSeedPointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded.
microgridSizePointer to a grid size used for BSP creation. If NULL, the default settings will be used.
meshModeOpen mesh handling. Modes: Automatic, Closed, Open (see BSPOpenMode)
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
chunkIndexIf 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.
Returns:
Returns the number of sites actually created (written to siteBuffer and siteChunkIndices). This may be less than the number of sites requested if site placement fails.
virtual bool nvidia::apex::DestructibleAssetAuthoring::createVoronoiSplitMesh ( const FractureTools::MeshProcessingParameters meshProcessingParams,
const FractureTools::FractureVoronoiDesc desc,
const CollisionDesc collisionDesc,
bool  exportCoreMesh,
int32_t  coreMeshImprintSubmeshIndex,
uint32_t  randomSeed,
IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
) [pure virtual]

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

Parameters:
meshProcessingParamsdescribes generic mesh processing directives
descdescribes the voronoi splitting parameters surfaces (see FractureVoronoiDesc)
collisionDescconvex hulls will be generated for each chunk using the method See CollisionDesc.
exportCoreMeshif true, the core mesh will be included (at depth 1) in the split mesh. Otherwise, it will only be used to create a hollow space.
coreMeshImprintSubmeshIndexif this is < 0, use the core mesh materials (was applyCoreMeshMaterialToNeighborChunks). Otherwise, use the given submesh
randomSeedseed for the random number generator, to ensure reproducibility.
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
cancelif 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:
returns true if successful.
virtual void nvidia::apex::DestructibleAssetAuthoring::deserializeFractureToolState ( PxFileBuf &  stream,
nvidia::ExplicitHierarchicalMesh::Embedding &  embedding 
) [pure virtual]

Deserialization of the data associated with the fracture API. This includes the root mesh, core mesh, and cutout set.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getActorTransformCount ( ) const [pure virtual]

Returns the size of the actor transform array. See getActorTransforms() for a description of this data.

virtual const PxMat44* nvidia::apex::DestructibleAssetAuthoring::getActorTransforms ( ) const [pure virtual]

Returns the head of the actor transform array. This list is a convenience for placing actors in a level from poses authored in a level editor. The transforms may contain scaling.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getCachedOverlapCountAtDepth ( uint32_t  depth) [pure virtual]

The size of the array returned by getCachedOverlapsAtDepth(depth) (see below). Note: this function will not trigger overlap caching for the given depth. If no overlaps have been calculated for the depth given, this function returns NULL.

virtual const IntPair* nvidia::apex::DestructibleAssetAuthoring::getCachedOverlapsAtDepth ( uint32_t  depth) [pure virtual]

Array of integer pairs, indexing chunk pairs which touch at a given depth in the heirarcy. The size of the array is given by getCachedOverlapCountAtDepth(depth). Note: this function will not trigger overlap caching for the given depth. If no overlaps have been calculated for the depth given, this function returns NULL.

virtual int32_t nvidia::apex::DestructibleAssetAuthoring::getChunkChild ( uint32_t  chunkIndex,
uint32_t  childIndex 
) const [pure virtual]

Returns the index for the given child of the given chunk. chunkIndex must be less than getChunkCount() and childIndex must be less than getChunkChildCount(chunkIndex). If either of these conditions is not met, the function returns ModuleDestructibleConst::INVALID_CHUNK_INDEX.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getChunkChildCount ( uint32_t  chunkIndex) const [pure virtual]

Returns the number of children for the given chunk. chunkIndex must be less than getChunkCount(). If it is not, this function returns 0.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getChunkCount ( ) const [pure virtual]

The total number of chunks in the cooked asset.

virtual PxVec3 nvidia::apex::DestructibleAssetAuthoring::getChunkPositionOffset ( uint32_t  chunkIndex) const [pure virtual]

If this chunk is instanced within the same asset, then this provides the instancing position offset. Otherwise, this function returns (0,0,0).

virtual PxVec2 nvidia::apex::DestructibleAssetAuthoring::getChunkUVOffset ( uint32_t  chunkIndex) const [pure virtual]

If this chunk is instanced within the same asset, then this provides the instancing UV offset. Otherwise, this function returns (0,0).

virtual ExplicitHierarchicalMesh& nvidia::apex::DestructibleAssetAuthoring::getCoreExplicitHierarchicalMesh ( ) [pure virtual]

DestructibleAssetAuthoring contains a second instantiation of ExplicitHierarchicalMesh used to describe the core mesh for slice fracturing (see FractureTools::FractureSliceDesc), done in createHierarchicallySplitMesh(). This function gives access to it.

virtual FractureTools::CutoutSet& nvidia::apex::DestructibleAssetAuthoring::getCutoutSet ( ) [pure virtual]

DestructibleAssetAuthoring contains an instantiation of CutoutSet used to describe the cutout fracturing shapes (see FractureTools::CutoutSet), done in createChippedMesh(). This function gives access to it.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getDepthCount ( ) const [pure virtual]

The total number of fracture hierarchy depth levels in the cooked asset.

virtual DestructibleInitParameters nvidia::apex::DestructibleAssetAuthoring::getDestructibleInitParameters ( ) const [pure virtual]

The parameters used for default destructible initialization. See DestructibleInitParameters.

virtual DestructibleParameters nvidia::apex::DestructibleAssetAuthoring::getDestructibleParameters ( ) const [pure virtual]

The DestructibleParameters which describe the default fracturing behavior for instanced DestructibleActors. These may be overridden by calling setDestructibleParameters().

virtual ExplicitHierarchicalMesh& nvidia::apex::DestructibleAssetAuthoring::getExplicitHierarchicalMesh ( ) [pure virtual]

Fracturing API DestructibleAssetAuthoring contains an instantiation of ExplicitHierarchicalMesh. This function gives access to it. See ExplicitHierarchicalMesh for details, it is the object used by the fracturing tool set for mesh fracturing operations and is used to generate the embedded RenderMesh as well as collision and hierarchy data for the destructible asset.

virtual float nvidia::apex::DestructibleAssetAuthoring::getFractureImpulseScale ( ) const [pure virtual]

The scale factor used to apply an impulse force along the normal of chunk when fractured. This is used in order to "push" the pieces out as they fracture.

virtual float nvidia::apex::DestructibleAssetAuthoring::getImpactVelocityThreshold ( ) const [pure virtual]

Large impact force may be reported if rigid bodies are spawned inside one another. In this case the realative velocity of the two objects will be low. This variable allows the user to set a minimum velocity threshold for impacts to ensure that the objects are moving at a min velocity in order for the impact force to be considered.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getInstancedChunkMeshCount ( ) const [pure virtual]

Get the number of instanced chunk meshes in this asset.

virtual float nvidia::apex::DestructibleAssetAuthoring::getNeighborPadding ( ) const [pure virtual]

Get padding used for chunk neighbor tests. Set setNeighborPadding().

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getPartIndex ( uint32_t  chunkIndex) const [pure virtual]

The render mesh asset part index associated with this chunk.

virtual const RenderMeshAsset* nvidia::apex::DestructibleAssetAuthoring::getRenderMeshAsset ( ) const [pure virtual]

Gets the RenderMeshAsset associated with this asset.

virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::getScatterMeshAssetCount ( ) const [pure virtual]

Retrieve the number of scatter mesh assets

virtual RenderMeshAsset* const nvidia::apex::DestructibleAssetAuthoring::getScatterMeshAssets ( ) const [pure virtual]

Retrieve the scatter mesh asset array

virtual void nvidia::apex::DestructibleAssetAuthoring::getStats ( DestructibleAssetStats stats) const [pure virtual]

Returns stats (sizes, counts) for the asset. See DestructibleAssetStats.

virtual bool nvidia::apex::DestructibleAssetAuthoring::hierarchicallySplitChunk ( uint32_t  chunkIndex,
const FractureTools::MeshProcessingParameters meshProcessingParams,
const FractureTools::FractureSliceDesc desc,
const CollisionDesc collisionDesc,
uint32_t *  randomSeed,
IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
) [pure virtual]

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.

Parameters:
chunkIndexindex of chunk to be split
meshProcessingParamsdescribes generic mesh processing directives
descdescribes the slicing surfaces (see FractureSliceDesc)
collisionDescconvex hulls will be generated for each chunk using the method. See CollisionDesc.
randomSeedpointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded.
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
cancelif 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:
returns true if successful.
virtual bool nvidia::apex::DestructibleAssetAuthoring::importDestructibleAssetToRootMesh ( const nvidia::DestructibleAsset &  destructibleAsset,
uint32_t  maxRootDepth = UINT32_MAX 
) [pure virtual]

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

Parameters:
destructibleAssetthe asset to import
maxRootDepthcap the root depth at this value. Re-fracturing of the mesh will occur at this depth. Default = UINT32_MAX
virtual bool nvidia::apex::DestructibleAssetAuthoring::importRenderMeshAssetToRootMesh ( const nvidia::RenderMeshAsset &  renderMeshAsset,
uint32_t  maxRootDepth = UINT32_MAX 
) [pure virtual]

Builds the root ExplicitHierarchicalMesh from an RenderMeshAsset. Since an DestructibleAsset contains no hierarchy information, the input mesh must have only one part.

Parameters:
renderMeshAssetthe asset to import
maxRootDepthcap the root depth at this value. Re-fracturing of the mesh will occur at this depth. Default = UINT32_MAX
virtual uint32_t nvidia::apex::DestructibleAssetAuthoring::partitionMeshByIslands ( nvidia::ExplicitRenderTriangle *  mesh,
uint32_t  meshTriangleCount,
uint32_t *  meshPartition,
uint32_t  meshPartitionMaxCount,
float  padding = 0.0001f 
) [pure virtual]

Partitions (and possibly re-orders) the mesh array if the triangles form disjoint islands.

Parameters:
meshpointer to array of ExplicitRenderTriangles which make up the mesh
meshTriangleCountthe size of the meshTriangles array
meshPartitionuser-allocated array for mesh partition, will be filled with the end elements of contiguous subsets of meshTriangles.
meshPartitionMaxCountsize of user-allocated meshPartitionArray
paddingrelative value multiplied by the mesh bounding box. padding gets added to the triangle bounds when calculating triangle neighbors.
Returns:
Returns the number of partitions. The value may be larger than meshPartitionMaxCount. In that case, the partitions beyond meshPartitionMaxCount are not recorded.
virtual void nvidia::apex::DestructibleAssetAuthoring::removeChunkOverlaps ( IntPair *  supportGraphEdges,
uint32_t  numSupportGraphEdges,
bool  keepCachedFlagIfEmpty 
) [pure virtual]

Removes edges from support graph. The indices refer to the reordered chunk array, a mapping is provided in cookChunks.

Parameters:
supportGraphEdgesInteger pairs representing indices to chunks that are linked
numSupportGraphEdgesNumber of provided integer pairs.
keepCachedFlagIfEmptyIf the flag is set, the depth is considered to be cached even if the overlaps list is empty.
virtual bool nvidia::apex::DestructibleAssetAuthoring::removePlatformMaxDepth ( PlatformTag  platform) [pure virtual]

Removes the maximum fracture depth limit for a given platform string.

Returns true if the platform's maximum fracture depth was previously set and now removed

virtual void nvidia::apex::DestructibleAssetAuthoring::serializeFractureToolState ( PxFileBuf &  stream,
nvidia::ExplicitHierarchicalMesh::Embedding &  embedding 
) const [pure virtual]

Serialization of the data associated with the fracture API. This includes the root mesh, core mesh, and cutout set.

virtual void nvidia::apex::DestructibleAssetAuthoring::setBSPBuildParameters ( float  logAreaSigmaThreshold,
uint32_t  testSetSize,
float  splitWeight,
float  imbalanceWeight 
) [pure virtual]

Set the parameters used in BSP building operations.

Parameters:
logAreaSigmaThresholdAt 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.
testSetSizeLarger 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.
splitWeightHow much to weigh the relative number of triangle splits when searching for a BSP surface. Default value = 0.5.
imbalanceWeightHow much to weigh the relative triangle imbalance when searching for a BSP surface. Default value = 0.0.
virtual void nvidia::apex::DestructibleAssetAuthoring::setBSPTolerances ( float  linearTolerance,
float  angularTolerance,
float  baseTolerance,
float  clipTolerance,
float  cleaningTolerance 
) [pure virtual]

Set the tolerances used in CSG calculations.

Parameters:
linearTolerancerelative (to mesh size) tolerance used with angularTolerance to determine coplanarity. Default = 1.0e-4.
angularToleranceused with linearTolerance to determine coplanarity. Default = 1.0e-3
baseTolerancerelative (to mesh size) tolerance used for spatial partitioning
clipTolerancerelative (to mesh size) tolerance used when clipping triangles for CSG mesh building operations. Default = 1.0e-4.
cleaningTolerancerelative (to mesh size) tolerance used when cleaning the out put mesh generated from the toMesh() function. Default = 1.0e-7.
virtual void nvidia::apex::DestructibleAssetAuthoring::setChunkOverlapsCacheDepth ( int32_t  depth = -1) [pure virtual]

Set current depth for chunk overlaps calculations.

virtual bool nvidia::apex::DestructibleAssetAuthoring::setCoreMesh ( const ExplicitRenderTriangle *  mesh,
uint32_t  meshTriangleCount,
const ExplicitSubmeshData submeshData,
uint32_t  submeshCount,
uint32_t *  meshPartition = NULL,
uint32_t  meshPartitionCount = 0 
) [pure virtual]

Builds a new ExplicitHierarchicalMesh from an array of triangles, used as the core mesh for slice fracture operations (see FractureTools::FractureSliceDesc, passed into createHierarchicallySplitMesh).

Parameters:
meshpointer to array of ExplicitRenderTriangles which make up the mesh
meshTriangleCountthe size of the meshTriangles array
submeshDatapointer to array of ExplicitSubmeshData, describing the submeshes
submeshCountthe size of the submeshData array
meshPartitionmeshPartition array
meshPartitionCountmeshPartition array size
virtual void nvidia::apex::DestructibleAssetAuthoring::setCrumbleEmitterName ( const char *  ) [pure virtual]

Set the name of the emitter to use when generating crumble particles.

virtual void nvidia::apex::DestructibleAssetAuthoring::setDestructibleInitParameters ( const DestructibleInitParameters ) [pure virtual]

Set the parameters used for default destructible initialization. See DestructibleInitParameters.

virtual void nvidia::apex::DestructibleAssetAuthoring::setDestructibleParameters ( const DestructibleParameters ) [pure virtual]

Set the parameters used for runtime destruction behavior. See DestructibleParameters.

virtual void nvidia::apex::DestructibleAssetAuthoring::setDustEmitterName ( const char *  ) [pure virtual]

Set the name of the emitter to use when generating fracture-line dust particles.

virtual void nvidia::apex::DestructibleAssetAuthoring::setFracturePatternName ( const char *  ) [pure virtual]

Set the name of the fracture pattern to use when runtime fracture is enabled.

virtual void nvidia::apex::DestructibleAssetAuthoring::setNeighborPadding ( float  neighborPadding) [pure virtual]

Set padding used for chunk neighbor tests. This padding is relative to the largest diagonal of the asset's local bounding box. This value must be non-negative. Default value = 0.001f.

virtual bool nvidia::apex::DestructibleAssetAuthoring::setPlatformMaxDepth ( PlatformTag  platform,
uint32_t  maxDepth 
) [pure virtual]

Set a maximum fracture depth for a given platform string.

Returns true if the supplied maxDepth is lesser than the number of chunk depth levels for this asset

virtual bool nvidia::apex::DestructibleAssetAuthoring::setRenderMeshAsset ( RenderMeshAsset *  ) [pure virtual]

Set the RenderMeshAsset associated with this asset. This is the asset used for non-instanced rendering. NULL is a valid argument, and can be used to clear the internal mesh data.

Returns:
Returns true if successful.
virtual bool nvidia::apex::DestructibleAssetAuthoring::setRootMesh ( const ExplicitRenderTriangle *  meshTriangles,
uint32_t  meshTriangleCount,
const ExplicitSubmeshData submeshData,
uint32_t  submeshCount,
uint32_t *  meshPartition = NULL,
uint32_t  meshPartitionCount = 0,
int32_t *  parentIndices = NULL,
uint32_t  parentIndexCount = 0 
) [pure virtual]

Builds a new ExplicitHierarchicalMesh from an array of triangles, used as the starting point for fracturing. It will contain only one chunk, at depth 0.

Parameters:
meshTrianglespointer to array of ExplicitRenderTriangles which make up the mesh
meshTriangleCountthe size of the meshTriangles array
submeshDatapointer to array of ExplicitSubmeshData, describing the submeshes
submeshCountthe size of the submeshData array
meshPartitionif 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, the behavior is determined by firstPartitionIsDepthZero (see below).
meshPartitionCountif meshPartition is not NULL, this is the size of the meshPartition array.
parentIndicesif not NULL, the parent indices for each chunk (corresponding to a partition in the mesh partition).
parentIndexCountthe size of the parentIndices array. This does not need to match meshPartitionCount. If a mesh partition has an index beyond the end of parentIndices, then the parentIndex is considered to be 0. Therefore, if parentIndexCount = 0, all parents are 0 and so all chunks created will be depth 1. This will cause a depth 0 chunk to be created that is the aggregate of the depth 1 chunks. If parentIndexCount > 0, then the depth-0 chunk must have a parentIndex of -1. To reproduce the effect of the old parameter 'firstPartitionIsDepthZero' = true, set parentIndices to the address of a int32_t containing the value -1, and set parentIndexCount = 1. To reproduce the effect of the old parameter 'firstPartitionIsDepthZero' = false, set parentIndexCount = 0. Note: if parent indices are given, the first one must be -1, and *only* that index may be negative. That is, there may be only one depth-0 mesh and it must be the first mesh.
virtual bool nvidia::apex::DestructibleAssetAuthoring::setScatterMeshAssets ( RenderMeshAsset **  scatterMeshAssetArray,
uint32_t  scatterMeshAssetArraySize 
) [pure virtual]

Set the RenderMeshAssets used for scatter mesh rendering associated with this asset. These assets will be rendered using instanced rendering. The array cannot contain NULL elements, if an array size greater than zero is specified.

Returns:
Returns true if successful.
virtual void nvidia::apex::DestructibleAssetAuthoring::trimCollisionGeometry ( const uint32_t *  partIndices,
uint32_t  partIndexCount,
float  maxTrimFraction = 0.2f 
) [pure virtual]

Trim collision geometry to prevent explosive behavior. maxTrimFraction is the maximum (relative) distance to trim a hull in the direction of each trim plane.

Returns:
Returns true iff successful.
virtual void nvidia::apex::DestructibleAssetAuthoring::visualizeVoronoiCells ( nvidia::RenderDebugInterface &  debugRender,
const PxVec3 *  sites,
uint32_t  siteCount,
const uint32_t *  cellColors,
uint32_t  cellColorCount,
const PxBounds3 &  bounds,
uint32_t  cellIndex = 0xFFFFFFFF 
) [pure virtual]

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

Parameters:
debugRenderrendering object which will receive the drawing primitives associated with this cell visualization
sitesan array of Voronoi cell sites, of length siteCount
siteCountthe number of Voronoi cell sites (length of sites array)
cellColorsan optional array of colors (see RenderDebug 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].
cellColorCountthe number of cell colors (the length of cellColors array)
boundsdefines an axis-aligned bounding box which clips the visualization, since some cells extend to infinity
cellIndexif this is a valid index (cellIndex < siteCount), then only the cell corresponding to sites[cellIndex] will be drawn. Otherwise, all cells will be drawn.
virtual bool nvidia::apex::DestructibleAssetAuthoring::voronoiSplitChunk ( uint32_t  chunkIndex,
const FractureTools::MeshProcessingParameters meshProcessingParams,
const FractureTools::FractureVoronoiDesc desc,
const CollisionDesc collisionDesc,
uint32_t *  randomSeed,
IProgressListener &  progressListener,
volatile bool *  cancel = NULL 
) [pure virtual]

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.

Parameters:
chunkIndexindex of chunk to be split
meshProcessingParamsdescribes generic mesh processing directives
descdescribes the voronoi splitting parameters surfaces (see FractureVoronoiDesc)
collisionDescconvex hulls will be generated for each chunk using the method. See CollisionDesc.
randomSeedpointer to a seed for the random number generator, to ensure reproducibility. If NULL, the random number generator will not be re-seeded.
progressListenerThe user must instantiate an IProgressListener, so that this function may report progress of this operation
cancelif 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:
returns true if successful.

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

Generated on Sat Dec 1 2018 15:51:53

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