besideLayout関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where the other rocket stands: its offset in metres, to add to where its own parts stand, and the box it fills there. It is never scaled. Its foot is on the ground line (y = 0) as every rocket's is, it keeps its own line (z = 0), and its nearest side is a gap clear of the craft's widest, to the right (+X).
インポート
import { besideLayout } from "@johnmorrisdotca/uchusen-rockets";
定義
function besideLayout(craft: Bounds, other: Bounds): { at: Vec3; bounds: Bounds; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
craft | Bounds | The box the craft fills, in metres. |
other | Bounds | The box the other rocket fills on its own, in metres. |
戻り値
{ at: Vec3; bounds: Bounds; }
The offset and the box the other rocket fills once it is there.
例
import { besideLayout } from "@johnmorrisdotca/uchusen-rockets";
const { at, bounds } = besideLayout({ min: [-4, 0, -4], max: [4, 70, 4] }, { min: [-9, 0, -5], max: [9, 124, 9] });
console.log(at, bounds.max[1]);[ 17, 0, 0 ] 124出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。