Represents a single heightmap vertex in the world.
Changes to this vertex takes visible effect in Noggit after you call "apply" on the chunk or selection that contains it.
- add_height
- get_alpha
- get_pos
- is_water_aligned
- set_alpha
- set_color
- set_height
- set_hole
- set_water
- sub_height
+ new vert(): vert
Returns: vert
▸ add_height(y: number): any
| Name | Type |
|---|---|
y |
number |
Returns: any
▸ get_alpha(index: number): any
Returns the average alpha of all texture units closest to this vertex.
| Name | Type |
|---|---|
index |
number |
Returns: any
▸ get_pos(): vector_3d
Returns the full position of this vertex
Returns: vector_3d
▸ is_water_aligned(): boolean
Returns true if this vertex is aligned with water tiles.
Returns: boolean
▸ set_alpha(index: number, alpha: number): void
Sets a texture alpha layer of all texture units closest to this vertex.
| Name | Type |
|---|---|
index |
number |
alpha |
number |
Returns: void
▸ set_color(red: number, green: number, blue: number): void
Changes the vertex color that this vertex blends with the underlying texture. Values generally range between 0-1, but can also go higher.
| Name | Type | Description |
|---|---|---|
red |
number | How much red should be used (default: 1) |
green |
number | How much green should be used (default: 1) |
blue |
number | How much blue should be used (default: 1) |
Returns: void
▸ set_height(y: number): any
Changes the height of this vertex
| Name | Type |
|---|---|
y |
number |
Returns: any
▸ set_hole(has_hole: boolean): void
Sets whether this vertex should be a hole, but only if the vertex is aligned with hole tiles. If the vertex is not aligned with a hole tile, this function does nothing.
| Name | Type |
|---|---|
has_hole |
boolean |
Returns: void
▸ set_water(type: number, height: number): void
Changes the water type on this vertex, but only if the vertex is aligned with water tiles. If the vertex is not aligned with a water tile, this function does nothing.
note The C++ function backing this operation is very slow for the moment.
use with care.
| Name | Type |
|---|---|
type |
number |
height |
number |
Returns: void
▸ sub_height(y: number): any
| Name | Type |
|---|---|
y |
number |
Returns: any