fix: remove planar half-space correction for on-plane distance=0 constraints #38
Reference in New Issue
Block a user
Delete Branch "fix/planar-halfspace-drag-flip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a PlanarConstraint has distance=0 (point already on the plane), the half-space tracker used dot(z_i, z_j) as its indicator with a correction function that reflects the body through the plane.
When combined with a Cylindrical joint, legitimate rotation about the cylinder axis causes the body's planar face normal to rotate. After ~90 degrees, the dot product crosses zero, triggering the correction which teleports the body to the other side of the plane. The C++ validator then rejects every subsequent drag step as 'flipped orientation' (>91 degrees).
Fix: Return a tracking-only HalfSpace (no correction_fn) when the point is already on the plane. This matches the pattern used by Cylindrical, Revolute, and Concentric half-space trackers. The cross-product residuals in PlanarConstraint already enforce normal alignment via the solver, so the correction is redundant and harmful during drag.
All 286 solver tests pass.
fa34dc0d49to85a607228dView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.