Reference · Rockets, variants, parts and the fit check
pathClearsfunction
Whether every leg but the last stays out of the hull. The last leg is the move into the slot, so it may enter.
Import it
import { pathClears } from "@johnmorrisdotca/uchusen-rockets";
Definition
function pathClears(path: readonly (readonly [number, number, number])[], hull: HullBox): boolean
Parameters
| Name | Type | Description |
|---|---|---|
path | readonly (readonly [number, number, number])[] | The points, in order. |
hull | HullBox | The hull the earlier legs must stay outside of. |
Returns
boolean
True when no sample of those legs is inside the hull.
Examples
import { approachPath, pathClears } from "@johnmorrisdotca/uchusen-rockets";
const hull = { min: [-10, 0, -4] as const, max: [10, 40, 4] as const };
console.log(pathClears(approachPath(0, 1, [0, 20, 0], hull), hull));trueWhat it prints (run when this page was built)