#include <NvBlastActor.h>

Classes | |
| class | GraphNodeIt |
| class | VisibleChunkIt |
Public Member Functions | |
| Actor () | |
| void | applyFracture (NvBlastFractureBuffers *eventBuffers, const NvBlastFractureBuffers *commands, NvBlastLog logFn, NvBlastTimers *timers) |
| uint32_t | damageBond (const NvBlastBondFractureData &cmd) |
| void | damageBond (uint32_t nodeIndex0, uint32_t nodeIndex1, uint32_t bondIndex, float healthDamage) |
| uint32_t | damageBond (uint32_t nodeIndex0, uint32_t nodeIndex1, float healthDamage) |
| uint32_t | findIslands (void *scratch) |
| void | generateFracture (NvBlastFractureBuffers *commandBuffers, const NvBlastDamageProgram &program, const void *programParams, NvBlastLog logFn, NvBlastTimers *timers) const |
| const Asset * | getAsset () const |
| float * | getBondHealths () const |
| NvBlastBond * | getBonds () const |
| NvBlastChunk * | getChunks () const |
| FamilyGraph * | getFamilyGraph () const |
| FamilyHeader * | getFamilyHeader () const |
| uint32_t | getFirstGraphNodeIndex () const |
| uint32_t | getFirstSubsupportChunkIndex () const |
| uint32_t | getFirstVisibleChunkIndex () const |
| const SupportGraph * | getGraph () const |
| uint32_t | getGraphNodeCount () const |
| const uint32_t * | getGraphNodeIndexLinks () const |
| uint32_t | getIndex () const |
| uint32_t | getLeafChunkCount () const |
| float * | getLowerSupportChunkHealths () const |
| float * | getSubsupportChunkHealths () const |
| uint32_t | getVisibleChunkCount () const |
| bool | isActive () const |
| bool | isBoundToWorld () const |
| bool | isSingleSupportChunk () const |
| bool | isSplitRequired () const |
| bool | isSubSupportChunk () const |
| uint32_t | partition (Actor **newActors, uint32_t newActorsSize, NvBlastLog logFn) |
| uint32_t | partitionMultipleGraphNodes (Actor **newActors, uint32_t newActorsSize, NvBlastLog logFn) |
| uint32_t | partitionSingleLowerSupportChunk (Actor **newActors, uint32_t newActorsSize, NvBlastLog logFn) |
| bool | release () |
| uint32_t | serializationRequiredStorage (NvBlastLog logFn) const |
| uint32_t | serialize (void *buffer, uint32_t bufferSize, NvBlastLog logFn) const |
| uint32_t | split (NvBlastActorSplitEvent *result, uint32_t newActorsMaxCount, void *scratch, NvBlastLog logFn, NvBlastTimers *timers) |
| size_t | splitRequiredScratch () const |
| void | updateVisibleChunksFromGraphNodes () |
Static Public Member Functions | |
| static Actor * | create (NvBlastFamily *family, const NvBlastActorDesc *desc, void *scratch, NvBlastLog logFn) |
| static size_t | createRequiredScratch (const NvBlastFamily *family) |
| static Actor * | deserialize (NvBlastFamily *family, const void *buffer, NvBlastLog logFn) |
Friends | |
| struct | FamilyHeader |
| void | updateVisibleChunksFromSupportChunk (Actor *, IndexDLink< uint32_t > *, uint32_t *, uint32_t, uint32_t, const NvBlastChunk *, uint32_t) |
These objects are stored within the family in a single array. A pointer to a Actor class will be given to the user through the NvBlastActor opaque type.
| Nv::Blast::Actor::Actor | ( | ) | [inline] |
| void Nv::Blast::Actor::applyFracture | ( | NvBlastFractureBuffers * | eventBuffers, | |
| const NvBlastFractureBuffers * | commands, | |||
| NvBlastLog | logFn, | |||
| NvBlastTimers * | timers | |||
| ) |
See NvBlastActorApplyFracture
| static Actor* Nv::Blast::Actor::create | ( | NvBlastFamily * | family, | |
| const NvBlastActorDesc * | desc, | |||
| void * | scratch, | |||
| NvBlastLog | logFn | |||
| ) | [static] |
Create an actor from a descriptor (creates a family). This actor will represent an unfractured instance of the asset. The asset must be in a valid state, for example each chunk hierarchy in it must contain at least one support chunk (a single support chunk in a hierarchy corresponds to the root chunk). This will always be the case for assets created by NvBlastCreateAsset.
| [in] | family | Family in which to create a new actor. The family must be valid and have no other actors in it. (See createFamily.) |
| [in] | desc | Actor initialization data, must be a valid pointer. |
| [in] | scratch | User-supplied scratch memory of size createRequiredScratch(desc) bytes. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| static size_t Nv::Blast::Actor::createRequiredScratch | ( | const NvBlastFamily * | family | ) | [static] |
Returns the size of the scratch space (in bytes) required to be passed into the create function, based upon the family that will be passed to the create function.
| [in] | family | The family being instanced. |
| uint32_t Nv::Blast::Actor::damageBond | ( | const NvBlastBondFractureData & | cmd | ) |
TODO: document
| void Nv::Blast::Actor::damageBond | ( | uint32_t | nodeIndex0, | |
| uint32_t | nodeIndex1, | |||
| uint32_t | bondIndex, | |||
| float | healthDamage | |||
| ) |
TODO: document
| uint32_t Nv::Blast::Actor::damageBond | ( | uint32_t | nodeIndex0, | |
| uint32_t | nodeIndex1, | |||
| float | healthDamage | |||
| ) |
Damage bond between two chunks by health amount (instance graph also will be notified in case bond is broken after).
| static Actor* Nv::Blast::Actor::deserialize | ( | NvBlastFamily * | family, | |
| const void * | buffer, | |||
| NvBlastLog | logFn | |||
| ) | [static] |
Deserialize a single Actor from a buffer. An actor family must given, into which the actor will be inserted if it is compatible. That is, it must not share any chunks or internal IDs with the actors already present in the block.
| [in] | family | Family in which to deserialize the actor. |
| [in] | buffer | Buffer containing the serialized actor data. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| uint32_t Nv::Blast::Actor::findIslands | ( | void * | scratch | ) |
Perform islands search. Bonds which are broken when their health values drop to zero (or below) may lead to new islands of chunks which need to be split into new actors. This function labels all nodes in the instance graph (see FamilyGraph) with a unique index per island that may be used as actor indices for new islands.
| [in] | scratch | User-supplied scratch memory of size splitRequiredScratch(). |
| void Nv::Blast::Actor::generateFracture | ( | NvBlastFractureBuffers * | commandBuffers, | |
| const NvBlastDamageProgram & | program, | |||
| const void * | programParams, | |||
| NvBlastLog | logFn, | |||
| NvBlastTimers * | timers | |||
| ) | const |
See NvBlastActorGenerateFracture
| NV_INLINE const Asset * Nv::Blast::Actor::getAsset | ( | ) | const |
Utility to get the asset this actor is associated with, through its family.
| NV_INLINE float * Nv::Blast::Actor::getBondHealths | ( | ) | const |
Bond health for the interfaces between two chunks, of type float. Since the bond is shared by two chunks, the same bond health is used for chunk[i] -> chunk[j] as for chunk[j] -> chunk[i].
| NV_INLINE NvBlastBond * Nv::Blast::Actor::getBonds | ( | ) | const |
| NV_INLINE NvBlastChunk * Nv::Blast::Actor::getChunks | ( | ) | const |
| NV_INLINE FamilyGraph * Nv::Blast::Actor::getFamilyGraph | ( | ) | const |
Access the instance graph for islands searching.
Return the dynamic data generated for the support graph. (See FamilyGraph.) This is used to store current connectivity information based upon bond and chunk healths, as well as cached intermediate data for faster incremental updates.
| NV_INLINE FamilyHeader * Nv::Blast::Actor::getFamilyHeader | ( | ) | const |
Find the family (see FamilyHeader) that this actor belongs to.
| NV_INLINE uint32_t Nv::Blast::Actor::getFirstGraphNodeIndex | ( | ) | const |
Access to graph node linked list for this actor. The index returned is that of a link in the FamilyHeader's getGraphNodeIndexLinks().
| NV_INLINE uint32_t Nv::Blast::Actor::getFirstSubsupportChunkIndex | ( | ) | const |
Access to the index of the first subsupport chunk.
| NV_INLINE uint32_t Nv::Blast::Actor::getFirstVisibleChunkIndex | ( | ) | const |
Access to visible chunk linked list for this actor. The index returned is that of a link in the FamilyHeader's getVisibleChunkIndexLinks().
| NV_INLINE const SupportGraph * Nv::Blast::Actor::getGraph | ( | ) | const |
Access to the support graph.
| NV_INLINE uint32_t Nv::Blast::Actor::getGraphNodeCount | ( | ) | const |
The number of graph nodes, corresponding to support chunks, for this actor. See also getFirstGraphNodeIndex.
| NV_INLINE const uint32_t * Nv::Blast::Actor::getGraphNodeIndexLinks | ( | ) | const |
Graph node index links, of type uint32_t. The successor to index[i] is m_graphNodeIndexLinksOffset[i]. A value of invalidIndex<uint32_t>() indicates no successor.
getGraphNodeIndexLinks returns an array of size m_asset->m_graphNodeCount.
| NV_INLINE uint32_t Nv::Blast::Actor::getIndex | ( | ) | const |
Utility to calculate actor index.
| NV_INLINE uint32_t Nv::Blast::Actor::getLeafChunkCount | ( | ) | const |
The number of leaf chunks for this actor.
| NV_INLINE float * Nv::Blast::Actor::getLowerSupportChunkHealths | ( | ) | const |
Access to the health for each support chunk and subsupport chunk, of type float.
Use getAsset()->getContiguousLowerSupportIndex() to map lower-support chunk indices into the range of indices valid for this array.
| NV_INLINE float * Nv::Blast::Actor::getSubsupportChunkHealths | ( | ) | const |
Access to the start of the subsupport chunk health array.
| NV_INLINE uint32_t Nv::Blast::Actor::getVisibleChunkCount | ( | ) | const |
The number of visible chunks. This is calculated from updateVisibleChunksFromGraphNodes(). See also getFirstVisibleChunkIndex.
| NV_INLINE bool Nv::Blast::Actor::isActive | ( | ) | const |
Since this object is not deleted (unless the family is deleted), we use m_familyOffset to determine if the actor is valid, or "active." When no actors in an instance return isActive(), it should be safe to delete the family.
| NV_INLINE bool Nv::Blast::Actor::isBoundToWorld | ( | ) | const |
| NV_INLINE bool Nv::Blast::Actor::isSingleSupportChunk | ( | ) | const |
Whether or not this actor represents a single support chunk. If the actor contains a single support chunk, it can have no other chunks associated with it.
| NV_INLINE bool Nv::Blast::Actor::isSplitRequired | ( | ) | const |
| NV_INLINE bool Nv::Blast::Actor::isSubSupportChunk | ( | ) | const |
Whether or not this actor represents a subsupport chunk. If the actor contains a subsupport chunk, then it can have only that chunk.
| NV_INLINE uint32_t Nv::Blast::Actor::partition | ( | Actor ** | newActors, | |
| uint32_t | newActorsSize, | |||
| NvBlastLog | logFn | |||
| ) |
Partition this actor into smaller pieces.
If this actor represents a single support or subsupport chunk, then after this operation this actor will released if child chunks are created (see Return value), and its pointer no longer valid for use (unless it appears in the newActors list).
This function will not split a leaf chunk actor. In that case, the actor is not destroyed and this function returns 0.
| [in] | newActors | user-supplied array of actor pointers to hold the actors generated from this partitioning. This array must be of size equal to the number of leaf chunks in the asset, to guarantee that all actors are reported. (See AssetDataHeader::m_leafChunkCount.) |
| [in] | newActorsSize | The size of the user-supplied newActors array. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| uint32_t Nv::Blast::Actor::partitionMultipleGraphNodes | ( | Actor ** | newActors, | |
| uint32_t | newActorsSize, | |||
| NvBlastLog | logFn | |||
| ) |
Partition this actor into smaller pieces. Use this function if this actor contains more than one support chunk.
After this operation, if successful, this actor will released, and its pointer no longer valid for use (unless it appears in the newActors list).
| [in] | newActors | User-supplied array of actor pointers to hold the actors generated from this partitioning. Note: this actor will not be released, but will hold a subset of the graph nodes that it had before the function was called. This array must be of size equal to the number of graph nodes in the asset, to guarantee that all actors are reported. |
| [in] | newActorsSize | The size of the user-supplied newActors array. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| uint32_t Nv::Blast::Actor::partitionSingleLowerSupportChunk | ( | Actor ** | newActors, | |
| uint32_t | newActorsSize, | |||
| NvBlastLog | logFn | |||
| ) |
Partition this actor into smaller pieces if it is a single lower-support chunk actor. Use this function on single support or sub-support chunks.
After this operation, if successful (child chunks created, see Return value), this actor will released, and its pointer no longer valid for use.
This function will not split a leaf chunk actor. In that case, the actor is not destroyed and this function returns 0.
| [in] | newActors | User-supplied array of actor pointers to hold the actors generated from this partitioning. Note: this actor will be released. This array must be of size equal to the lower-support chunk's child count, to guarantee that all actors are reported. |
| [in] | newActorsSize | The size of the user-supplied newActors array. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| NV_INLINE bool Nv::Blast::Actor::release | ( | void | ) |
Release this actor's association with a family, if any. This actor should be considered deleted after this function is called.
| uint32_t Nv::Blast::Actor::serializationRequiredStorage | ( | NvBlastLog | logFn | ) | const |
Calculate the space required to serialize this actor.
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| uint32_t Nv::Blast::Actor::serialize | ( | void * | buffer, | |
| uint32_t | bufferSize, | |||
| NvBlastLog | logFn | |||
| ) | const |
Serialize actor into single-actor buffer.
| [out] | buffer | User-supplied buffer, must be at least of size given by NvBlastActorGetSerializationSize(actor). |
| [in] | bufferSize | The size of the user-supplied buffer. The buffer size must be less than 4GB. If NvBlastActorGetSerializationSize(actor) >= 4GB, this actor cannot be serialized with this method. |
| [in] | logFn | User-supplied message function (see NvBlastLog definition). May be NULL. |
| uint32_t Nv::Blast::Actor::split | ( | NvBlastActorSplitEvent * | result, | |
| uint32_t | newActorsMaxCount, | |||
| void * | scratch, | |||
| NvBlastLog | logFn, | |||
| NvBlastTimers * | timers | |||
| ) |
See NvBlastActorSplit
| size_t Nv::Blast::Actor::splitRequiredScratch | ( | ) | const |
The scratch space required to call the findIslands function, or the split function, in bytes.
| void Nv::Blast::Actor::updateVisibleChunksFromGraphNodes | ( | ) |
Recalculate the visible chunk list for this actor based upon it graph node list (does not modify subsupport chunk actors)
friend struct FamilyHeader [friend] |
| void updateVisibleChunksFromSupportChunk | ( | Actor * | , | |
| IndexDLink< uint32_t > * | , | |||
| uint32_t * | , | |||
| uint32_t | , | |||
| uint32_t | , | |||
| const NvBlastChunk * | , | |||
| uint32_t | ||||
| ) | [friend] |