Class: Renderer

og/renderer/Renderer~Renderer

new Renderer(handler, params)

Represents high level WebGL context interface that starts WebGL handler works 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.

camerasArray.<og.Camera>

Cameras array.

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.

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.

sceneFramebufferog.webgl.Framebuffer og.webgl.MultiFramebuffer

Whole scene rendering framebuffer.

Methods

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.

addPickingCallback(sender, callback)

Adds picking rendering callback function.
Name Type Description
sender object Callback context.
callback og.Renderer~pickingCallback Rendering callback.

addRenderNode(renderNode)

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

addRenderNodes(nodesArr)

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

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.

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.

isMultiFramebufferCompatible(){Boolean}

Returns true if 'WEBGL_draw_buffers' extension initialized.
Returns:
Type Description
Boolean -

removeControl(control){og.Renderer}

Remove control from the renderer.
Name Type Description
control og.control.Control Control.
Returns:
Type Description
og.Renderer -
Function starts rendering.