Scene

Render node is a logical part of a render mechanism. Represents scene rendering. For example one scene node for rendering the Earth, another one for rendering the Moon, another node for rendering stars etc. Each render node has own model view space defined with matrices(scale, rotation, translation, transformation). There are collections of light sources, entities and so on in the node. Access to the node is renderer.scenes["Earth"]

Constructor

new Scene(name)

Parameters:
NameTypeDescription
namestring

Node name.

Methods

(protected) _clear()

Clear current node.

addEntityCollection(entityCollection, isHiddenopt) → {Scene}

Adds entity collection.

Parameters:
NameTypeAttributesDescription
entityCollectionEntityCollection

Entity collection.

isHiddenboolean<optional>

If it's true that this collection has specific rendering.

Returns:
Type: 
Scene

addNode()

Adds node to the current hierarchy.

assign(renderer)

Assign render node with renderer.

Parameters:
NameTypeDescription
rendererRenderer

Render node's renderer.

destroy()

Destroy node.

draw()

Calls render frame node's callback. Used in renderer.

drawPickingEntityCollections(ec)

Draw entity collections picking frame.

Parameters:
NameTypeDescription
ecArray.<EntityCollection>

Entity collection array.

isActive() → {Boolean}

Gets render node activity.

Returns:
Type: 
Boolean

preDraw()

Calls render frame node's callback. Used in renderer.

removeEntityCollection(entityCollection)

Removes entity collection.

Parameters:
NameTypeDescription
entityCollectionEntityCollection

Entity collection for remove.

setActive(isActive)

Rendering activation.

Parameters:
NameTypeDescription
isActiveboolean

Activation flag.

setDrawMode(mode)

Sets draw mode

Parameters:
NameTypeDescription
modeNumber

Draw mode, such as gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.LINES etc.