OptionalobjectProcessor: IObjectProcessorCalls dispose on current old environment map, background map when it is changed. Runtime only (not serialized)
Defines the background of the scene.
Valid inputs are:
Custom property for background tint, or just background color rendered in the shader
The intensity for the background color and map.
The rotation of the background in radians. Only influences environment maps assigned to .background.
Default is (0,0,0).
Enable/Disable tonemapping selectively for the background. Note - This requires both TonemapPlugin and GBufferPlugin or DepthBufferPlugin to be in the viewer to work.
Array with object's children.
ReadonlydefaultThe default camera in the scene. This camera is always in the scene and used by default if no camera is set as main. It is also saved along with the scene JSON and shown in the UI. This is added to the scene root, hence not saved in the glTF when a scene glb is exported.
The default environment map used when rendering materials in the scene
The intensity for the environment light.
The rotation of the environment map in radians. Only influences physical materials in the scene when
.environment is used. Default is (0,0,0).
Fixed direction environment reflections irrespective of camera position.
Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
Unique number of the object instance. Expects a Integer
Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
String to match to the children's Object3D.name property.
Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.
the property name to search for.
value of the given property.
ReadonlyisReadonlymodelThe root object where all imported objects are added.
OptionalobjectObject's parent in the scene graph.
Extra textures/envmaps that can be used by objects/materials/plugins and will be serialized.
Executes the callback on this object and all descendants.
Executes the callback on all ancestors.
Traverse only upgraded objects with extra options
Like traverse, but the callback will only be executed for visible objects
Protected_use enableAutoNearFar and disableAutoNearFar instead.
Main camera that the user controls
Main camera that the user controls
Camera that in currently being rendered.
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Add any object to the scene.
Optionaloptions: AddObjectOptionsAdd any processed scene object to the scene.
Optionaloptions: AddObjectOptionsrenamed to addObject
Optionalobj: IObject3D<For Programmatically toggling autoNearFar. This property is not supposed to be in the UI or serialized. Use camera.userData.autoNearFar for UI and serialization This is used in PickingPlugin, editor plugins autoNearFar will still be disabled if this is true and camera.userData.autoNearFar is false
Dispose the scene and clear all resources.
Dispose and optionally remove all textures set directly on this scene.
Refreshes the scene active camera near far values, based on the scene bounding box. This is called automatically every time the camera fov is updated.
Find objects by name exact match in the complete hierarchy.
name
Optionalparent: IObject3D<optional root node to start search from
Array of found objects
Use getObjectByName instead.
Deserialize the scene properties
object from toJSON
Optionalmeta: anyReturns the bounding box of the whole scene (model root and other meta objects).
To get the bounds of just the objects added by the user(not by plugins) use new Box3B().expandByObject(scene.modelRoot)
OptionalignoreObject: (obj: Object3D) => booleanLoad model root scene exported to GLTF format. Used internally by ThreeViewer.addSceneObject.
Optionaloptions: AddObjectOptionsOptionalev: {Refreshes the scene active camera near far values, based on the scene bounding box. This is called automatically every time the camera is updated.
Optionalevent: Partial<({ object: IObject3D<IObject3DEventMap, IGeometry<NormalBufferAttributes, BufferGeometryEventMap> | undefined, IMaterial<...> | ... 1 more ... | undefined>; geometry: IGeometry<...>; bubbleToParent: boolean; } & AnyOptions & { ...; }) | ({ ...; } & Omit<...>) | { ...; }> & ISceneSetDirtyOptions & { ...; }renamed to clearSceneModels
The object to point at.
The distance offset from the object to point at.
The distance offset for the target from the center of object to point at.
Sets the backgroundColor property from a string, number or Color, and updates the scene.
Note that when setting a Color object, it will be cloned.
Mark the scene dirty, and force render in the next frame.
Optionaloptions: ISceneSetDirtyOptionsset refreshScene to true to mark that any object transformations have changed. It might trigger effects like frame fade depening on plugins.
Toggle the background between texture and environment map.
Toggle the background between color and transparent.
Serialize the scene properties
Optionalmeta: anyEquivalent to setDirty({refreshScene: true}), dispatches 'sceneUpdate' event with the specified options.
Optionaloptions: AnyOptions
Create a scene instance. This is done automatically in the ThreeViewer and must not be created separately.