Creates a Viewer.
Viewer configuration.
Optionalid?: stringID for this Viewer, automatically generated by default.
Optionalorigin?: FloatArrayParamThe Real-space 3D origin, in current measurement units, at which the World-space coordinate origin [0,0,0] sits.
Manages rendering of models.
Optionalscale?: numberThe number of Real-space units in each World-space coordinate system unit.
Optionalscene?: SceneContains model representations. A Scene can be attached to a maximum of one Viewer - don't share a Scene between multiple Viewers.
Optionalunits?: stringThe measurement unit type. Accepted values are "meters", "metres", , "centimeters", "centimetres", "millimeters", "millimetres", "yards", "feet" and "inches".
ReadonlycapabilitiesIndicates the capabilities of this Viewer.
ReadonlydestroyedTrue once this Viewer has been destroyed.
Don't use this Viewer if this is false.
ProtecteddirtyReadonlyidID of this Viewer.
The number of Views belonging to this Viewer.
The maxiumum number of Views that a Viewer can have is determined by the Renderer implementation it was configured with, which is provided in Capabilities.maxViews.
ReadonlyrendererThe Renderer that this Viewer was configured with via the Viewer's constructor. Th Renderer is only used by the Viewer, and is not intended to for users to use directly. It's provided via this property in order to verify which Render implementation the Viewer is configured with.
ReadonlysceneThe Viewer's scene representation.
The !SceneModel | SceneModels is the container of !SceneModel | SceneModels and !SceneObject | SceneObjects, which contain the geometry and materials for models currently loaded in the Viewer.
ReadonlystartThe time that this Viewer was created. This is the number of milliseconds since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.
Readonly InternalviewList of all the Views in this Viewer.
Each View is an independently configurable view of the Viewer's models, with its own canvas, camera position, section planes, lights, and object visual states.
ReadonlyviewsProtectedcleanForces this component to action any deferred state updates.
ProtectedcleanGives this component an opportunity to action any defered state updates.
Clears this Viewer.
Destroys all existing Views and resets all properties to their default values.
Creates a new View within this Viewer.
const view1 = myViewer.createView({
id: "myView",
elementId: "myView1"
});
if (view1 instanceof SDKError) {
console.log(view1.message);
} else {
view1.camera.eye = [-3.933, 2.855, 27.018];
view1.camera.look = [4.400, 3.724, 8.899];
view1.camera.up = [-0.018, 0.999, 0.039];
//...
}
View configuration.
Destroys this Viewer.
ProtectedsetFlags this component as having a defered state updates it needs to perform.
This method will "tickify" the provided cb function.
This means, the function will be wrapped so:
The function to tickify
Gets the current configuration of this Viewer.
Emits an event when the Component has been destroyed.
ReadonlyonEmits an event each time a message is logged.
ReadonlyonEmits an event each time a Viewer "tick" occurs (~10-60 times per second).
ReadonlyonEmits an event each time a View is created.
ReadonlyonEmits an event each time a View is destroyed.
3D model viewer.
See "@xeokit/sdk/viewer" for usage.