cuboidQuartersForReleasefunction
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 it
import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function cuboidQuartersForRelease(angle: number, speed: number, halfOnly: boolean, commitAngle?: number): -2 | -1 | 0 | 1 | 2
Parameters
| Name | Type | Description |
|---|---|---|
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 (optional) | number | The drag angle in degrees at which a resting release commits a turn. |
Returns
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.
Examples
import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
console.log(cuboidQuartersForRelease(100, 0, true));2What it prints (run when this page was built)