From c785be51ce46c2bb8ac2b1b8fc1fa42d086b0b60 Mon Sep 17 00:00:00 2001 From: Xuchen Han Date: Wed, 25 Mar 2020 13:24:05 -0700 Subject: [PATCH] Initialize uninitialized variables in btSoftBody --- src/BulletSoftBody/btSoftBody.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index 6aa628ba0..5014300aa 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -2602,10 +2602,12 @@ void btSoftBody::initializeFaceTree() for (int i = 0; i < m_faces.size(); ++i) { Face& f = m_faces[i]; + ATTRIBUTE_ALIGNED16(btDbvtVolume) vol = VolumeOf(f, m_sst.radmrg); btDbvtNode* node = new (btAlignedAlloc(sizeof(btDbvtNode), 16)) btDbvtNode(); node->parent = NULL; node->data = &f; node->childs[1] = 0; + node->volume = vol; leafNodes[i] = node; f.m_leaf = node; } @@ -2652,10 +2654,12 @@ void btSoftBody::rebuildNodeTree() for (int i = 0; i < m_nodes.size(); ++i) { Node& n = m_nodes[i]; + ATTRIBUTE_ALIGNED16(btDbvtVolume) vol = btDbvtVolume::FromCR(n.m_x, m_sst.radmrg); btDbvtNode* node = new (btAlignedAlloc(sizeof(btDbvtNode), 16)) btDbvtNode(); node->parent = NULL; node->data = &n; node->childs[1] = 0; + node->volume = vol; leafNodes[i] = node; n.m_leaf = node; }