Struct dotrix_terrain::Terrain[][src]

pub struct Terrain {
    pub view_distance: f32,
    pub max_lod: usize,
    pub tile_size: usize,
    pub spawn_if_moved_by: f32,
    pub force_spawn: bool,
    pub heightmap: Box<dyn Heightmap>,
    pub texture: Id<Texture>,
    pub texture_heights: Vec<f32>,
}
Expand description

Terrain manager (configuration)

Fields

view_distance: f32

How far the terrain chunks should be spawned (default 500.0)

max_lod: usize

The lowest lod number (default 4)

tile_size: usize

Number of polygons per chunk side (default 240)

spawn_if_moved_by: f32

Terrain will be recalclated only if viewer has moved by that value (default 16*16=256)

force_spawn: bool

Flag to perform force terrain recalculation

heightmap: Box<dyn Heightmap>

Heights source

texture: Id<Texture>

Id of the terrain for texturing

texture_heights: Vec<f32>

List of the terrain heights to determine UV of the texture

Implementations

Constructs new terrain manager

Generates terrain mesh

Calculates texture UV for specific height value

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.