Viewer settings
Functions
parseCameraSettings()
function parseCameraSettings(input): CameraSettings;
Canonical, finite camera values shared by attributes and URL search parameters.
Parameters
| Parameter | Type |
|---|---|
input | { cameraOrbit?: unknown; cameraTarget?: unknown; fieldOfView?: unknown; } |
input.cameraOrbit? | unknown |
input.cameraTarget? | unknown |
input.fieldOfView? | unknown |
Returns
normalizeEnvironmentRotation()
function normalizeEnvironmentRotation(input): number | undefined;
Finite yaw in degrees, wrapped into [0, 360); invalid values are ignored.
Parameters
| Parameter | Type |
|---|---|
input | unknown |
Returns
number | undefined
parseViewerSettings()
function parseViewerSettings(input, assets?): Partial<ViewerSettings>;
Parameters
| Parameter | Type |
|---|---|
input | Record<string, unknown> |
assets? | { ibls?: readonly string[]; geometries?: readonly string[]; } |
assets.ibls? | readonly string[] |
assets.geometries? | readonly string[] |
Returns
Partial<ViewerSettings>
Interfaces
CameraSettings
Optional declarative framing. Geometry is normalized to a one-meter cube before framing.
Properties
RenderingSettings
Properties
| Property | Type |
|---|---|
bloom | boolean |
ao | boolean |
toneMapping | "neutral" | "aces" | "agx" | "reinhard" | "cineon" | "linear" | "none" |
SettingsOption
Properties
| Property | Type |
|---|---|
value | string |
label | string |
Type Aliases
ToneMappingName
type ToneMappingName = typeof TONE_MAPPING_OPTIONS[number]["value"];
BackgroundKind
type BackgroundKind = typeof BACKGROUND_OPTIONS[number]["value"];
AnimationMode
type AnimationMode = false | "play" | "pause" | undefined;
false hides the play/pause control; 'play'/'pause' set the initial state; undefined plays.
ViewerSettings
type ViewerSettings = Omit<typeof DEFAULT_VIEWER_SETTINGS, "ibl" | "geometry"> & CameraSettings & object;
Asset names may include host-configured environments and geometries.
Type Declaration
| Name | Type |
|---|---|
ibl | string |
geometry | string |
Variables
TONE_MAPPING_OPTIONS
const TONE_MAPPING_OPTIONS: readonly [{
value: "neutral";
label: "Neutral";
}, {
value: "aces";
label: "ACES Filmic";
}, {
value: "agx";
label: "AgX";
}, {
value: "reinhard";
label: "Reinhard";
}, {
value: "cineon";
label: "Cineon";
}, {
value: "linear";
label: "Linear";
}, {
value: "none";
label: "None";
}];
Tone mapping names shared by viewer controls and extension configuration.
DEFAULT_RENDERING_SETTINGS
const DEFAULT_RENDERING_SETTINGS: RenderingSettings;
GEOMETRY_OPTIONS
const GEOMETRY_OPTIONS: SettingsOption[];
IBL_OPTIONS
const IBL_OPTIONS: SettingsOption[];
BACKGROUND_OPTIONS
const BACKGROUND_OPTIONS: readonly [{
value: "white";
label: "White";
}, {
value: "environment";
label: "Environment";
}, {
value: "none";
label: "None";
}];
none lights the scene with the IBL but leaves the backdrop transparent (clear alpha 0).
DEFAULT_VIEWER_SETTINGS
const DEFAULT_VIEWER_SETTINGS: object;