CLASSES
TagsA - Z

GroundMesh

NodeMesh

Description

class GroundMesh extends Mesh

Constructor

new GroundMesh(name, scene)

The GroundMesh constructor

Parameters

Name Type Description
name string @param name
scene Scene @param scene

Members

generateOctree : boolean

true if this is generated, false if is not

subdivisions : number

The subdivision of the GroundMesh

subdivisionsX : number

subdivisionsY : number

Methods

getClassName() string

optimize(chunksCount, octreeBlocksSize) void

Parameters

Name Type Description
chunksCount number @param chunksCount
optional octreeBlocksSize number

getHeightAtCoordinates(x, z) number

Returns a height (y) value in the Worl system :

the ground altitude at the coordinates (x, z) expressed in the World system.

Returns the ground y position if (x, z) are outside the ground surface.

Parameters

Name Type Description
x number @param x
z number @param z

getNormalAtCoordinates(x, z) Vector3

Returns a normalized vector (Vector3) orthogonal to the ground

at the ground coordinates (x, z) expressed in the World system.

Returns Vector3(0.0, 1.0, 0.0) if (x, z) are outside the ground surface.

Parameters

Name Type Description
x number @param x
z number @param z

getNormalAtCoordinatesToRef(x, z, ref) GroundMesh

Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground

at the ground coordinates (x, z) expressed in the World system.

Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface.

Returns the GroundMesh.

Parameters

Name Type Description
x number @param x
z number @param z
ref Vector3

updateCoordinateHeights() GroundMesh

Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates()

if the ground has been updated.

This can be used in the render loop.

Returns the GroundMesh.

serialize(serializationObject) void

Parameters

Name Type Description
serializationObject any

static Parse(parsedMesh, scene) GroundMesh

Parameters

Name Type Description
parsedMesh any
scene Scene @param scene