#include <DestructibleAsset.h>
Public Types | |
enum | ChunkFlags { ChunkEnvironmentallySupported = (1 << 0), ChunkAndDescendentsDoNotFracture = (1 << 1), ChunkDoesNotFracture = (1 << 2), ChunkDoesNotCrumble = (1 << 3), ChunkRuntimeFracture = (1 << 4), ChunkIsInstanced = (1 << 16) } |
Public Member Functions | |
virtual void | releaseDestructibleActor (DestructibleActor &actor)=0 |
virtual DestructibleActor * | createDestructibleActorFromDeserializedState (::NvParameterized::Interface *actorParams, Scene &apexScene)=0 |
virtual DestructibleParameters | getDestructibleParameters () const =0 |
virtual DestructibleInitParameters | getDestructibleInitParameters () const =0 |
virtual const char * | getCrumbleEmitterName () const =0 |
virtual const char * | getDustEmitterName () const =0 |
virtual uint32_t | getChunkCount () const =0 |
virtual uint32_t | getDepthCount () const =0 |
virtual const RenderMeshAsset * | getRenderMeshAsset () const =0 |
virtual bool | setRenderMeshAsset (RenderMeshAsset *)=0 |
virtual uint32_t | getScatterMeshAssetCount () const =0 |
virtual RenderMeshAsset *const | getScatterMeshAssets () const =0 |
virtual uint32_t | getInstancedChunkMeshCount () const =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) const =0 |
virtual const IntPair * | getCachedOverlapsAtDepth (uint32_t depth) const =0 |
virtual PxVec3 | getChunkPositionOffset (uint32_t chunkIndex) const =0 |
virtual PxVec2 | getChunkUVOffset (uint32_t chunkIndex) const =0 |
virtual uint32_t | getChunkFlags (uint32_t chunkIndex) const =0 |
virtual uint16_t | getChunkDepth (uint32_t chunkIndex) const =0 |
virtual int32_t | getChunkParentIndex (uint32_t chunkIndex) const =0 |
virtual PxBounds3 | getChunkActorLocalBounds (uint32_t chunkIndex) const =0 |
virtual uint32_t | getPartIndex (uint32_t chunkIndex) const =0 |
virtual uint32_t | getPartConvexHullCount (const uint32_t partIndex) const =0 |
virtual NvParameterized::Interface ** | getPartConvexHullArray (const uint32_t partIndex) const =0 |
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 | 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 | rebuildCollisionGeometry (uint32_t partIndex, const DestructibleGeometryDesc &geometryDesc)=0 |
Protected Member Functions | |
virtual | ~DestructibleAsset () |
Destructible asset API. Destructible actors are instanced from destructible assets.
virtual nvidia::apex::DestructibleAsset::~DestructibleAsset | ( | ) | [inline, protected, virtual] |
Hidden destructor. Use release().
virtual void nvidia::apex::DestructibleAsset::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.
supportGraphEdges | Integer pairs representing indices to chunks that are linked |
numSupportGraphEdges | Number of provided integer pairs. |
virtual void nvidia::apex::DestructibleAsset::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.
transformation | This matrix is allowed to contain a translation and a rotation |
scale | Apply a uniform scaling as well |
virtual void nvidia::apex::DestructibleAsset::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.
transformation | This matrix is allowed to contain translation, rotation, scale and skew |
virtual void nvidia::apex::DestructibleAsset::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 void nvidia::apex::DestructibleAsset::clearChunkOverlaps | ( | int32_t | depth = -1 , |
bool | keepCachedFlag = false |
||
) | [pure virtual] |
Clears the chunk overlap cache. If depth < 0 (as it is by default), it clears the cache for each depth.
depth | Depth to be cleared. -1 for all depths. |
keepCachedFlag | If the flag is set, the depth is considered to be cached even if the overlaps list is empty. |
virtual DestructibleActor* nvidia::apex::DestructibleAsset::createDestructibleActorFromDeserializedState | ( | ::NvParameterized::Interface * | actorParams, |
Scene & | apexScene | ||
) | [pure virtual] |
General Create a destructible actor representing the destructible asset in a scene. Unlike a call to createApexActor, here the created actor takes explicit ownership of the provided actorParams. This can represent either the destructible descriptor or previously serialized destructible state. Note: The client should not attempt to use the provided actorParams after calling this method.
virtual uint32_t nvidia::apex::DestructibleAsset::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::DestructibleAsset::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::DestructibleAsset::getCachedOverlapCountAtDepth | ( | uint32_t | depth | ) | const [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.
virtual const IntPair* nvidia::apex::DestructibleAsset::getCachedOverlapsAtDepth | ( | uint32_t | depth | ) | const [pure virtual] |
Array of integer pairs, indexing chunk pairs which touch at a given depth in the hierarchy. 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 PxBounds3 nvidia::apex::DestructibleAsset::getChunkActorLocalBounds | ( | uint32_t | chunkIndex | ) | const [pure virtual] |
Returns the chunk bounds in the asset (local) space.
virtual uint32_t nvidia::apex::DestructibleAsset::getChunkCount | ( | ) | const [pure virtual] |
The total number of chunks in the asset.
virtual uint16_t nvidia::apex::DestructibleAsset::getChunkDepth | ( | uint32_t | chunkIndex | ) | const [pure virtual] |
Accessor to query the depth of a given chunk.
virtual uint32_t nvidia::apex::DestructibleAsset::getChunkFlags | ( | uint32_t | chunkIndex | ) | const [pure virtual] |
Retrieve flags (see ChunkFlags) for the given chunk.
virtual int32_t nvidia::apex::DestructibleAsset::getChunkParentIndex | ( | uint32_t | chunkIndex | ) | const [pure virtual] |
Returns the index of the given chunk's parent. If the chunk has no parent (is the root of the fracture hierarchy), then -1 is returned.
virtual PxVec3 nvidia::apex::DestructibleAsset::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::DestructibleAsset::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 const char* nvidia::apex::DestructibleAsset::getCrumbleEmitterName | ( | ) | const [pure virtual] |
The name of the emitter to use when generating crumble particles. Returns NULL if no emitter is configured.
virtual uint32_t nvidia::apex::DestructibleAsset::getDepthCount | ( | ) | const [pure virtual] |
The total number of fracture hierarchy depth levels in the asset.
virtual DestructibleInitParameters nvidia::apex::DestructibleAsset::getDestructibleInitParameters | ( | ) | const [pure virtual] |
The parameters used for default destructible initialization. See DestructibleInitParameters.
virtual DestructibleParameters nvidia::apex::DestructibleAsset::getDestructibleParameters | ( | ) | const [pure virtual] |
The DestructibleParameters which describe the default fracturing behavior for instanced DestructibleActors.
virtual const char* nvidia::apex::DestructibleAsset::getDustEmitterName | ( | ) | const [pure virtual] |
The name of the emitter to use when generating fracture-line dust particles. Returns NULL if no emitter is configured.
virtual uint32_t nvidia::apex::DestructibleAsset::getInstancedChunkMeshCount | ( | ) | const [pure virtual] |
Get the number of instanced chunk meshes in this asset.
virtual NvParameterized::Interface** nvidia::apex::DestructibleAsset::getPartConvexHullArray | ( | const uint32_t | partIndex | ) | const [pure virtual] |
Returns the head of an array to convex hull NvParamterized::Interface* pointers for a given part.
virtual uint32_t nvidia::apex::DestructibleAsset::getPartConvexHullCount | ( | const uint32_t | partIndex | ) | const [pure virtual] |
The number of convex hulls associated with a given part.
virtual uint32_t nvidia::apex::DestructibleAsset::getPartIndex | ( | uint32_t | chunkIndex | ) | const [pure virtual] |
The render mesh asset part index associated with this chunk.
virtual const RenderMeshAsset* nvidia::apex::DestructibleAsset::getRenderMeshAsset | ( | ) | const [pure virtual] |
Gets the RenderMeshAsset associated with this asset.
virtual uint32_t nvidia::apex::DestructibleAsset::getScatterMeshAssetCount | ( | ) | const [pure virtual] |
Retrieve the number of scatter mesh assets
virtual RenderMeshAsset* const nvidia::apex::DestructibleAsset::getScatterMeshAssets | ( | ) | const [pure virtual] |
Retrieve the scatter mesh asset array
virtual void nvidia::apex::DestructibleAsset::getStats | ( | DestructibleAssetStats & | stats | ) | const [pure virtual] |
Returns stats (sizes, counts) for the asset. See DestructibleAssetStats.
virtual bool nvidia::apex::DestructibleAsset::rebuildCollisionGeometry | ( | uint32_t | partIndex, |
const DestructibleGeometryDesc & | geometryDesc | ||
) | [pure virtual] |
Rebuild the collision volumes for the given chunk, using the geometryDesc (see DestructibleGeometryDesc). Returns true iff successful.
virtual void nvidia::apex::DestructibleAsset::releaseDestructibleActor | ( | DestructibleActor & | actor | ) | [pure virtual] |
Instancing Instances the DestructibleAsset, creating an DestructibleActor, using the DestructibleActorDesc. See DestructibleActor and DestructibleActorDesc. This asset will own the DestructibleActor, so that any DestructibleActor created by it will be released when this asset is released. You may also call the DestructibleActor's release() method at any time.
virtual void nvidia::apex::DestructibleAsset::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.
supportGraphEdges | Integer pairs representing indices to chunks that are linked |
numSupportGraphEdges | Number of provided integer pairs. |
keepCachedFlagIfEmpty | If the flag is set, the depth is considered to be cached even if the overlaps list is empty. |
virtual bool nvidia::apex::DestructibleAsset::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 true if successful.