dragHint関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The drag that makes this turn, from the way the cube is looked at now
(view, as viewMatrix makes it). Several layers about one axis, turned
as far, are one slab and get one arrow across it; each layer is still
turned by a drag of its own. Null for a turn of the whole cube, which no
drag on a sticker makes, and for turns that are not one movement.
インポート
import { dragHint } from "@johnmorrisdotca/kyuubu";
定義
function dragHint(moves: CubeMove | readonly CubeMove[], n: number, view: Mat3): DragHint | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
moves | CubeMove | readonly CubeMove[] | The turns, in their execution order. |
n | number | The cube’s side length. |
view | Mat3 | The view matrix, or mounted CubeView for a guide. |
戻り値
DragHint | null
The drag that makes this turn, from the way the cube is looked at now (view, as viewMatrix makes it). Several layers about one axis, turned as far, are one slab and get one arrow across it; each layer is still turned by a drag of its own. null for a turn of the whole cube, which no drag on a sticker makes, and for turns that are not one movement.
例
import { dragHint, parseMove, viewMatrix } from "@johnmorrisdotca/kyuubu";
const view = viewMatrix(-30, -20);
const move = parseMove("R", 3)!;
console.log(dragHint(move, 3, view));{
axis: 0,
layers: [ 2 ],
turns: 3,
seam: false,
slots: [
2, 5, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 20, 23,
26, 29, 32, 35, 45, 48, 51
],
face: 'F',
grab: 26,
drag: [ 0, -1 ],
quarters: -1,
atOnce: true,
arrow: {
from: [ 2, -2, 3 ],
along: [ 0, 1, 0 ],
length: 4.7,
width: 2,
normal: [ 0, 0, 1 ]
}
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。