coerceOut
Polygon coerceOut Polygon => Polygon
Returns this polygon nudged clear of collider's solid region, or this untouched when it is already clear, touching included.
The penetration found by collide is resolved by the minimal position fix subject * T(normal * depth): a translation along the penetration's correcting normal by its raw depth. The collider's orientation decides which side is solid — a classic collider is an obstacle the subject is pushed out of along the shallowest push-out, an inside-out one a wall the subject is retreated back inside from its deepest protrusion. One penetration is resolved per call — a subject violating several of collider's faces at once converges by coercing again. The query contract is collide's: sound for a convex loop on collider only (against an inside-out collider the subject may be any polygon; against a classic one it must be convex too), with existence rounded at the SCALE quantum — a subject exactly on the solid region's boundary is already valid. The nudged result is the receiver's own class — the translation returns through Polygon.copy — and a penetration-free subject returns this itself. coerceIn is the dual constraint, related through negation: subject coerceOut -polygon and subject coerceIn polygon land the subject identically. A resolution other than the nudge is spelled on the query itself: (subject collide collider) { … }.
Receiver
The subject polygon to keep clear of collider's solid region.
Return
The nudged polygon as the receiver's class, or this untouched when there is no penetration.
Parameters
The polygon whose oriented solid region the subject may not reach into.
Type Parameters
The receiver's type, preserved in the result.
Throws
when the nudge lands two consecutive vertices rounded-coincident at the SCALE quantum.