Class: RenderNode

og/scene/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

protectedbillboardsTextureAtlasog.utils.TextureAtlas

Texture atlas for the billboards images. One atlas per node.

entityCollectionsArray.<og.EntityCollection>

Entity collection array.

fontAtlasog.utils.FontAtlas

Texture font atlas for the font families and styles. One atlas per node.

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

assignRenderer(renderer)

Assign render node with renderer.
Name Type Description
renderer og.Renderer Redner node's renderer.

drawEntityCollections()

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

drawPickingEntityCollections()

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.

transformLights()

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