Class: Mountain

Mountain

A mountain in the map

new Mountain (json)

Name Type Description
json Object optional Json object describing the mountain
Properties:
Name Type Argument Default Description
Mountain.X_LEFT_OFFSET number <optional>
0 Offset for x left
Mountain.X_MID_OFFSET number <optional>
1 Offset for x mid
Mountain.X_RIGHT_OFFSET number <optional>
2 Offset for x right
Mountain.X_MIX_OFFSET number <optional>
3 Offset for x mix
Mountain.Y_TOP_OFFSET number <optional>
0 Offset for y top
Mountain.Y_MID_OFFSET number <optional>
1 Offset for y mid
Mountain.Y_BOT_OFFSET number <optional>
2 Offset for y bot
Mountain.Y_MIX_OFFSET number <optional>
3 Offset for y mix
mountainID number The mountain ID
widthSquares number The width in squares
widthPixels number The width in pixels
heightSquares number The height in squares
heightPixels number The height in pixels
top boolean Indicate there's another mountain on top
bot boolean Indicate there's another mountain on bot
left boolean Indicate there's another mountain on left
right boolean Indicate there's another mountain on right
angle number The angle of the mountain

Extends

Methods

read (json) overrides

Read the JSON associated to the mountain
Name Type Description
json Object Json object describing the mountain

getTotalSquaresWidth ()number

Get the total squares width
Returns:
Type Description
number

getTotalSquaresHeight ()number

Get the total squares height
Returns:
Type Description
number

getWidthOnlyPixelsPlus ()number

Get the squares number width with pixels plus
Returns:
Type Description
number

getHeightOnlyPixelsPlus ()number

Get the squares number height with pixels plus
Returns:
Type Description
number

getWidthTotalPixels ()number

Get the total width in pixels
Returns:
Type Description
number

getHeightTotalPixels ()number

Get the total height in pixels
Returns:
Type Description
number

getSystem ()SystemSpecialElement

Get the system special element mountain
Returns:
Type Description
SystemSpecialElement

drawEntireFaces (left, right, angle, center, width, height, w, faceHeight, wp, xLeft, xRight, yTop, yBot, zFront, zBack, yOffset, vecFrontA, vecBackA, vecFrontB, vecBackB, geometry, count)

Draw the entire faces
Name Type Description
left boolean Indicate if left
right boolean Indicate if right
angle number The angle
center THREE.Vector3 The position center
width number The width in squares
height number The height in squares
w number The w in coordinates
faceHeight number The face height
wp number The width pixels
xLeft number The x left position
xRight number The x right position
yTop number The y top position
yBot number The y bot position
zFront number The z front position
zBack number The z back position
yOffset number The y offset
vecFrontA THREE.Vector3 The front vector position A
vecBackA THREE.Vector3 The back vector position A
vecFrontB THREE.Vector3 The front vector position B
vecBackB THREE.Vector3 The back vector position B
geometry THREE.geometry The geometry
count number The faces count

drawSideCorner (xKind, yKind, angle, center, width, height, w, faceHeight, wp, xLeft, xRight, xLeftTop, xRightTop, xLeftBot, xRightBot, yTop, yBot, zFront, zBack, zFrontLeft, zFrontRight, zBackLeft, zBackRight, yOffset, geometry, count, xCornerOffsetTop, xCornerOffsetBot)

Draw the side corner
Name Type Description
xKind number The xKind position
yKind number The yKind position
angle number The angle
center THREE.Vector3 The position center
width number The width in squares
height number The height in squares
w number The w in coordinates
faceHeight number The face height
wp number The width pixels
xLeft number The x left position
xRight number The x right position
xLeftTop number The x left top position
xRightTop number The x right top position
xLeftBot number The x left bot position
xRightBot number The x right bot position
yTop number The y top position
yBot number The y bot position
zFront number The z front position
zBack number The z back position
zFrontLeft number The z front left position
zFrontRight number The z front right position
zBackLeft number The z back left position
zBackRight number The z back right position
yOffset number The y offset
geometry THREE.geometry The geometry
count number The faces count
xCornerOffsetTop number The x corner offset top
xCornerOffsetBot number The x corner offset bot

drawFace (xKind, yKind, angle, center, width, height, w, faceHeight, xLeftTop, xRightTop, xLeftBot, xRightBot, yTop, yBot, zFrontLeft, zFrontRight, zBackLeft, zBackRight, yOffset, geometry, count, xCornerOffsetTop, xCornerOffsetBot, isCorner)

Draw a face
Name Type Description
xKind number The xKind position
yKind number The yKind position
angle number The angle
center THREE.Vector3 The position center
width number The width in squares
height number The height in squares
w number The w in coordinates
faceHeight number The face height
xLeftTop number The x left top position
xRightTop number The x right top position
xLeftBot number The x left bot position
xRightBot number The x right bot position
yTop number The y top position
yBot number The y bot position
zFrontLeft number The z front left position
zFrontRight number The z front right position
zBackLeft number The z back left position
zBackRight number The z back right position
yOffset number The y offset
geometry THREE.geometry The geometry
count number The faces count
xCornerOffsetTop number The x corner offset top
xCornerOffsetBot number The x corner offset bot
isCorner boolean Indicate if corner

updateGeometry (geometry, texture, position, count)Array.<any>

Update the geometry of a group of mountains with the same material
Name Type Description
geometry THREE.Geometry The geometry of mountains
texture Array.<number> The texture mountain
position Array.<number> The json position
count number The faces count
Returns:
Type Description
Array.<any>

scale (vecA, vecB, vecC, vecD, center, position, size, kind) inherited overrides

Scale the vertices correctly
Name Type Description
vecA THREE.Vector3 The A vertex to rotate
vecB THREE.Vector3 The B vertex to rotate
vecC THREE.Vector3 The C vertex to rotate
vecD THREE.Vector3 The D vertex to rotate
center THREE.Vector3 The center to rotate around
position Array.<number> The json position
size THREE.Vector3 The scale size
kind ElementMapKind The element map kind