Class Cube
- Defined in: utils.js
Constructor Attributes | Constructor Name and Description |
---|---|
Cube(x, y, z)
Creates an instance of a Cube animation
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
alterVoxel(x, y, z, state)
Combines the functionality of setVoxel and clearVoxel for when an alternate syntax is needed
|
|
clearPlane((x|y|z), plane)
Turns a plane off in any dimension
|
|
clearPlaneX(X-plane)
Turns an entire X-Plane off
|
|
clearPlaneY(Y-plane)
Turns an entire Y-Plane off
|
|
clearPlaneZ(Z-plane)
Turns an entire Z-Plane off
|
|
clearVoxel(x, y, z)
Sets a specific LED to OFF state
|
|
drawLine(x1, y1, z1, x2, y2, z2)
Draws a line through the cube between any two points in 3D space
|
|
fill(pattern)
Fills each [z][y] line of a cube with a given pattern.
|
|
flipVoxel(x, y, z)
Toggles a specific LED (on-->off, off-->on)
|
|
getFrame(frameNumber)
Sets the cube to a specific frame number
|
|
getVoxel(x, y, z)
Gets the state of a specific LED
|
|
nextFrame(duplicateCurrent)
Sets the cube to the next frame of animation.
|
|
prevFrame(duplicateCurrent)
Sets the cube to the previous frame of animation.
|
|
setPlane((x|y|z), plane)
Turns a plane on in any dimension
|
|
setPlaneX(X-plane)
Turns an entire X-Plane on
|
|
setPlaneY(Y-plane)
Turns an entire Y-Plane on
|
|
setPlaneZ(Z-plane)
Turns an entire Z-Plane on
|
|
setVoxel(x, y, z)
Sets a specific LED to ON state
|
|
shift((x|y|z), amount)
Shifts the contents of a cube along an axis.
|
Class Detail
Cube(x, y, z)
Creates an instance of a Cube animation
- Parameters:
- x
- {Number} width of cube
- y
- {Number} depth of cube
- z
- {Number} height of cube
Method Detail
-
alterVoxel(x, y, z, state)Combines the functionality of setVoxel and clearVoxel for when an alternate syntax is needed
- Parameters:
- {Number} x
- {Number} y
- {Number} z
- {Boolean} state
-
clearPlane((x|y|z), plane)Turns a plane off in any dimension
- Parameters:
- {String} (x|y|z)
- axis
- {Number} plane
-
clearPlaneX(X-plane)Turns an entire X-Plane off
- Parameters:
- {Number} X-plane
-
clearPlaneY(Y-plane)Turns an entire Y-Plane off
- Parameters:
- {Number} Y-plane
-
clearPlaneZ(Z-plane)Turns an entire Z-Plane off
- Parameters:
- {Number} Z-plane
-
clearVoxel(x, y, z)Sets a specific LED to OFF state
- Parameters:
- {Number} x
- {Number} y
- {Number} z
-
drawLine(x1, y1, z1, x2, y2, z2)Draws a line through the cube between any two points in 3D space
- Parameters:
- {Number} x1
- {Number} y1
- {Number} z1
- {Number} x2
- {Number} y2
- {Number} z2
-
fill(pattern)Fills each [z][y] line of a cube with a given pattern.
- Parameters:
- {Bytes} pattern Optional, Default: 0x00
-
flipVoxel(x, y, z)Toggles a specific LED (on-->off, off-->on)
- Parameters:
- {Number} x
- {Number} y
- {Number} z
-
getFrame(frameNumber)Sets the cube to a specific frame number
- Parameters:
- {Number} frameNumber
-
{Bool} getVoxel(x, y, z)Gets the state of a specific LED
- Parameters:
- {Number} x
- {Number} y
- {Number} z
- Returns:
- {Bool} on/off
-
nextFrame(duplicateCurrent)Sets the cube to the next frame of animation. Will automatically create new frames as necessary.
- Parameters:
- {Boolean} duplicateCurrent Optional, Default: false
- Duplicate the current frame when creating the next one. If false, creates empty frames when necessary.
-
prevFrame(duplicateCurrent)Sets the cube to the previous frame of animation. Will automatically create new frames as necessary.
- Parameters:
- {Boolean} duplicateCurrent Optional, Default: false
- Duplicate the current frame when creating a previous one. If false, creates empty frames when necessary.
-
setPlane((x|y|z), plane)Turns a plane on in any dimension
- Parameters:
- {String} (x|y|z)
- axis
- {Number} plane
-
setPlaneX(X-plane)Turns an entire X-Plane on
- Parameters:
- {Number} X-plane
-
setPlaneY(Y-plane)Turns an entire Y-Plane on
- Parameters:
- {Number} Y-plane
-
setPlaneZ(Z-plane)Turns an entire Z-Plane on
- Parameters:
- {Number} Z-plane
-
setVoxel(x, y, z)Sets a specific LED to ON state
- Parameters:
- {Number} x
- {Number} y
- {Number} z
-
shift((x|y|z), amount)Shifts the contents of a cube along an axis. Useful for effects like rain or bringing text/etc from one side of the cube to another
- Parameters:
- {String} (x|y|z)
- {Number} amount
- positive or negative. Usually 1 or -1.