cuboidLayerOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in.
インポート
import { cuboidLayerOf } from "@johnmorrisdotca/kyuubu/cuboid";
定義
function cuboidLayerOf(centre: Vec3, axis: CubeAxis, dims: CuboidDims): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
centre | Vec3 | The cubie centre in doubled model coordinates. |
axis | CubeAxis | The model axis: 0 for x, 1 for y, or 2 for z. |
dims | CuboidDims | The cuboid’s x, y and z dimensions, in that order. |
戻り値
number
The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in.
例
import { cuboidLayerOf } from "@johnmorrisdotca/kyuubu/cuboid";
const dims = [2, 3, 3] as const;
console.log(cuboidLayerOf([1, 0, 0], 0, dims));1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。