Methods
autorotate(opts)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
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)
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.mouseViewMode |
'drag' | 'qtvr' | |
opts.dragMode |
'pan' | 'pinch' | |
opts.scrollZoom |
boolean |
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:
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. |