SimpleIsoPoint

SimpleIsoPoint

A point with x y and z params. And methods for iso point conversion.


Constructor

new SimpleIsoPoint(x, y, z, spacing)

Parameters:
Name Type Description
x Number
y Number
z Number
spacing Number

Default is 45

Members

constructor

spacing

x

y

z

Methods

isoIntoMp(mp, isop)

Convert the SimpleIsoPoint into a existing MoverPoint. If you don't pass another SimpleIsoPoint, this instance will be used.

Parameters:
Name Type Description
mp MoverPoint

The MoverPoint to convert the iso cords into.

isop SimpleIsoPoint

The SimpleIsoPoint to convert into the MoverPoint, in not given the instance will be used.

mpIntoIso(mp, isop)

Converts a MoverPoint into a SimpleIsoPoint

Parameters:
Name Type Description
mp MoverPoint

The MoverPoint to convert into the SimpleIsoPoint

isop SimpleIsoPoint

The SimpleIsoPoint to use, if not given the instance will be used.

rawToIso(x, y, returnX, returnY) → {Number}

Returns either the x or y iso point from a given 2d point.

Parameters:
Name Type Description
x Number
y Number
returnX Boolean
returnY Boolean
Returns:
Type
Number

rawToIsoWithSpacing(x, y, returnX, returnY, spacing) → {Number}

Returns either the x or y iso point with spacing, given a 2d point.

Parameters:
Name Type Description
x Number
y Number
returnX Boolean
returnY Boolean
spacing Number
Returns:
Type
Number

rawToScreen(x, y, returnX, returnY) → {Number}

Returns either the x or y screen point from a given 2d point.

Why only either x or y? To increase performance, in the cases where we only need the x or y, returning a whole Point Object would be wasteful. If we need both we just call the method twice, but only Numbers are ever returned.

Parameters:
Name Type Description
x Number
y Number
returnX Boolean
returnY Boolean
Returns:
Type
Number

rawToScreenWithSpacing(x, y, z, returnX, returnY, spacing) → {Number}

Returns either the x or y screen point with spacing, given a 2d point and z index.

Parameters:
Name Type Description
x Number
y Number
z Number
returnX Boolean
returnY Boolean
spacing Number
Returns:
Type
Number