mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
avoid dividing by 0
This commit is contained in:
parent
ae7c3e0dee
commit
41eb074406
@ -979,7 +979,7 @@ public:
|
||||
btVector3 com(0, 0, 0);
|
||||
for (int i = 0; i < m_nodes.size(); i++)
|
||||
{
|
||||
com += (m_nodes[i].m_x / m_nodes[i].m_im);
|
||||
com += (m_nodes[i].m_x * this->getMass(i));
|
||||
}
|
||||
com /= this->getTotalMass();
|
||||
return com;
|
||||
|
Loading…
Reference in New Issue
Block a user