Skip to content

Commit 73cf564

Browse files
committed
fix: fixed a bug that would crash physics when rope joint lengths were below constraint tolerance, closes #1414
1 parent c1e6a6c commit 73cf564

File tree

1 file changed

+3
-3
lines changed
  • fxgl-entity/src/main/java/com/almasb/fxgl/physics/box2d/dynamics/joints

1 file changed

+3
-3
lines changed

fxgl-entity/src/main/java/com/almasb/fxgl/physics/box2d/dynamics/joints/RopeJoint.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public void initVelocityConstraints(final SolverData data) {
9696
m_state = LimitState.INACTIVE;
9797
}
9898

99+
pool.pushRot(2);
100+
pool.pushVec2(1);
101+
99102
if (m_length > JBoxSettings.linearSlop) {
100103
m_u.mulLocal(1.0f / m_length);
101104
} else {
@@ -129,9 +132,6 @@ public void initVelocityConstraints(final SolverData data) {
129132
m_impulse = 0.0f;
130133
}
131134

132-
pool.pushRot(2);
133-
pool.pushVec2(1);
134-
135135
data.velocities[m_indexA].w = wA;
136136
data.velocities[m_indexB].w = wB;
137137
}

0 commit comments

Comments
 (0)