Class UNIVERSE.Universe

Class Summary
Constructor Attributes Constructor Name and Description
 
UNIVERSE.Universe(time, refreshRate, container)
A simple Universe for drawing 3D modeling and simulation using WebGL
Method Summary
Method Attributes Method Name and Description
 
addJsonGeometryModel(modelId, modelUrl, callback)
Add a geometry to the universe with an ID and url to retrieve the model's geometry
 
addObject(object)
Add an object to the universe
 
draw(id, mesh, isScale)
Draws an object in the Universe
 
Get the current time of the Universe
 
Get a graphics object by its id
 
Get all of the objects currently in the Universe
 
Retrieves an object from the Universe.js object pipeline
 
Pause playback for the universe
 
play(startTime, newPlaybackSpeed, newStateChangedCallback)
Start playback for the universe
 
Remove all objects from the Universe
 
Remove an object completely from the Universe
 
setCurrentUniverseTime(newUniverseTime)
Set the current time of the Universe
 
setObjectInLibrary(id, object)
Add an object to the Universe.js object pipeline.
 
Set the playback speed for the Universe
 
Basic setup method, needs to be called after all objects are removed from the Universe
 
showObject(id, isEnabled)
Toggle whether an object is visible in the Universe
 
Snap the Universe's camera to be directly behind an object
 
unDraw(id)
Removes an object from the Universe
Class Detail
UNIVERSE.Universe(time, refreshRate, container)
A simple Universe for drawing 3D modeling and simulation using WebGL
Parameters:
{Date} time
- The current universe time
{double} refreshRate
- The refresh rate for the universe in milliseconds
{DOMElement} container
- the container where the Universe will be drawn
Method Detail
addJsonGeometryModel(modelId, modelUrl, callback)
Add a geometry to the universe with an ID and url to retrieve the model's geometry
Parameters:
{string} modelId
{string} modelUrl
- URL for the THREE.js format geometry model
{function} callback
- callback function that gets called when the geometry is done loading

addObject(object)
Add an object to the universe
Parameters:
{UNIVERSE.GraphicsObject} object

draw(id, mesh, isScale)
Draws an object in the Universe
Parameters:
{string} id
- identifier for the object
{THREE.Mesh} mesh
- THREE.js mesh for the object
{boolean} isScale
- specifies whether the object should be scaled to always be the same as the camera moves

getCurrentUniverseTime()
Get the current time of the Universe

getGraphicsObjectById(id)
Get a graphics object by its id
Parameters:
{string} id

getGraphicsObjects()
Get all of the objects currently in the Universe

getObjectFromLibraryById(id, callback)
Retrieves an object from the Universe.js object pipeline
Parameters:
{string} id
- identifier for the object
{function} callback
- method to be called with the retrieved object

pause()
Pause playback for the universe

play(startTime, newPlaybackSpeed, newStateChangedCallback)
Start playback for the universe
Parameters:
{date} startTime
{double} newPlaybackSpeed
{function} newStateChangedCallback

removeAll()
Remove all objects from the Universe

removeObject(id)
Remove an object completely from the Universe
Parameters:
{string} id
- identifier for the object

setCurrentUniverseTime(newUniverseTime)
Set the current time of the Universe
Parameters:
{Date} newUniverseTime

setObjectInLibrary(id, object)
Add an object to the Universe.js object pipeline. This is useful for storing things that take up GPU memory like geometries so you can reuse them.
Parameters:
{string} id
- identifier for the object
{Object} object
- any object you want to store for later retrieval

setPlaybackSpeed(speed)
Set the playback speed for the Universe
Parameters:
{Double} speed

setup()
Basic setup method, needs to be called after all objects are removed from the Universe

showObject(id, isEnabled)
Toggle whether an object is visible in the Universe
Parameters:
{string} id
- identifier for the object
{boolean} isEnabled
- whether the object is visible or not

snapToObject(id)
Snap the Universe's camera to be directly behind an object
Parameters:
{string} id
- identifier for the object

unDraw(id)
Removes an object from the Universe
Parameters:
{string} id
- identifier for the object

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 16 2013 21:54:24 GMT-0700 (MST)