Main Page Class List Class Members

# NvBlastSupportGraph Struct Reference

`#include <NvBlastTypes.h>`

List of all members.

## Public Attributes
uint32_t * | adjacencyPartition
uint32_t * | adjacentBondIndices
uint32_t * | adjacentNodeIndices
uint32_t * | chunkIndices
uint32_t | nodeCount

## Detailed Description

Describes the connectivity between support chunks via bonds.

Vertices in the support graph are termed "nodes," and represent particular chunks (NvBlastChunk) in an NvBlastAsset. The indexing for nodes is not the same as that for chunks. Only some chunks are represented by nodes in the graph, and these chunks are called "support chunks."

Adjacent node indices and adjacent bond indices are stored for each node, and therefore each bond is represented twice in this graph, going from node[i] -> node[j] and from node[j] -> node[i]. Therefore the size of the adjacentNodeIndices and adjacentBondIndices arrays are twice the number of bonds stored in the corresponding NvBlastAsset.

The graph is used as follows. Given a NvBlastSupportGraph "graph" and node index i, (0 <= i < graph.nodeCount), one may find all adjacent bonds and nodes using:

adj is the lookup value in graph.adjacentNodeIndices and graph.adjacentBondIndices for (uint32_t adj = graph.adjacencyPartition[i]; adj < graph.adjacencyPartition[i+1]; ++adj) { An adjacent node: uint32_t adjacentNodeIndex = graph.adjacentNodeIndices[adj];

The corresponding bond (that connects node index i with node indexed adjacentNodeIndex: uint32_t adjacentBondIndex = graph.adjacentBondIndices[adj]; }

For a graph node with index i, the corresponding asset chunk index is found using graph.chunkIndices[i]. The reverse mapping (obtaining a graph node index from an asset chunk index) can be done using the

NvBlastAssetGetChunkToGraphNodeMap(asset, logFn)

function. See the documentation for its use. The returned "node index" for a non-support chunk is the invalid value 0xFFFFFFFF.

## Member Data Documentation

uint32_t* NvBlastSupportGraph::adjacencyPartition

Partitions both the adjacentNodeIndices and the adjacentBondIndices arrays into subsets corresponding to each node. The size of this array is nodeCount+1. For 0 <= i < nodeCount, adjacencyPartition[i] is the index of the first element in adjacentNodeIndices (or adjacentBondIndices) for nodes adjacent to the node with index i. adjacencyPartition[nodeCount] is the size of the adjacentNodeIndices and adjacentBondIndices arrays. This allows one to easily count the number of nodes adjacent to a node with index i, using adjacencyPartition[i+1] - adjacencyPartition[i].

uint32_t* NvBlastSupportGraph::adjacentBondIndices

Array composed of subarrays holding the indices of bonds (NvBlastBond) for a given node. The subarrays may be accessed through the adjacencyPartition array.

uint32_t* NvBlastSupportGraph::adjacentNodeIndices

Array composed of subarrays holding the indices of nodes adjacent to a given node. The subarrays may be accessed through the adjacencyPartition array.

uint32_t* NvBlastSupportGraph::chunkIndices

Indices of chunks represented by the nodes, an array of size nodeCount.

uint32_t NvBlastSupportGraph::nodeCount

Total number of nodes in the support graph.

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

- sdk/lowlevel/include/NvBlastTypes.h