Merge pull request #2691 from xhan0619/master

Initialize uninitialized variables in btSoftBody
This commit is contained in:
erwincoumans 2020-03-25 19:27:43 -07:00 committed by GitHub
commit ed11038362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}