Class: Cube

.Isometric. Cube

Creates a new Cube object with the bottom-back corner specified by the x, y and z parameters, with the specified breadth (widthX), depth (widthY) and height parameters. If you call this function without parameters, a Cube with x, y, z, breadth, depth and height properties set to 0 is created.

new Cube(x, y, z, widthX, widthY, height) → {Phaser.Plugin.Isometric.Cube}

Parameters:
Name Type Description
x number

The x coordinate of the bottom-back corner of the Cube.

y number

The y coordinate of the bottom-back corner of the Cube.

z number

The z coordinate of the bottom-back corner of the Cube.

widthX number

The X axis width (breadth) of the Cube. Should always be either zero or a positive value.

widthY number

The Y axis width (depth) of the Cube. Should always be either zero or a positive value.

height number

The Z axis height of the Cube. Should always be either zero or a positive value.

Source:
Returns:

This Cube object.

Type
Phaser.Plugin.Isometric.Cube

Members

backX

The x coordinate of the back of the Cube. Changing the backX property of a Cube object has no effect on the y, z, widthY and height properties. However it does affect the widthX property, whereas changing the x value does not affect the width property.

Properties:
Name Type Description
backX number

The x coordinate of the left of the Cube.

Source:

backY

The y coordinate of the back of the Cube. Changing the backY property of a Cube object has no effect on the x, z, widthX and height properties. However it does affect the widthY property, whereas changing the y value does not affect the width property.

Properties:
Name Type Description
backY number

The x coordinate of the left of the Cube.

Source:

bottom

The z coordinate of the bottom of the Cube. Changing the bottom property of a Cube object has no effect on the x, y, widthX and widthY properties. However it does affect the height property, whereas changing the z value does not affect the height property.

Properties:
Name Type Description
bottom number

The z coordinate of the bottom of the Cube.

Source:

centerX

The x coordinate of the center of the Cube.

Properties:
Name Type Description
centerX number

The x coordinate of the center of the Cube.

Source:

centerY

The y coordinate of the center of the Cube.

Properties:
Name Type Description
centerY number

The y coordinate of the center of the Cube.

Source:

centerZ

The z coordinate of the center of the Cube.

Properties:
Name Type Description
centerZ number

The z coordinate of the center of the Cube.

Source:

empty

Determines whether or not this Cube object is empty. A Cube object is empty if its widthX, widthY or height is less than or equal to 0. If set to true then all of the Cube properties are set to 0.

Properties:
Name Type Description
empty boolean

Gets or sets the Cube's empty state.

Source:

frontX

The sum of the x and widthX properties. Changing the frontX property of a Cube object has no effect on the x, y, z, widthY and height properties, however it does affect the widthX property.

Properties:
Name Type Description
frontX number

The sum of the x and widthX properties.

Source:

frontY

The sum of the y and widthY properties. Changing the frontY property of a Cube object has no effect on the x, y, z, widthX and height properties, however it does affect the widthY property.

Properties:
Name Type Description
frontY number

The sum of the y and widthY properties.

Source:

<readonly> halfHeight

Properties:
Name Type Description
halfHeight number

Half of the height of the Cube.

Source:

<readonly> halfWidthX

Properties:
Name Type Description
halfWidthX number

Half of the widthX of the Cube.

Source:

<readonly> halfWidthY

Properties:
Name Type Description
halfWidthY number

Half of the widthY of the Cube.

Source:

height

Properties:
Name Type Description
height number

The Z axis height of the Cube. This value should never be set to a negative.

Source:

randomX

A random value between the frontX and backX values (inclusive) of the Cube.

Properties:
Name Type Description
randomX number

A random value between the frontX and backX values (inclusive) of the Cube.

Source:

randomY

A random value between the frontY and backY values (inclusive) of the Cube.

Properties:
Name Type Description
randomY number

A random value between the frontY and backY values (inclusive) of the Cube.

Source:

randomZ

A random value between the bottom and top values (inclusive) of the Cube.

Properties:
Name Type Description
randomZ number

A random value between the bottom and top values (inclusive) of the Cube.

Source:

top

The sum of the z and height properties. Changing the top property of a Cube object has no effect on the x, y, z, widthX and widthY properties, but does change the height property.

Properties:
Name Type Description
top number

The sum of the z and height properties.

Source:

<readonly> volume

The volume of the Cube derived from widthX widthY height.

Properties:
Name Type Description
volume number

The volume of the Cube derived from widthX widthY height.

Source:

widthX

Properties:
Name Type Description
widthX number

The X axis width (breadth) of the Cube. This value should never be set to a negative.

Source:

widthY

Properties:
Name Type Description
widthY number

The Y axis width (depth) of the Cube. This value should never be set to a negative.

Source:

x

Properties:
Name Type Description
x number

The x coordinate of the bottom-back corner of the Cube.

Source:

y

Properties:
Name Type Description
y number

The y coordinate of the bottom-back corner of the Cube.

Source:

z

Properties:
Name Type Description
z number

The z coordinate of the bottom-back corner of the Cube.

Source:

Methods

<static> clone(a, output) → {Phaser.Plugin.Isometric.Cube}

Returns a new Cube object with the same values for the x, y, z, widthX, widthY, and height properties as the original Cube object.

Parameters:
Name Type Argument Description
a Phaser.Plugin.Isometric.Cube

The Cube object.

output Phaser.Plugin.Isometric.Cube <optional>

Optional Cube object. If given the values will be set into the object, otherwise a brand new Cube object will be created and returned.

Source:
Returns:
Type
Phaser.Plugin.Isometric.Cube

<static> contains(a, x, y, z) → {boolean}

Determines whether the specified coordinates are contained within the region defined by this Cube object.

Parameters:
Name Type Description
a Phaser.Plugin.Isometric.Cube

The Cube object.

x number

The x coordinate of the point to test.

y number

The y coordinate of the point to test.

z number

The z coordinate of the point to test.

Source:
Returns:

A value of true if the Cube object contains the specified point; otherwise false.

Type
boolean

<static> containsCube(a, b) → {boolean}

Determines whether the first Cube object is fully contained within the second Cube object. A Cube object is said to contain another if the second Cube object falls entirely within the boundaries of the first.

Parameters:
Name Type Description
a Phaser.Plugin.Isometric.Cube

The first Cube object.

b Phaser.Plugin.Isometric.Cube

The second Cube object.

Source:
Returns:

A value of true if the Cube object contains the specified point; otherwise false.

Type
boolean

<static> containsPoint3(a, point3) → {boolean}

Determines whether the specified point is contained within the cubic region defined by this Cube object. This method is similar to the Cube.contains() method, except that it takes a Point3 object as a parameter.

Parameters:
Name Type Description
a Phaser.Plugin.Isometric.Cube

The Cube object.

point3 Phaser.Plugin.Isometric.Point3

The Point3 object being checked. Can be Point3 or any object with .x, .y and .z values.

Source:
Returns:

A value of true if the Cube object contains the specified point; otherwise false.

Type
boolean

<static> containsXY(a, x, y) → {boolean}

Determines whether the specified X and Y coordinates are contained within the region defined by this Cube object.

Parameters:
Name Type Description
a Phaser.Plugin.Isometric.Cube

The Cube object.

x number

The x coordinate of the point to test.

y number

The y coordinate of the point to test.

Source:
Returns:

A value of true if the Cube object contains the specified point; otherwise false.

Type
boolean

<static> intersects(a, b) → {boolean}

Determines whether the two Cubes intersect with each other. This method checks the x, y, z, widthX, widthY, and height properties of the Cubes.

Parameters:
Name Type Description
a Phaser.Plugin.Isometric.Cube

The first Cube object.

b Phaser.Plugin.Isometric.Cube

The second Cube object.

Source:
Returns:

A value of true if the specified object intersects with this Cube object; otherwise false.

Type
boolean

<static> size(a, output) → {Phaser.Plugin.Isometric.Point3}

The size of the Cube object, expressed as a Point3 object with the values of the widthX, widthY and height properties.

Parameters:
Name Type Argument Description
a Phaser.Plugin.Isometric.Cube

The Cube object.

output Phaser.Plugin.Isometric.Point3 <optional>

Optional Point3 object. If given the values will be set into the object, otherwise a brand new Point3 object will be created and returned.

Source:
Returns:

The size of the Cube object

Type
Phaser.Plugin.Isometric.Point3

clone(output) → {Phaser.Plugin.Isometric.Cube}

Returns a new Cube object with the same values for the x, y, z, widthX, widthY and height properties as the original Cube object.

Parameters:
Name Type Argument Description
output Phaser.Plugin.Isometric.Cube <optional>

Optional Cube object. If given the values will be set into the object, otherwise a brand new Cube object will be created and returned.

Source:
Returns:
Type
Phaser.Plugin.Isometric.Cube

contains(x, y, y) → {boolean}

Determines whether the specified coordinates are contained within the region defined by this Cube object.

Parameters:
Name Type Description
x number

The x coordinate of the point to test.

y number

The y coordinate of the point to test.

y number

The z coordinate of the point to test.

Source:
Returns:

A value of true if the Cube object contains the specified point; otherwise false.

Type
boolean

containsXY(x, y) → {boolean}

Determines whether the specified X and Y coordinates are contained within the region defined by this Cube object.

Parameters:
Name Type Description
x number

The x coordinate of the point to test.

y number

The y coordinate of the point to test.

Source:
Returns:

A value of true if this Cube object contains the specified point; otherwise false.

Type
boolean

copyFrom(source) → {Phaser.Plugin.Isometric.Cube}

Copies the x, y, z, widthX, widthY and height properties from any given object to this Cube.

Parameters:
Name Type Description
source any

The object to copy from.

Source:
Returns:

This Cube object.

Type
Phaser.Plugin.Isometric.Cube

copyTo(dest) → {Phaser.Plugin.Isometric.Cube}

Copies the x, y, z, widthX, widthY and height properties from this Cube to any given object.

Parameters:
Name Type Description
dest any

The object to copy to.

Source:
Returns:

This Cube object.

Type
Phaser.Plugin.Isometric.Cube

getCorners() → {Array.<Phaser.Plugin.Isometric.Point3>}

Updates and returns an Array of eight Point3 objects containing the corners of this Cube.

Source:
Returns:

The corners of this Cube expressed as an Array of eight Point3 objects.

Type
Array.<Phaser.Plugin.Isometric.Point3>

intersects(b) → {boolean}

Determines whether the two Cubes intersect with each other. This method checks the x, y, z, widthX, widthY, and height properties of the Cubes.

Parameters:
Name Type Description
b Phaser.Plugin.Isometric.Cube

The second Cube object.

Source:
Returns:

A value of true if the specified object intersects with this Cube object; otherwise false.

Type
boolean

setTo(x, y, z, widthX, widthY, height) → {Phaser.Plugin.Isometric.Cube}

Sets the members of Cube to the specified values.

Parameters:
Name Type Description
x number

The x coordinate of the bottom-back corner of the Cube.

y number

The y coordinate of the bottom-back corner of the Cube.

z number

The z coordinate of the bottom-back corner of the Cube.

widthX number

The X axis width (breadth) of the Cube. This value should never be set to a negative.

widthY number

The Y axis width (depth) of the Cube. This value should never be set to a negative.

height number

The Z axis height of the Cube. This value should never be set to a negative.

Source:
Returns:

This Cube object

Type
Phaser.Plugin.Isometric.Cube

size(output) → {Phaser.Plugin.Isometric.Point3}

The size of the Cube object, expressed as a Point3 object with the values of the widthX, widthY and height properties.

Parameters:
Name Type Argument Description
output Phaser.Plugin.Isometric.Point3 <optional>

Optional Point3 object. If given the values will be set into the object, otherwise a brand new Point3 object will be created and returned.

Source:
Returns:

The size of the Cube object.

Type
Phaser.Plugin.Isometric.Point3

toString() → {string}

Returns a string representation of this object.

Source:
Returns:

A string representation of the instance.

Type
string