Class: GrWorld

GrWorld.GrWorld(params)

GrWorld

The GrWorld is basically a wrapper around THREE.js's scene, except that it keeps a list of GrObject rather than Object3D.

It contains a scene (and it puts things into it for you). It also contains a renderer and a camera.

When this creates a renderer, it places it into the dom (see the where option).

By default, the world is created with a reasonable default renderer, camera and groundplane. Orbit controls are installed.

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:

autoUIGUI :Object|undefined

Type:
  • Object | undefined
Source:

autoUIOptions :GrWorldAutoUIOptions

Type:
  • GrWorldAutoUIOptions
Source:

camera :T.PerspectiveCamera

Type:
  • T.PerspectiveCamera
Source:

chkSolo :HTMLInputElement|undefined

Type:
  • HTMLInputElement | undefined
Source:

gui :any

Type:
  • any
Source:

objCount :Number

Type:
  • Number
Source:

objNames :Object

Type:
  • Object
Source:

objects :Array.<GrObject>

Type:
  • Array.<GrObject>
Source:

renderer :T.WebGLRenderer

Type:
  • T.WebGLRenderer
Source:

runbutton :Object|undefined

Type:
  • Object | undefined
Source:

selectLook :HTMLSelectElement|undefined

Type:
  • HTMLSelectElement | undefined
Source:

selectRideable :HTMLSelectElement|undefined

Type:
  • HTMLSelectElement | undefined
Source:

selectViewMode :HTMLSelectElement|undefined

Type:
  • HTMLSelectElement | undefined
Source:

speedcontrol :Object|undefined

Type:
  • Object | undefined
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:

getAutoUIOptions() → {GrWorldAutoUIOptions}

Get the AutoUI defaults for this world.

Source:
Returns:
Type
GrWorldAutoUIOptions

go(callbacks)

start an (endless) animation loop - this just keeps going

Parameters:
Name Type Description
callbacks WorldCallbacks
Source:

setAutoUIOptions(options)

Set defaults for AutoUI controls in this world.

Parameters:
Name Type Description
options GrWorldAutoUIOptions
Source:

stepWorld()

advance all of the objects

Source:

viewStats()

adds performance stats to the DOM

Source: