rideTiltLimits関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The range of the controls' tilt that does something in the horizon look: from straight down to a little above the horizon. A tilt beyond it moves nothing, so a page holds the tilt to it, and a drag back starts moving at once instead of after the
excess is dragged back. It depends on the height (the horizon is further from straight down the higher the camera is) and the zoom. The down look has no such range.
インポート
import { rideTiltLimits } from "@johnmorrisdotca/chikyu-earth/space";
定義
function rideTiltLimits(distance: number, look: RideLook, zoom: number): { min: number; max: number; } | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
distance | number | The camera's distance from the Earth's centre, in Earth radii. |
look | RideLook | The look. |
zoom | number | The shared controls' zoom. |
戻り値
{ min: number; max: number; } | null
The lowest and highest tilt, or null for the down look.
例
import { rideTiltLimits } from "@johnmorrisdotca/chikyu-earth/space";
const range = rideTiltLimits(1.066, "horizon", 1);
console.log(range && `${range.min.toFixed(0)} to ${range.max.toFixed(0)}`, rideTiltLimits(1.066, "down", 1));-35 to 38 null出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。