Reference · The Sun, Moon and planets: pure parts
rideTurnDegreesfunction
How many degrees the camera turns for a change of the controls' yaw at a zoom. The controls wrap their yaw into -180 to 180, so a page adds up the turns itself, change by change (wrapYaw of the change, scaled by this at the zoom of the moment), and hands
the total to ridePose as turn: a drag the whole way round is then a turn the whole way round, and the pace follows the field of view at any zoom.
Import it
import { rideTurnDegrees } from "@johnmorrisdotca/chikyu-earth/space";
Definition
function rideTurnDegrees(change: number, zoom: number): number
Parameters
| Name | Type | Description |
|---|---|---|
change | number | The change of yaw, in degrees, between two views of the controls (already brought into -180 to 180). |
zoom | number | The shared controls' zoom at the moment. |
Returns
number
The turn, in degrees.
Examples
import { rideTurnDegrees } from "@johnmorrisdotca/chikyu-earth/space";
console.log(rideTurnDegrees(180, 1), rideTurnDegrees(180, 6));90 15What it prints (run when this page was built)