diff --git a/src/bounce/dynamics/cloth/cloth_solver.cpp b/src/bounce/dynamics/cloth/cloth_solver.cpp index a0c1f9b..10b37da 100644 --- a/src/bounce/dynamics/cloth/cloth_solver.cpp +++ b/src/bounce/dynamics/cloth/cloth_solver.cpp @@ -272,16 +272,6 @@ void b3ClothSolver::Solve(float32 dt, const b3Vec3& gravity) break; } } -#endif - - // Copy state buffers back to the particles - for (u32 i = 0; i < m_particleCount; ++i) - { - b3Particle* p = m_particles[i]; - - p->m_position = sx[i]; - p->m_velocity = sv[i]; - } // Synchronize bodies for (u32 i = 0; i < m_contactCount; ++i) @@ -291,9 +281,19 @@ void b3ClothSolver::Solve(float32 dt, const b3Vec3& gravity) body->SynchronizeTransform(); body->m_worldInvI = b3RotateToFrame(body->m_invI, body->m_xf.rotation); - + body->SynchronizeShapes(); } +#endif + + // Copy state buffers back to the particles + for (u32 i = 0; i < m_particleCount; ++i) + { + b3Particle* p = m_particles[i]; + + p->m_position = sx[i]; + p->m_velocity = sv[i]; + } } void b3ClothSolver::Solve(b3DenseVec3& x, u32& iterations,