Class: RendererEvents

og.RendererEvents

new og.RendererEvents(renderer)

Renderer events handler.
Name Type Description
renderer og.Renderer Renderer object, events that works for.

Members

mouseStateObject

Current mouse state.
Properties:
Name Type Default Description
x Object 0 Current mouse X position.
y Object 0 Current mouse Y position.
nx Object 0 Current mouse X position from 0 to 1
ny Object 0 Current mouse Y position from 0 to 1
prev_x Object 0 Previous mouse X position.
prev_y Object 0 Previous mouse Y position.
direction Object Screen mouse position world direction.
leftButtonUp Object false Left mouse button has stopped pushing down right now.
rightButtonUp Object false Right mouse button has stopped pushing down right now.
middleButtonUp Object false Middle mouse button has stopped pushing down right now.
leftButtonDown Object false Left mouse button has pushed now.
rightButtonDown Object false Right mouse button has pushed now.
middleButtonDown Object false Middle mouse button has pushed now.
leftButtonHold Object false Left mouse button is pushing.
rightButtonHold Object false Right mouse button is pushing.
middleButtonHold Object false Middle mouse button is pushing.
leftButtonDoubleClick Object false Left mouse button has clicked twice now.
rightButtonDoubleClick Object false Right mouse button has clicked twice now.
middleButtonDoubleClick Object false Middle mouse button has clicked twice now.
leftButtonClick Object false Left mouse button has clicked now.
rightButtonClick Object false Right mouse button has clicked now.
middleButtonClick Object false Middle mouse button has clicked now.
moving Object false Mouse is moving now.
justStopped Object false Mouse has just stopped now.
doubleClickDelay Object 300 Mose double click delay response.
wheelDelta Object 0 Mouse wheel.
sys Object null JavaScript mouse system event message.
pickingObject Object null Current picking object.

rendererog.Renderer

Assigned renderer.

touchStateObject

Current touch state.
Properties:
Name Type Default Description
moving Object false Touching is moving now.
touchEnd Object false Touch has ended right now.
touchStart Object false Touch has started right now.
touchCancel Object false Touch canceled.
doubleTouch Object false Touched twice.
doubleTouchDelay Object 550 Double touching responce delay.
doubleTouchRadius Object 10 Double touching responce radius in screen pixels.
x Object 0 Current touch X - coordinate.
y Object 0 Current touch Y - coordinate.
nx Object 0 Current touch X - coordinate from 0 to 1
ny Object 0 Current touch Y - coordinate from 0 to 1
prev_x Object 0 Previous touch X coordinate.
prev_y Object 0 Previous touch Y coordinate.
sys Object null JavaScript touching system event message.
pickingObject Object null Current touched(picking) object.

Methods

Used in render node frame.
Renderer events initialization.

isKeyPressed(keyCode){boolean}

Check key is pressed.
Name Type Description
keyCode number Key code
Returns:
Type Description
boolean

on(name, callback, key, sender, priority)

Set render event callback.
Name Type Description
name string Event name
callback eventCallback Callback function
key number optional Key code from og.input
sender * Callback context
priority number optional Event callback priority

Events

Triggered when double touch.
Triggered before scene frame is rendered(before render nodes).
Mouse left button clicked.
Mouse left button double click.
Mouse left button is just pressed down(start pressing).
Mouse left button is pressing.
Mouse left button up(stop pressing).
Mouse middle button clicked.
Mouse middle button double click.
Mouse middle button is just pressed down(start pressing).
Mouse middle button is pressing.
Mouse is moving.
Mouse is just stopped.
Mouse wheel is rotated.
Mouse middle button up(stop pressing).
Mouse right button clicked.
Mouse right button double click.
Mouse right button is just pressed down(start pressing).
Triggered when screen is resized.
Mouse right button is pressing.
Mouse right button up(stop pressing).
Triggered when touching cancel.
Triggered when touching ends.
Triggered when touch enter picking object.
Triggered when touch leaves picked object.
Triggered when touch is move.
Triggered when touching starts.