Class: RenderNode

RenderNode

Render node is a logical part of a render mechanism. Represents scene rendering. Forexample 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 ligh sources, entities and so on in the node. Access to the node is renderer.renderNodes["Earth"]

new RenderNode(name)

Name Type Description
name string Node name.

Extends

  • og.RenderNode

Members

entityCollectionsArray.<og.EntityCollection>

Entity collection array.

lightEnabledboolean

Lighting calculations.

rendererog.Renderer

Renderer that calls frame() callback.

show

Show rendering.

Methods

addEntityCollection(entityCollection, isHidden){og.scene.RenderNode}

Adds entity collection.
Name Type Description
entityCollection og.EntityCollection Entity collection.
isHidden boolean optional If it's true that this collection has specific rendering.
Returns:
Type Description
og.scene.RenderNode -

addLight(light){og.scene.RenderNode}

Adds point light source.
Name Type Description
light og.LightSource Light source.
Returns:
Type Description
og.scene.RenderNode
Adds node to the current hierarchy.

assign(renderer)

Assign render node with renderer.
Name Type Description
renderer og.Renderer Redner node's renderer.
Calls render frame node's callback. Used in renderer.

drawPickingEntityCollections(ec)

Draw entity collections picking frame.
Name Type Description
ec Array.<og.EntityCollection> Entity collection array.

getLightByName(name){og.LightSource}

Gets light object by its name.
Name Type Description
name string Point light name.
Returns:
Type Description
og.LightSource

isActive(){Boolean}

Gets render node activity.
Returns:
Type Description
Boolean -

removeEntityCollection(entityCollection)

Removes entity collection.
Name Type Description
entityCollection og.EntityCollection Entity collection for remove.

removeLight(light)

Removes light source.
Name Type Description
light og.LightSource Light source object.

setActive(isActive)

Rendering activation.
Name Type Description
isActive boolean Activation flag.

setDrawMode(mode)

Sets draw mode
Name Type Description
mode Number Draw mode, such as gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.LINES etc.

transformLights()

IMPORTANT: This function have to be called manualy in each render node frame callback, before drawing scene geometry.