Class: A3dViewer
Extends
Viewer
Constructors
Constructor
new A3dViewer(
_engine
,_options?
):A3dViewer
Parameters
Parameter | Type |
---|---|
_engine | AbstractEngine |
_options? | Readonly <Partial <{ }>> |
Returns
A3dViewer
Inherited from
Viewer.constructor
Properties
Accessors
_shouldRender
Get Signature
get
protected
_shouldRender():boolean
Returns
boolean
Overrides
Viewer._shouldRender
aoStrength
Get Signature
get aoStrength():
number
Returns
number
Set Signature
set aoStrength(
value
):void
Parameters
Parameter | Type |
---|---|
value | number |
Returns
void
camera
Get Signature
get camera():
ArcRotateCamera
Returns
ArcRotateCamera
cameraLimit
Get Signature
get cameraLimit():
boolean
Returns
boolean
Set Signature
set cameraLimit(
value
):void
Parameters
Parameter | Type |
---|---|
value | boolean |
Returns
void
cameraReframe
Get Signature
get cameraReframe():
boolean
Returns
boolean
Set Signature
set cameraReframe(
value
):void
Parameters
Parameter | Type |
---|---|
value | boolean |
Returns
void
forceRender
Set Signature
set forceRender(
value
):void
Set the forceRender flag
Parameters
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set |
Returns
void
loadedModels
Get Signature
get loadedModels(): readonly
Model
[]
Return the list of currently loaded models. Note that only models loaded through the addModel method are tracked.
Returns
readonly Model
[]
The list of loaded models.
rendererOptions
Get Signature
get rendererOptions():
DeepReadonly
<RendererOptions
>
Returns
scene
Get Signature
get scene():
Scene
Get the scene of the viewer
Returns
Scene
The scene
Methods
_reframeCamera()
protected
_reframeCamera(interpolateCamera?
):void
Parameters
Parameter | Type |
---|---|
interpolateCamera? | boolean |
Returns
void
Overrides
Viewer._reframeCamera
_updateCameraLimits()
protected
_updateCameraLimits():void
Returns
void
addModel()
addModel(
source
,metadata
,options?
):Promise
<Model
>
Add a model to the viewer. Will trigger a modelchange event
Parameters
Parameter | Type | Description |
---|---|---|
source | string | The source of the model to load. |
metadata | { } | - |
options? | any | The options to use when loading the model. |
Returns
Promise
<Model
>
The loaded model.
cameras()
cameras():
A3dModelCamera
[]
Helper method to get all cameras in the viewer related to the loaded models
Returns
The list of cameras
focusCamera()
focusCamera(
cameraName
,modelIndex
,interpolate
):Promise
<boolean
>
Focus the camera on a specific camera in a model If no modelIndex is provided, the first camera found will be used.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
cameraName | string | undefined | The name of the camera to focus on |
modelIndex | null | number | undefined | The index of the model in the loadedModels list |
interpolate | boolean | true | If true, the camera will interpolate to the new position |
Returns
Promise
<boolean
>
True if the camera was found and focused, otherwise false
frameCamera()
frameCamera(
interpolateCamera?
):void
Reframe the camera around all models on the scene
Parameters
Parameter | Type | Description |
---|---|---|
interpolateCamera? | boolean | If true, the camera will interpolate to the new position |
Returns
void
frameModels()
frameModels(
models
,interpolateCamera?
):void
Parameters
Parameter | Type |
---|---|
models | Model [] |
interpolateCamera? | boolean |
Returns
void
getWorldHotSpotToRef()
getWorldHotSpotToRef(
query
,result
):boolean
Returns whether a world hot spot was found and updates the result with world and canvas coordinates, as well as visibility status.
Parameters
Parameter | Type | Description |
---|---|---|
query | Readonly <ViewerHotSpotQuery > | Position and normal information to query the hot spot positions. |
result | ViewerHotSpotResult | Reference to be updated with the hot spot coordinates and visibility. |
Returns
boolean
True if a hot spot was found, otherwise false.
markSceneMutated()
markSceneMutated():
void
Indicates if the scene has been mutated to trigger a re-render useful when the scene is mutated outside of the viewer and the rendering is suspended
Returns
void
notifyCameraObserver()
notifyCameraObserver():
void
Returns
void
refreshShadows()
refreshShadows(
params?
):void
Parameters
Parameter | Type |
---|---|
params? | any |
Returns
void
removeModel()
removeModel(
model
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
model | Model |
Returns
Promise
<void
>
userMeshFilterPredicate()
userMeshFilterPredicate(
mesh
):boolean
Predicate to filter user meshes in the scene. This is used to identify meshes that are user-created and should be considered for camera framing or other user-specific operations.
Parameters
Parameter | Type | Description |
---|---|---|
mesh | AbstractMesh | The mesh to check. |
Returns
boolean
True if the mesh is a user mesh, false otherwise.