Creates a Viewer.
Viewer configuration.
Optional
id?: stringID for this Viewer, automatically generated by default.
Optional
origin?: FloatArrayParamThe Real-space 3D origin, in current measurement units, at which the World-space coordinate origin [0,0,0]
sits.
Manages rendering of models.
Optional
scale?: numberThe number of Real-space units in each World-space coordinate system unit.
Optional
scene?: SceneContains model representations.
Optional
units?: stringThe measurement unit type. Accepted values are "meters"
, "metres"
, , "centimeters"
, "centimetres"
, "millimeters"
, "millimetres"
, "yards"
, "feet"
and "inches"
.
SDKError The given Renderer is already attached to some other Viewer.
Readonly
capabilitiesIndicates the capabilities of this Viewer.
Readonly
destroyedTrue once this Viewer has been destroyed.
Don't use this Viewer if this is false
.
Protected
dirtyReadonly
idID of this Viewer.
Readonly
rendererThe 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.
Readonly
sceneThe Viewer's scene representation.
The SceneModels is the container of SceneModels and SceneObjects, which contain the geometry and materials for models currently loaded in the Viewer.
Readonly
startThe 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
Internal
viewList of all the Views in this Viewer.
Each @xeokit/viewer!View is an independently configurable view of the Viewer's models, with its own canvas, camera position, section planes, lights, and object visual states.
Readonly
viewsMap of all the Views in this Viewer.
Each @xeokit/viewer!View is mapped here against View.id.
Each @xeokit/viewer!View is an independently configurable view of the Viewer's models, with its own canvas, camera position, section planes, lights, and object visual states.
Protected
cleanProtected
cleanCreates a new @xeokit/viewer!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.
Protected
setEmits an event when the Component has been destroyed.
Readonly
onEmits an event each time a message is logged.
Readonly
onEmits an event each time a Viewer "tick" occurs (~10-60 times per second).
Readonly
onEmits an event each time a @xeokit/viewer!View is created.
Readonly
onEmits an event each time a @xeokit/viewer!View is destroyed.
The xeokit SDK's Browser-based model viewer.
See @xeokit/viewer for usage.