MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / notifyNodeRemoved

Method notifyNodeRemoved

sdk/lowlevel/source/NvBlastFamilyGraph.cpp:203–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool FamilyGraph::notifyNodeRemoved(ActorIndex actorIndex, NodeIndex nodeIndex, const SupportGraph* graph)
204{
205 NVBLAST_ASSERT(nodeIndex < graph->m_nodeCount);
206
207 // used internal data pointers
208 NodeIndex* fastRoute = getFastRoute();
209 const uint32_t* adjacencyPartition = graph->getAdjacencyPartition();
210 const uint32_t* adjacentBondIndices = graph->getAdjacentBondIndices();
211
212 // remove all edges leaving this node
213 for (uint32_t adjacencyIndex = adjacencyPartition[nodeIndex]; adjacencyIndex < adjacencyPartition[nodeIndex + 1]; adjacencyIndex++)
214 {
215 const uint32_t adjacentNodeIndex = getAdjacentNode(adjacencyIndex, graph);
216 if (!isInvalidIndex(adjacentNodeIndex))
217 {
218 const uint32_t bondIndex = adjacentBondIndices[adjacencyIndex];
219 getIsEdgeRemoved()->set(bondIndex);
220
221 if (fastRoute[adjacentNodeIndex] == nodeIndex)
222 fastRoute[adjacentNodeIndex] = invalidIndex<uint32_t>();
223 if (fastRoute[nodeIndex] == adjacentNodeIndex)
224 fastRoute[nodeIndex] = invalidIndex<uint32_t>();
225
226 addToDirtyNodeList(actorIndex, adjacentNodeIndex);
227 }
228 }
229 addToDirtyNodeList(actorIndex, nodeIndex);
230
231 // ignore this node in partition (only needed for "chunk deleted from graph")
232 // getIslandIds()[nodeIndex] = invalidIndex<uint32_t>();
233
234 return true;
235}
236
237void FamilyGraph::unwindRoute(uint32_t traversalIndex, NodeIndex lastNode, uint32_t hopCount, IslandId id, FixedArray<TraversalState>* visitedNodes)
238{

Callers 3

fractureNoEventsMethod · 0.80
fractureWithEventsMethod · 0.80
fractureInPlaceEventsMethod · 0.80

Calls 2

isInvalidIndexFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected