Skip to content

Commit

Permalink
Merge branch 'CSS-Approach'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter John Larco committed Dec 15, 2015
2 parents 26e6c10 + ad4f2a7 commit d2f2f85
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 169 deletions.
91 changes: 73 additions & 18 deletions docs/Core/Editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,83 @@ None

### Constructor ###

* Editor(world, options)
* options{ autosave }
`Editor(world, options)`

world — A World instance to edit.
options.autosave — A quick way to set autosave to true or false.


### Properties ###

* enable()
* disable()
* isEnabled()
* enableAutoSave()
* disableAutoSave()
* canAutoSave()
* save()
* load()
* isSaved()
* deleteSave()
* export()
* import(exportString)
* add(voxel)
* remove(voxel)
* getWorld()
* setToolMesh(mesh)
`enable()`

Enables the editor. Default is enabled.

`disable()`

Disabled the editor.

`isEnabled()`

Returns true if the editor is currently enabled, else false.

`enableAutoSave()`

Enables autosaving: Saves on every voxel addition or removal.

`disableAutoSave()`

Disables autosaving.

`canAutoSave()`

Returns true if autosaving is on, else false.

`save()`

Saves the current editor's state to the browser's localStorage.

`load()`

Load the current world from the browser's localStorage for editing.

`isSaved()`

Returns true if the current world has a save in the browser's localStorage.

`deleteSave()`

Removes any saves of the current world in the browser's localStorage.

`export()`

Exports the current world's data into a string.

`import(exportString)`

exportString — A string returned from export()

Loads the data from an exportString into the current world.

`add(voxel)`

voxel — A voxel instance.

Adds a new voxel to the current editor.

`remove(voxel)`

voxel — A voxel instance.

Removes a voxel from the current editor.

`getWorld()`

Returns the current editing world.

`setToolMesh(mesh)`

Sets the mesh used to create new blocks when editing.


### Events ###
Expand Down
253 changes: 210 additions & 43 deletions docs/Core/Scene.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,220 @@ A Scene is simply a camera. It can rotate, pan, zoom, and contain voxels.

### Constructor ###

* Scene()
`Scene()`


### Properties ###

* rotate(x, y, z)
* rotateX(x)
* rotateY(y)
* rotateZ(z)
* setRotation(x, y, z)
* setRotationX(x)
* setRotationY(y)
* setRotationZ(z)
* getRotation()
* getRotationX()
* getRotationY()
* getRotationZ()
* pan(x, y, z)
* panX(x)
* panY(y)
* panZ(z)
* setPan(x, y, z)
* setPanX(x)
* setPanY(y)
* setPanZ(z)
* getPan()
* getPanX()
* getPanY()
* getPanZ()
* zoom(zoom)
* setSoom(soom)
* getZoom()
* attach(domElement)
* detach()
* isAttached()
* getParentElement()
* enableOrbit()
* disableOrbit()
* canOrbit()
* enablePan()
* disablePan()
* canPan()
* enableZoom()
* disableZoom()
* canZoom()
* add(voxel)
* remove(voxel)
`rotate(x, y, z)`

x, y, z — Rotation offsets.

Offsets the current rotation. Ignores any undefined or non-numerical values.

`rotateX(x)`

x — x-axis rotation offset.

Offsets the x-axis rotation.

`rotateY(y)`

y — y-axis rotation offset.

Offsets the y-axis rotation.

`rotateZ(z)`

z — z-axis rotation offset.

Offsets the z-axis rotatation.

`setRotation(x, y, z)`

x, y, z — New rotations.

Sets the current rotation. Ignores any undefrined or non-numerical values.

`setRotationX(x)`

x — New x-axis rotation.

Sets the current rotation for the x-axis.

`setRotationY(y)`

y — New y-axis rotation.

Sets the current rotation for the y-axis.

`setRotationZ(z)`

z — New z-axis rotation.

Sets the current rotation for the z-axis.

`getRotation()`

Returns the x, y, z of the current rotation in a dict.

`getRotationX()`

Returns the current x-axis rotation.

`getRotationY()`

Returns the current y-axis rotation.

`getRotationZ()`

Returns the current z-axis rotation.

`pan(x, y, z)`

x, y, z — New pan offsets.

Offsets the current pan. Ignores any undefrined or non-numerical values.

`panX(x)`

x — x-axis pan offset.

Offsets the x-axis pan.

`panY(y)`

y — y-axis pan offset.

Offsets the y-axis pan.

`panZ(z)`

z — z-axis pan offset.

Offsets the z-axis pan.

`setPan(x, y, z)`

x, y, z — New pan values.

Sets the current pan. Ignores any undefrined or non-numerical values.

`setPanX(x)`

x — x-axis pan value.

Sets the x-axis pan.

`setPanY(y)`

y — y-axis pan value.

Sets the y-axis pan.

`setPanZ(z)`

z — z-axis pan value.

Sets the z-axis pan.

`getPan()`

Returns the x, y, z values of the current pan in a dict.

`getPanX()`

Returns the current x-axis pan.

`getPanY()`

Returns the current y-axis pan.

`getPanZ()`

Returns the current z-axis pan.

`zoom(zoom)`

zoom — New zoom offset.

Offsets the zoom.

`setSoom(soom)`

zoom — New zoom value.

Sets the zoom.

`getZoom()`

Returns the current zoom value.

`attach(domElement)`

domElement — The element to render this scene inside.

Renders the scene and all associated voxels in the provided domElement. Is absolutely positioned.

`detach()`

Removes this scene from the element previously attached to by attach(domElement)

`isAttached()`

Returns true if this scene is currently attached to the dom, else false.

`getParentElement()`

Returns the element containing the scene element.

`enableOrbit()`

Enables orbiting with the mouse.

`disableOrbit()`

Disables orbiting with the mouse.

`canOrbit()`

Returns true if orbiting is enabled, else false.

`enablePan()`

Enables pan with the mouse.

`disablePan()`

Disables pan with the mouse.

`canPan()`

Returns true if pan is enabled, else false.

`enableZoom()`

Enables zoom via scroll.

`disableZoom()`

Disables zoom via scroll.

`canZoom()`

Returns true is zoom is enabled, else false.

`add(voxel)`

voxel — A voxel instance.

Adds the provided voxel to the scene.

`remove(voxel)`

voxel — A voxel instance.

Removes the provided voxel from the scene.


### Events ###
Expand Down
Loading

0 comments on commit d2f2f85

Please sign in to comment.