Reference · Rockets, variants, parts and the fit check
besideLayoutfunction
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 it
import { besideLayout } from "@johnmorrisdotca/uchusen-rockets";
Definition
function besideLayout(craft: Bounds, other: Bounds): { at: Vec3; bounds: Bounds; }
Parameters
| Name | Type | Description |
|---|---|---|
craft | Bounds | The box the craft fills, in metres. |
other | Bounds | The box the other rocket fills on its own, in metres. |
Returns
{ at: Vec3; bounds: Bounds; }
The offset and the box the other rocket fills once it is there.
Examples
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 ] 124What it prints (run when this page was built)