cuboidQuartersForRelease関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What letting go makes of a dragged layer, as quarter turns from −2 to 2,
where 0 is back where it was. A layer that turns by quarters is read as the
cube's is (quartersForRelease). One that only half turns is a half turn
from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a
millisecond, signed like the angle) that has gone at least four times
FLICK_ANGLE degrees the same way, and otherwise goes back.
インポート
import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
定義
function cuboidQuartersForRelease(angle: number, speed: number, halfOnly: boolean, commitAngle?: number): -2 | -1 | 0 | 1 | 2
引数
| 名前 | 型 | 説明 |
|---|---|---|
angle | number | The signed drag angle in degrees. |
speed | number | The signed drag speed in degrees per millisecond. |
halfOnly | boolean | Whether the layer can only make a half turn. |
commitAngle (省略可) | number | The drag angle in degrees at which a resting release commits a turn. |
戻り値
0 | 1 | -1 | 2 | -2
What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. A layer that turns by quarters is read as the cube's is (quartersForRelease). One that only half turns is a half turn from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a millisecond, signed like the angle) that has gone at least four times FLICK_ANGLE degrees the same way, and otherwise goes back.
例
import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
console.log(cuboidQuartersForRelease(100, 0, true));2出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。