diff --git a/src_rbd_shaders/dynamics/multibody/joint_constraints.rs b/src_rbd_shaders/dynamics/multibody/joint_constraints.rs index 7bce756..29a4511 100644 --- a/src_rbd_shaders/dynamics/multibody/joint_constraints.rs +++ b/src_rbd_shaders/dynamics/multibody/joint_constraints.rs @@ -370,6 +370,10 @@ fn emit_limit_constraint( // near-rigid, matching the old hardcoded `1/dt`). let min_enabled = curr_pos < limits[0]; let max_enabled = limits[1] < curr_pos; + // No limit is active, skip the constraint for the current substep. + if !min_enabled && !max_enabled { + return; + } let lo_excess = (limits[0] - curr_pos).max(0.0); let hi_excess = (curr_pos - limits[1]).max(0.0); let rhs_bias = (hi_excess - lo_excess) * erp_inv_dt;