aboutsummaryrefslogtreecommitdiff
path: root/sdk/extensions/stress/source/NvBlastExtStressSolver.cpp
diff options
context:
space:
mode:
authorAnton Novoselov <[email protected]>2017-08-08 20:14:22 +0300
committerAnton Novoselov <[email protected]>2017-08-08 20:14:22 +0300
commitd41654b469fa51870b5952c836c04d9da17f32d3 (patch)
tree64f8f437eef394630355f281d35ca1d53e5c4d6c /sdk/extensions/stress/source/NvBlastExtStressSolver.cpp
parentadd +x for packman script (diff)
downloadblast-d41654b469fa51870b5952c836c04d9da17f32d3.tar.xz
blast-d41654b469fa51870b5952c836c04d9da17f32d3.zip
Updated to CL 22627414:
* docs updates * authoring fixes * stress solver crash fixes
Diffstat (limited to 'sdk/extensions/stress/source/NvBlastExtStressSolver.cpp')
-rw-r--r--sdk/extensions/stress/source/NvBlastExtStressSolver.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/sdk/extensions/stress/source/NvBlastExtStressSolver.cpp b/sdk/extensions/stress/source/NvBlastExtStressSolver.cpp
index 335aacb..878165b 100644
--- a/sdk/extensions/stress/source/NvBlastExtStressSolver.cpp
+++ b/sdk/extensions/stress/source/NvBlastExtStressSolver.cpp
@@ -1191,10 +1191,10 @@ bool ExtStressSolverImpl::notifyActorCreated(const NvBlastActor& actor)
// update neighbors
{
uint32_t* graphNodeIndices = getScratchArray<uint32_t>(graphNodeCount);
- NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
- for (uint32_t i = 0; i < graphNodeCount; ++i)
+ const uint32_t nodeCount = NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
+ for (uint32_t i = 0; i < nodeCount; ++i)
{
- m_graphProcessor->setNodeNeighborsCount(graphNodeIndices[i], graphNodeCount);
+ m_graphProcessor->setNodeNeighborsCount(graphNodeIndices[i], nodeCount);
}
}
@@ -1263,9 +1263,9 @@ bool ExtStressSolverImpl::addForce(const NvBlastActor& actor, physx::PxVec3 loca
if (graphNodeCount > 1)
{
uint32_t* graphNodeIndices = getScratchArray<uint32_t>(graphNodeCount);
- NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
+ const uint32_t nodeCount = NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
- for (uint32_t i = 0; i < graphNodeCount; ++i)
+ for (uint32_t i = 0; i < nodeCount; ++i)
{
const uint32_t node = graphNodeIndices[i];
const float sqrDist = (localPosition - m_graphProcessor->getNodeData(node).localPos).magnitudeSquared();
@@ -1296,9 +1296,9 @@ bool ExtStressSolverImpl::addGravityForce(const NvBlastActor& actor, physx::PxVe
if (graphNodeCount > 1)
{
uint32_t* graphNodeIndices = getScratchArray<uint32_t>(graphNodeCount);
- NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
+ const uint32_t nodeCount = NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
- for (uint32_t i = 0; i < graphNodeCount; ++i)
+ for (uint32_t i = 0; i < nodeCount; ++i)
{
const uint32_t node = graphNodeIndices[i];
m_graphProcessor->addNodeVelocity(node, localGravity);
@@ -1314,10 +1314,10 @@ bool ExtStressSolverImpl::addAngularVelocity(const NvBlastActor& actor, PxVec3 l
if (graphNodeCount > 1)
{
uint32_t* graphNodeIndices = getScratchArray<uint32_t>(graphNodeCount);
- NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
+ const uint32_t nodeCount = NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
// Apply centrifugal force
- for (uint32_t i = 0; i < graphNodeCount; ++i)
+ for (uint32_t i = 0; i < nodeCount; ++i)
{
const uint32_t node = graphNodeIndices[i];
const auto& localPos = m_graphProcessor->getNodeData(node).localPos;
@@ -1367,9 +1367,9 @@ void ExtStressSolverImpl::fillFractureCommands(const NvBlastActor& actor, NvBlas
if (graphNodeCount > 1 && m_graphProcessor->getOverstressedBondCount() > 0)
{
uint32_t* graphNodeIndices = getScratchArray<uint32_t>(graphNodeCount);
- NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
+ const uint32_t nodeCount = NvBlastActorGetGraphNodeIndices(graphNodeIndices, graphNodeCount, &actor, logLL);
- for (uint32_t i = 0; i < graphNodeCount; ++i)
+ for (uint32_t i = 0; i < nodeCount; ++i)
{
const uint32_t node0 = graphNodeIndices[i];
for (uint32_t adjacencyIndex = m_graph.adjacencyPartition[node0]; adjacencyIndex < m_graph.adjacencyPartition[node0 + 1]; adjacencyIndex++)