Class: Renderer

Renderer

new Renderer(handler, params)

Represents high level WebGL context interface that starts WebGL handler working in real time.
Name Type Description
handler og.webgl.Handler WebGL handler context.
params Object optional Renderer parameters:
Fires:
  • - Triggered before scene frame is rendered(before render nodes).
  • - Triggered when screen is resized.
  • - Mouse is moving.
  • - Mouse is just stopped.
  • - Mouse left button clicked.
  • - Mouse right button clicked.
  • - Mouse middle button clicked.
  • - Mouse left button double click.
  • - Mouse right button double click.
  • - Mouse middle button double click.
  • - Mouse left button up(stop pressing).
  • - Mouse right button up(stop pressing).
  • - Mouse middle button up(stop pressing).
  • - Mouse left button is just pressed down(start pressing).
  • - Mouse right button is just pressed down(start pressing).
  • - Mouse middle button is just pressed down(start pressing).
  • - Mouse left button is pressing.
  • - Mouse right button is pressing.
  • - Mouse middle button is pressing.
  • - Mouse wheel is rotated.
  • - Triggered when touching starts.
  • - Triggered when touching ends.
  • - Triggered when touching cancel.
  • - Triggered when touch is move.
  • - Triggered when double touch.
  • - Triggered when touch leaves picked object.
  • - Triggered when touch enter picking object.

Members

_pickingCallbacksArray.<og.Renderer~pickingCallback>

Color picking objects rendering queue.

activeCameraog.Camera

Current active camera.

protectedbillboardsTextureAtlasog.utils.TextureAtlas

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

colorObjectsObject

Hash table for drawing objects.

controlsObject

OpenGlobus controls array.

controlsBagObject

Provides exchange between controls.

divobject

Div element with WebGL canvas.
Renderer events. Represents interface for setting events like mousemove, draw, keypress etc.

fontAtlasog.utils.FontAtlas

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

handlerog.webgl.Handler

WebGL handler context.

pickingFramebufferog.webgl.Framebuffer

Picking objects(labels and billboards) framebuffer.

renderNodesObject.<og.scene.RenderNode>

Render nodes store for the comfortable access by the node name.

Methods

_drawEntityCollections(ec)

Draws entity collections.
Name Type Description
ec Array.<og.EntityCollection> Entity collection array.

addControl(control)

Add the given control to the renderer.
Name Type Description
control og.control.Control Control.

addControls(cArr)

Add the given controls array to the planet node.
Name Type Description
cArr Array.<og.control.Control> Control array.

addNode(renderNode)

Adds render node to the renderer.
Name Type Description
renderNode og.scene.RenderNode Render node.

addNodeBefore(renderNode)

Adds render node to the renderer before specific node.
Name Type Description
renderNode og.scene.RenderNode Render node.

addNodes(nodesArr)

Adds render nodes array to the renderer.
Name Type Description
nodesArr Array.<og.scene.RenderNode> Render nodes array.

addPickingCallback(sender, callback){Number}

Adds picking rendering callback function.
Name Type Description
sender object Callback context.
callback og.Renderer~pickingCallback Rendering callback.
Returns:
Type Description
Number Handler id

assignPickingColor(obj)

Assign picking color to the object.
Name Type Description
obj Object Object that pressume to be picked.

clearPickingColor(obj)

Removes picking color from object.
Name Type Description
obj Object Object to remove picking color.
Draw nodes.

enqueueEntityCollectionsToDraw()

TODO: replace with cahce frendly linked list by bilboardHandler, label handler etc.

getCenter(){og.math.Vec2}

Get center of the screen
Returns:
Type Description
og.math.Vec2 -

getHeight(){number}

Get the client height.
Returns:
Type Description
number -

getPickingObject(x, y){Object}

Returns picking object by screen coordinates
Name Type Description
x number X position
y number Y position
Returns:
Type Description
Object -

getWidth(){number}

Get the client width.
Returns:
Type Description
number -
Renderer initialization.

removeControl(control)

Remove control from the renderer.
Name Type Description
control og.control.Control Control.

removePickingCallback(id)

Removes picking rendering callback function.
Name Type Description
id Number Handler id to remove.

setEventsActivity(activity)

Sets renderer events activity.
Name Type Description
activity Boolean Events activity.
Function starts rendering.