Class GroundBuilder
Hierarchy
- GroundBuilder
Index
Methods
Static Create GroundSearch playground for CreateGround
-
Creates a ground mesh
- The parameters
width
andheight
(floats, default 1) set the width and height sizes of the ground - The parameter
subdivisions
(positive integer) sets the number of subdivisions per side - The mesh can be set to updatable with the boolean parameter
updatable
(default false) if its internal geometry is supposed to change once created
Parameters
-
name: string
defines the name of the mesh
-
options: { height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number; updatable?: boolean; width?: number }
defines the options used to create the mesh
-
Optional height?: number
-
Optional subdivisions?: number
-
Optional subdivisionsX?: number
-
Optional subdivisionsY?: number
-
Optional updatable?: boolean
-
Optional width?: number
-
-
scene: any
defines the hosting scene
Returns Mesh
the ground mesh
- The parameters
Static Create Ground From Height MapSearch playground for CreateGroundFromHeightMap
-
Creates a ground mesh from a height map
- The parameter
url
sets the URL of the height map image resource. - The parameters
width
andheight
(positive floats, default 10) set the ground width and height sizes. - The parameter
subdivisions
(positive integer, default 1) sets the number of subdivision per side. - The parameter
minHeight
(float, default 0) is the minimum altitude on the ground. - The parameter
maxHeight
(float, default 1) is the maximum altitude on the ground. - The parameter
colorFilter
(optional Color3, default (0.3, 0.59, 0.11) ) is the filter to apply to the image pixel colors to compute the height. - The parameter
onReady
is a javascript callback function that will be called once the mesh is just built (the height map download can last some time). - The parameter
alphaFilter
will filter any data where the alpha channel is below this value, defaults 0 (all data visible) - The mesh can be set to updatable with the boolean parameter
updatable
(default false) if its internal geometry is supposed to change once created.
Parameters
-
name: string
defines the name of the mesh
-
url: string
defines the url to the height map
-
options: { alphaFilter?: number; colorFilter?: Color3; height?: number; maxHeight?: number; minHeight?: number; onReady?: (mesh: GroundMesh) => void; subdivisions?: number; updatable?: boolean; width?: number }
defines the options used to create the mesh
-
Optional alpha
Filter?: number -
Optional color
Filter?: Color3 -
Optional height?: number
-
Optional max
Height?: number -
Optional min
Height?: number -
Optional on
Ready?: (mesh: GroundMesh) => void -
-
Parameters
-
mesh: GroundMesh
Returns void
-
-
-
-
Optional subdivisions?: number
-
Optional updatable?: boolean
-
Optional width?: number
-
-
Optional scene: Nullable<Scene>
defines the hosting scene
Returns GroundMesh
the ground mesh
- The parameter
Static Create Tiled GroundSearch playground for CreateTiledGround
-
Creates a tiled ground mesh
- The parameters
xmin
andxmax
(floats, default -1 and 1) set the ground minimum and maximum X coordinates - The parameters
zmin
andzmax
(floats, default -1 and 1) set the ground minimum and maximum Z coordinates - The parameter
subdivisions
is a javascript object{w: positive integer, h: positive integer}
(default{w: 6, h: 6}
).w
andh
are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile - The parameter
precision
is a javascript object{w: positive integer, h: positive integer}
(default{w: 2, h: 2}
).w
andh
are the numbers of subdivisions on the ground width and height of each tile - The mesh can be set to updatable with the boolean parameter
updatable
(default false) if its internal geometry is supposed to change once created.
Parameters
-
name: string
defines the name of the mesh
-
options: { precision?: { h: number; w: number }; subdivisions?: { h: number; w: number }; updatable?: boolean; xmax: number; xmin: number; zmax: number; zmin: number }
defines the options used to create the mesh
-
Optional precision?: { h: number; w: number }
-
h: number
-
w: number
-
-
Optional subdivisions?: { h: number; w: number }
-
h: number
-
w: number
-
-
Optional updatable?: boolean
-
xmax: number
-
xmin: number
-
zmax: number
-
zmin: number
-
-
Optional scene: Nullable<Scene>
defines the hosting scene
Returns Mesh
the tiled ground mesh
- The parameters
Class containing static functions to help procedurally build meshes