Skip to content

Commit

Permalink
BGE: Fix softbody cluster collision: set mass before creating cluster.
Browse files Browse the repository at this point in the history
Previously the mass of the soft body was set after creating the cluster,
causing incorrect mass in the clusters and incorrect behavior in collision.
  • Loading branch information
ben2610 authored and panzergame committed Dec 17, 2017
1 parent 45f9385 commit 4a45419
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,12 @@ bool CcdPhysicsController::CreateSoftbody()
}

psb->randomizeConstraints();
psb->setTotalMass(m_cci.m_mass);

if (m_cci.m_soft_collisionflags & (CCD_BSB_COL_CL_RS + CCD_BSB_COL_CL_SS)) {
psb->generateClusters(m_cci.m_soft_numclusteriterations);
}

psb->setTotalMass(m_cci.m_mass);

psb->setCollisionFlags(0);

Expand Down

0 comments on commit 4a45419

Please sign in to comment.