Scene

Top level for a scene, which contains a Graph and hierarchy of SceneObjects. A Scene is itself a SceneObject, so it can have components and be in a hierarchy of another Scene.

Constructor

new L3D.Scene()

Extends

Properties

active bool

Is this scene the current active scene?

Overrides:
filename String

Get the filename of the asset.

graph Graph

The top level scene graph

icon String

The icon to use for the scene's node.

Overrides:
id String

The unique identifier of the object. Changing a node's ID can have unintended consequences.

Overrides:
isLoaded bool

True if the asset has finished loading.

Overrides:
isLoading bool

True if the asset is in the process of loading.

isPlaying bool

Is the scene currently being played?

Overrides:
isValid bool

True if the asset does not have an error.

Overrides:
name String

The name of the object.

onAwake Signal

Emitted when objects become active.

Overrides:
onError Signal

Emitted when there was an error loaading the asset.

onFixedUpdate Signal

Emitted to run fixedUpdate functions.

onGetRenderCameras Signal

Emitted to get cameras from objects.

onGetRenderInstances Signal

Emitted to get RenderInstances from objects.

onGetRenderLights Signal

Emitted to get lights from objects.

onGraphChanged Signal

Emitted when the graph for the scene has changed.

onLateUpdate Signal

Emitted after the update process.

Overrides:
onLoad Signal

Emitted after the scene is loaded.

Overrides:
onLoading Signal

Emitted when the asset has started loading.

Overrides:
onModified Signal

Fired when the object has been modified.

Overrides:
onNameChanged Signal

Fired when the object's name changes.

onObjectAdded Signal

Emitted when an object is added.

onObjectRemoved Signal

Emitted when an object is removed.

onPostDraw Signal

Emitted after drawing finishes.

onPreDraw Signal

Emitted before drawing starts.

onPreLoad Signal

Emitted before the scene is loaded.

onPreUpdate Signal

Emitted before the update function.

onStart Signal

Emitted when the scene starts playback.

Overrides:
onStateChange Signal

Emitted when the state of the asset has changed.

onStop Signal

Emitted when an scene stops playback.

Overrides:
onUpdate Signal

Emitted to run update functions.

onUpdateSceneUniforms Signal

Emitted to let objects update render uniforms.

onXRSupportChanged Signal

Emitted when the state of XR support changes.

Overrides:
path String

The URL of the asset.

scene Scene

The scene that owns this scene, is itself.

selectable bool

Is the scene selectable?

Overrides:
state number

Inidicates whether the asset is Unloaded, Loading, Loaded, or Error. The onStateChange signal will be emitted when the state's value changes.

visible bool

Is the scene rendered?

Methods

clone(options) → Object

Overrides:

Creates a clone of this object.

Parameters
options Object

Options for the clone method.

Returns
Object

configure(o)

Overrides:

Load the object data from JSON.

Parameters
o Object

The data object to load.

destroy()

Overrides:

Destroy any render assets created by the asset.

getPropertyInfo(path) → Object

Overrides:

Get information about a particular property of this object.

Parameters
path String
Returns
Object

getRenderAsset(gl)RenderAsset

Overrides:

Get a RenderAsset for this asset. If a RenderAsset hadn't been requested for the given GLContext yet, a new one will be created. Otherwise the previous one will be updated and returned.

A RenderAsset is the WebGL version of the asset, such as the GLTexture for an Texture asset. Because the editor has multiple GLContexts, RenderAssets are generated for each GLContext that requires it.

Parameters
gl GLContext
Returns
RenderAsset

requestUpdate()

Update the scene, but deferred so that multiple calls to update will be consolidated.

reset()

Clear all content from the Scene.

serialize()

Overrides:

Serialize the scene to a JSON object.

setModified()

Overrides:

Fires the objects onModified signal.

toJSON() → Object

Overrides:

Serialize the object to a JSON structure

Returns
Object

The serialized version of the object.

updateRenderAsset(renderAsset)

Overrides:

Update the given RenderAsset.

Parameters
renderAsset RenderAsset

The RenderAsset to update.