fix spring bug

This commit is contained in:
2023-11-16 19:53:38 +01:00
parent af0421a557
commit 489ddce9b2

View File

@@ -328,7 +328,7 @@ void MassSpringSystemSimulator::Midpoint(Spring& spring, float timestep) {
Vec3 PosNorm1 = PosVector / d; Vec3 PosNorm1 = PosVector / d;
Vec3 PosNorm2 = -1 * PosNorm1; Vec3 PosNorm2 = -1 * PosNorm1;
Vec3 Force = -m_fStiffness * (d - springs.at(0).initialLength) * PosNorm1; Vec3 Force = -m_fStiffness * (d - spring.initialLength) * PosNorm1;
Vec3 Force2 = -1 * Force; Vec3 Force2 = -1 * Force;
Vec3 oldAcc = calculateAcceleration(Force,m_fMass); Vec3 oldAcc = calculateAcceleration(Force,m_fMass);