layerOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The layer, 0 to n − 1 from the axis's negative side, that a cubie centre sits in.
インポート
import { layerOf } from "@johnmorrisdotca/kyuubu";
定義
function layerOf(centre: Vec3, axis: CubeAxis, n: number): 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. |
n | number | The cube’s side length. |
戻り値
number
The layer, 0 to n − 1 from the axis's negative side, that a cubie centre sits in.
例
import { layerOf } from "@johnmorrisdotca/kyuubu";
console.log(layerOf([2, 2, 2], 0, 3));2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。