API

Interface GeospatialCamera

Camera that orbits a spherical planet centred at the world origin (Babylon.js GeospatialCamera).

Orientation is fully described by center (the anchored point on the globe in ECEF coordinates), yaw, pitch, and radius. Setting any of these recomputes the derived position / upVector and the view matrix.

Pure state — behaviour is provided by standalone functions (setGeospatialOrientation, attachGeospatialControls, flyGeospatialCameraToAsync). The camera never references the scene.

interface GeospatialCamera {
    center: Vec3;
    children: SceneNode[];
    farPlane: number;
    fov: number;
    limits: GeospatialLimits;
    name?: string;
    nearPlane: number;
    ortho?: OrthographicBounds | null;
    parent: IWorldMatrixProvider | null;
    pitch: number;
    position: Vec3;
    radius: number;
    upVector: Vec3;
    viewport?: NormalizedViewport;
    worldMatrix: Mat4;
    worldMatrixVersion: number;
    yaw: number;
}

Hierarchy (View Summary)

Index
center: Vec3

The anchored point on the globe (ECEF). Assigning re-orbits around the new centre.

children: SceneNode[]
farPlane: number
fov: number

Limits governing yaw/pitch/radius clamping. Mutable; clamping applies on the next orientation change.

name?: string

Optional source/debug name. Imported glTF cameras use the glTF camera name, or camera{index} when the source definition is unnamed.

nearPlane: number
ortho?: OrthographicBounds | null

Live orthographic view-volume extents, installed by enableOrthographicCamera and mutable/animatable thereafter. Null or undefined means the camera projects perspectively through fov.

parent: IWorldMatrixProvider | null
pitch: number

Pitch from looking straight down (0) to the horizon (π/2). Wrapped to [-π, π).

position: Vec3

Derived world-space eye position. Read-only — driven by center/yaw/pitch/radius.

radius: number

Distance from the camera to its centre point (distinct from planetRadius).

upVector: Vec3

Derived camera up vector. Read-only.

worldMatrix: Mat4

World-space 4×4 column-major matrix. May trigger lazy recomputation.

worldMatrixVersion: number

Monotonically increasing counter — bumped each time worldMatrix recomputes. Children snapshot this value to detect when their parent has changed. Must never decrease: _cameraChangeKey sums it with the projection revision and relies on that to detect every change without aliasing.

yaw: number

Yaw about the geocentric up axis. Wrapped to [-π, π). 0 = north, π/2 = east.