Constructor
new GrWorld(params)
Construct an empty world
Parameters:
Name | Type | Description |
---|---|---|
params |
GrWorldProperties |
- Source:
Members
active_object :GrObject
Type:
- GrObject
- Source:
animCount :Number
Type:
- Number
- Source:
camera :THREE.PerspectiveCamera
Type:
- THREE.PerspectiveCamera
- Source:
objCount :Number
Type:
- Number
- Source:
objects :Array.<GrObject>
Type:
- Array.<GrObject>
- Source:
objNames :Object
Type:
- Object
- Source:
renderer :THREE.WebGLRenderer
Type:
- THREE.WebGLRenderer
- Source:
runbutton :HTMLInputElement
Type:
- HTMLInputElement
- Source:
speedcontrol :HTMLInputElement
Type:
- HTMLInputElement
- Source:
Methods
add(grobj)
Add an object to the world - this takes care of putting everything into the scene, as well as assigning IDs
Parameters:
Name | Type | Description |
---|---|---|
grobj |
GrObject |
- Source:
animate(callbacksopt)
perform a cycle of the animation loop - this measures the time since the last redraw and advances that much before redrawing
because draw is part of animate, the callbacks are handled here
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callbacks |
WorldCallbacks |
<optional> |
- Source:
draw()
draw the default camera to the default renderer
- Source:
enableVR()
adds VR capability
- Source:
go(callbacks)
start an (endless) animation loop - this just keeps going
Parameters:
Name | Type | Description |
---|---|---|
callbacks |
WorldCallbacks |
- Source:
stepWorld()
advance all of the objects
- Source:
viewStats()
adds performance stats to the DOM
- Source: