Nv::Blast::FamilyHeader Struct Reference

#include <NvBlastFamily.h>

Inheritance diagram for Nv::Blast::FamilyHeader:

NvBlastDataBlock

List of all members.

Public Member Functions

void applyFracture (NvBlastFractureBuffers *eventBuffers, const NvBlastFractureBuffers *commands, Actor *filterActor, NvBlastLog logFn, NvBlastTimers *timers)
ActorborrowActor (uint32_t index)
void fractureInPlaceEvents (uint32_t chunkFractureCount, NvBlastChunkFractureData *inoutbuffer, uint32_t eventsSize, uint32_t *count, Actor *filterActor, NvBlastLog logFn)
void fractureNoEvents (uint32_t chunkFractureCount, const NvBlastChunkFractureData *chunkFractures, Actor *filterActor, NvBlastLog logFn)
void fractureSubSupport (uint32_t chunkIndex, uint32_t suboffset, float healthDamage, float *chunkHealths, const NvBlastChunk *chunks, NvBlastChunkFractureData *outBuffer, uint32_t *currentIndex, const uint32_t maxCount)
void fractureSubSupportNoEvents (uint32_t chunkIndex, uint32_t suboffset, float healthDamage, float *chunkHealths, const NvBlastChunk *chunks)
void fractureWithEvents (uint32_t chunkFractureCount, const NvBlastChunkFractureData *commands, NvBlastChunkFractureData *events, uint32_t eventsSize, uint32_t *count, Actor *filterActor, NvBlastLog logFn)
uint32_t getActorBufferSize () const
ActorgetActorByIndex (uint32_t index) const
ActorgetGetChunkActor (uint32_t chunkIndex) const
uint32_t getGetChunkActorIndex (uint32_t chunkIndex) const
ActorgetGetNodeActor (uint32_t nodeIndex) const
uint32_t getGetNodeActorIndex (uint32_t nodeIndex) const
float * getSubsupportChunkHealths () const
bool isActorActive (uint32_t index) const
 NvBlastBlockArrayData (float, m_graphBondHealthsOffset, getBondHealths, m_asset->getBondCount())
 NvBlastBlockArrayData (float, m_lowerSupportChunkHealthsOffset, getLowerSupportChunkHealths, m_asset->getLowerSupportChunkCount())
 NvBlastBlockArrayData (uint32_t, m_graphNodeIndexLinksOffset, getGraphNodeIndexLinks, m_asset->m_graph.m_nodeCount)
 NvBlastBlockArrayData (uint32_t, m_chunkActorIndicesOffset, getChunkActorIndices, m_asset->m_firstSubsupportChunkIndex)
 NvBlastBlockArrayData (IndexDLink< uint32_t >, m_visibleChunkIndexLinksOffset, getVisibleChunkIndexLinks, m_asset->m_chunkCount)
 NvBlastBlockArrayData (Actor, m_actorsOffset, getActors, m_asset->m_graph.m_nodeCount)
 NvBlastBlockData (FamilyGraph, m_familyGraphOffset, getFamilyGraph)
void returnActor (Actor &actor)

Public Attributes

union {
   const Asset *   m_asset
   uint64_t   m_runtimePlaceholder
}; 
volatile uint32_t m_actorCount
NvBlastID m_assetID


Detailed Description

Data header at the beginning of every NvBlastActor family

The block address may be cast to a valid FamilyHeader pointer.


Member Function Documentation

void Nv::Blast::FamilyHeader::applyFracture ( NvBlastFractureBuffers eventBuffers,
const NvBlastFractureBuffers commands,
Actor filterActor,
NvBlastLog  logFn,
NvBlastTimers timers 
)

See NvBlastActorApplyFracture

Parameters:
[in,out] eventBuffers Target buffers to hold applied fracture events. May be NULL, in which case events are not reported. To avoid data loss, provide an entry for every lower-support chunk and every bond in the original actor.
[in,out] actor The NvBlastActor to apply fracture to.
[in] commands The fracture commands to process.
[in] filterActor pointer to the actor to filter commands that target other actors. May be NULL to apply all commands
[in] logFn User-supplied message function (see NvBlastLog definition). May be NULL.
[in,out] timers If non-NULL this struct will be filled out with profiling information for the step, in profile build configurations.

NV_INLINE Actor * Nv::Blast::FamilyHeader::borrowActor ( uint32_t  index  ) 

Gets an actor from the actor array and validates it if it is not already valid. This increments the actor reference count.

Parameters:
[in] index The index of the actor to borrow. Must be in the range [0, getActorBufferSize()).
Returns:
A pointer to the indexed Actor.

void Nv::Blast::FamilyHeader::fractureInPlaceEvents ( uint32_t  chunkFractureCount,
NvBlastChunkFractureData inoutbuffer,
uint32_t  eventsSize,
uint32_t *  count,
Actor filterActor,
NvBlastLog  logFn 
)

Apply chunk fracture commands hierarchically, recording a fracture event for each health damage applied.

In-Place version: fracture commands are replaced by fracture events.

If inoutbuffer array is too small, events are dropped but the chunks are still damaged.

Parameters:
chunkFractureCount number of chunk fracture commands to apply
inoutbuffer array of chunk fracture commands to be replaced by events
eventsSize number of available entries in inoutbuffer
count returns the number of damaged chunks
[in] filterActor pointer to the actor to filter commands that target other actors. May be NULL to apply all commands
[in] logFn User-supplied message function (see NvBlastLog definition). May be NULL.

void Nv::Blast::FamilyHeader::fractureNoEvents ( uint32_t  chunkFractureCount,
const NvBlastChunkFractureData chunkFractures,
Actor filterActor,
NvBlastLog  logFn 
)

Apply chunk fracture commands hierarchically.

Parameters:
chunkFractureCount number of chunk fracture commands to apply
chunkFractures array of chunk fracture commands
filterActor pointer to the actor to filter commands corresponding to other actors. May be NULL to apply all commands
[in] logFn User-supplied message function (see NvBlastLog definition). May be NULL.

void Nv::Blast::FamilyHeader::fractureSubSupport ( uint32_t  chunkIndex,
uint32_t  suboffset,
float  healthDamage,
float *  chunkHealths,
const NvBlastChunk chunks,
NvBlastChunkFractureData outBuffer,
uint32_t *  currentIndex,
const uint32_t  maxCount 
)

Hierarchically distribute damage to child chunks, recording a fracture event for each health damage applied.

If outBuffer is too small, events are dropped but the chunks are still damaged.

Parameters:
chunkIndex asset chunk index to hierarchically damage
suboffset index of the first sub-support health
healthDamage damage strength to apply
chunkHealths instance chunk healths
chunks asset chunk collection
outBuffer target buffer for fracture events
currentIndex current position in outBuffer - returns the number of damaged chunks
maxCount capacity of outBuffer
[in] filterActor pointer to the actor to filter commands that target other actors. May be NULL to apply all commands
[in] logFn User-supplied message function (see NvBlastLog definition). May be NULL.

void Nv::Blast::FamilyHeader::fractureSubSupportNoEvents ( uint32_t  chunkIndex,
uint32_t  suboffset,
float  healthDamage,
float *  chunkHealths,
const NvBlastChunk chunks 
)

Hierarchically distribute damage to child chunks.

Parameters:
chunkIndex asset chunk index to hierarchically damage
suboffset index of the first sub-support health
healthDamage damage strength to apply
chunkHealths instance chunk healths
chunks asset chunk collection

void Nv::Blast::FamilyHeader::fractureWithEvents ( uint32_t  chunkFractureCount,
const NvBlastChunkFractureData commands,
NvBlastChunkFractureData events,
uint32_t  eventsSize,
uint32_t *  count,
Actor filterActor,
NvBlastLog  logFn 
)

Apply chunk fracture commands hierarchically, recording a fracture event for each health damage applied.

If events array is too small, events are dropped but the chunks are still damaged.

Parameters:
chunkFractureCount number of chunk fracture commands to apply
commands array of chunk fracture commands
events target buffer for fracture events
eventsSize number of available entries in 'events'
count returns the number of damaged chunks
[in] filterActor pointer to the actor to filter commands that target other actors. May be NULL to apply all commands
[in] logFn User-supplied message function (see NvBlastLog definition). May be NULL.

NV_INLINE uint32_t Nv::Blast::FamilyHeader::getActorBufferSize (  )  const

Returns the total number of actors in the Actor buffer, active and inactive.

Returns:
the number of Actors in the actor buffer. See borrowActor.

NV_INLINE Actor * Nv::Blast::FamilyHeader::getActorByIndex ( uint32_t  index  )  const

Retrieve the actor from an index. If actor is inactive nullptr is returned.

Parameters:
[in] index The index of an actor.
Returns:
A pointer to the indexed actor if the actor is active, nullptr otherwise.

NV_INLINE Actor * Nv::Blast::FamilyHeader::getGetChunkActor ( uint32_t  chunkIndex  )  const

Retrieve an actor associated with the given chunk.

Parameters:
[in] chunkIndex The index of chunk.
Returns:
A pointer to the actor if the actor is active, nullptr otherwise.

NV_INLINE uint32_t Nv::Blast::FamilyHeader::getGetChunkActorIndex ( uint32_t  chunkIndex  )  const

Retrieve the index of an actor associated with the given chunk.

Parameters:
[in] chunkIndex The index of chunk.
Returns:
the index of associated actor in the FamilyHeader's getActors() array.

NV_INLINE Actor * Nv::Blast::FamilyHeader::getGetNodeActor ( uint32_t  nodeIndex  )  const

Retrieve an actor associated with the given node.

Parameters:
[in] nodeIndex The index of node.
Returns:
A pointer to the actor if the actor is active, nullptr otherwise.

NV_INLINE uint32_t Nv::Blast::FamilyHeader::getGetNodeActorIndex ( uint32_t  nodeIndex  )  const

Retrieve the index of an actor associated with the given node.

Parameters:
[in] nodeIndex The index of node.
Returns:
the index of associated actor in the FamilyHeader's getActors() array.

float* Nv::Blast::FamilyHeader::getSubsupportChunkHealths (  )  const [inline]

Utility function to get the start of the subsupport chunk health array.

To access a subsupport chunk health indexed by i, use getSubsupportChunkHealths()[i - m_asset->m_firstSubsupportChunkIndex]

Returns:
the array of health values associated with all descendants of support chunks.

NV_INLINE bool Nv::Blast::FamilyHeader::isActorActive ( uint32_t  index  )  const

Returns a value to indicate whether or not the Actor with the given index is valid for use (active).

Returns:
true iff the indexed actor is active.

Nv::Blast::FamilyHeader::NvBlastBlockArrayData ( float  ,
m_graphBondHealthsOffset  ,
getBondHealths  ,
m_asset->  getBondCount() 
)

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].

getBondHealths returns the array of healths associated with all bonds in the support graph.

Nv::Blast::FamilyHeader::NvBlastBlockArrayData ( float  ,
m_lowerSupportChunkHealthsOffset  ,
getLowerSupportChunkHealths  ,
m_asset->  getLowerSupportChunkCount() 
)

Health for each support chunk and subsupport chunk, of type float.

To access support chunks, use the corresponding graph node index in the array returned by getLowerSupportChunkHealths.

To access subsupport chunk healths, use getSubsupportChunkHealths (see documentation for details).

Nv::Blast::FamilyHeader::NvBlastBlockArrayData ( uint32_t  ,
m_graphNodeIndexLinksOffset  ,
getGraphNodeIndexLinks  ,
m_asset->m_graph.  m_nodeCount 
)

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::Blast::FamilyHeader::NvBlastBlockArrayData ( uint32_t  ,
m_chunkActorIndicesOffset  ,
getChunkActorIndices  ,
m_asset->  m_firstSubsupportChunkIndex 
)

Chunk actor IDs, of type uint32_t. These correspond to the ID of the actor which owns each chunk. A value of invalidIndex<uint32_t>() indicates no owner.

getChunkActorIndices returns an array of size m_asset->m_firstSubsupportChunkIndex.

Nv::Blast::FamilyHeader::NvBlastBlockArrayData ( IndexDLink< uint32_t >  ,
m_visibleChunkIndexLinksOffset  ,
getVisibleChunkIndexLinks  ,
m_asset->  m_chunkCount 
)

Visible chunk index links, of type IndexDLink<uint32_t>.

getVisibleChunkIndexLinks returns an array of size m_asset->m_chunkCount of IndexDLink<uint32_t> (see IndexDLink).

Nv::Blast::FamilyHeader::NvBlastBlockArrayData ( Actor  ,
m_actorsOffset  ,
getActors  ,
m_asset->m_graph.  m_nodeCount 
)

Actors, of type Actor.

Actors with support chunks will use this array in the range [0, m_asset->m_graphNodeCount), while subsupport actors will be placed in the range [m_asset->m_graphNodeCount, getActorBufferSize()).

Nv::Blast::FamilyHeader::NvBlastBlockData ( FamilyGraph  ,
m_familyGraphOffset  ,
getFamilyGraph   
)

The instance graph for islands searching, of type FamilyGraph.

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 void Nv::Blast::FamilyHeader::returnActor ( Actor actor  ) 

Invalidates the actor if it is not already invalid. This decrements the actor reference count, but does not free this block when the count goes to zero.

Parameters:
[in] actor The actor to invalidate.


Member Data Documentation

union { ... }

The asset corresponding to all actors in this family. This is runtime data and will be resolved from m_assetID.

The number of actors using this block.

The ID for the asset. This will be resolved into a pointer in the runtime data.


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