Global

Methods

autorotate(opts)

Parameters:
Name Type Description
opts Object
Properties
Name Type Attributes Default Description
yawSpeed Number <optional>
0.1

Yaw maximum speed

pitchSpeed Number <optional>
0.1

Pitch maximum speed

fovSpeed Number <optional>
0.1

Fov maximum speed

yawAccel Number <optional>
0.01

Yaw acceleration

pitchAccel Number <optional>
0.01

Pitch acceleration

fovAccel Number <optional>
0.01

Fov acceleration

targetPitch Number <optional>
0

Value that pitch converges to. null means that the pitch will not change.

targetFov Number <optional>
null

Value that fov converges to. null means that the fov will not change.

Returns:

Movement function that can be passed to Viewer#setIdleMovement or Scene#startMovement

calcRect(totalWidth, totalHeight, spec, result)

Converts a RectSpec into an equivalent Rect.

A RectSpec is a convenient user API format, providing default values and the flexibility of specifying absolute, relative or mixed dimensions.

A Rect is a more convenient format for the rendering pipeline. It is always expressed in normalized coordinates, and all its properties are guaranteed to be present.

Parameters:
Name Type Description
totalWidth number

The total width of the rendering area in pixels.

totalHeight number

The total height of the rendering area in pixels.

spec RectSpec

The input spec, defaulting to the full rendering area if null or undefined.

result Rect

The output spec. If the argument is present, it is filled in and returned; otherwise, a fresh object is returned.

registerDefaultControls(controls, element, opts, mouseViewMode)

Instantiate and register some commonly used ControlMethod instances.

The following instances are registered:

  • mouseViewDrag
  • mouseViewQtvr
  • touchView
  • pinch
  • arrowKeys
  • plusMinusKeys
  • wasdKeys
  • qeKeys
Parameters:
Name Type Description
controls Controls

Where to register the instances.

element Element

Element to listen for events.

opts Object
mouseViewMode 'drag' | 'qtvr'

registerDefaultRenderers(stage)

Registers all known renderers for the given stage type into that stage. Most users will not need to register renderers, as Viewer does it for them.

Parameters:
Name Type Description
stage Stage

The stage where the renderers are to be registered.

Throws:

An error if the stage type is unknown.

Type Definitions

FlatViewLimiter(params) → {FlatViewParams}

View limiter for a FlatView.

A view limiter is a function that receives a FlatViewParams object, optionally modifies it in place, and returns it. It can be used to enforce constraints on the view parameters.

See FlatView.limit for commonly used limiters. They may be composed together or with user-defined limiters with util.compose.

Parameters:
Name Type Description
params FlatViewParams
Returns:
Type
FlatViewParams

RectilinearViewLimiter(params) → {RectilinearViewParams}

View limiter for a RectilinearView.

A view limiter is a function that receives a RectilinearViewParams object, optionally modifies it in place, and returns it. It can be used to enforce constraints on the view parameters.

See RectilinearView.limit for commonly used limiters. They may be composed together or with user-defined limiters with util.compose.

Parameters:
Name Type Description
params RectilinearViewParams
Returns:
Type
RectilinearViewParams

TileState

Return type for TextureStore#query.

Type:
  • Object
Properties:
Name Type Description
visible boolean

Whether the tile is in the visible set.

previouslyVisible boolean

Whether the tile is in the previously visible set.

hasAsset boolean

Whether the asset for the tile is present.

hasTexture boolean

Whether the texture for the tile is present.

pinned boolean

Whether the tile is in the pinned set.

pinCount number

The pin reference count for the tile.