pathClears関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { pathClears } from "@johnmorrisdotca/uchusen-rockets";
定義
function pathClears(path: readonly (readonly [number, number, number])[], hull: HullBox): boolean
引数
| 名前 | 型 | 説明 |
|---|---|---|
path | readonly (readonly [number, number, number])[] | The points, in order. |
hull | HullBox | The hull the earlier legs must stay outside of. |
戻り値
boolean
True when no sample of those legs is inside the hull.
例
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));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。