Class: RendererEvents

og/renderer/RendererEvents~RendererEvents

Renderer events handler.

new RendererEvents(renderer)

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.
renderer Object renderer Renderer instanve.

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.
renderer Object renderer Renderer instanve.

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