BodyDrawing型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One body as drawn by a painter: an object of radius 1 at the origin, which the scene places, scales and (for the Sun) turns to face the camera.
インポート
import type { BodyDrawing } from "@johnmorrisdotca/chikyu-earth/space";
定義
interface BodyDrawing {
object: THREE.Object3D;
light?(toSun: Vec3): void;
update?(info: {
toSun: Vec3;
ms: number;
radiusPx: number;
}): void;
billboard?: boolean;
dispose(): void;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
object | THREE.Object3D<THREE.Object3DEventMap> | |
light (省略可) | ((toSun: Vec3) => void) | undefined | Told at each draw the unit direction from the body to the Sun, in scene axes (x to the vernal equinox, y north). |
update (省略可) | ((info: { toSun: Vec3; ms: number; radiusPx: number; }) => void) | undefined | Told at each draw, after the object is placed and scaled: the direction to the Sun, the moment shown, and how many CSS pixels across its radius the body is (a sharper picture is worth fetching only for a big one). |
billboard (省略可) | boolean | undefined | True to have the scene turn the object to face the camera (a disc or a glow). |
dispose | (): void |
例
import type { BodyDrawing } from "@johnmorrisdotca/chikyu-earth/space";
const drawing = { object: undefined as never, dispose: () => undefined } satisfies BodyDrawing;
console.log(typeof drawing.dispose);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。