Table of Contents

Class TerrainExtensions

Namespace
AlphaFramework.Presentation
Assembly
AlphaFramework.Presentation.dll

Contains extension methods for Terrain<TTemplate>.

public static class TerrainExtensions
Inheritance
object
TerrainExtensions

Methods

Flatten(DoubleVector3)

Maps X to X and Z to -Y. Drops Y.

[Pure]
public static Vector2 Flatten(this DoubleVector3 vector)

Parameters

vector DoubleVector3

Returns

Vector2

ToRenderable<TTemplate>(Terrain<TTemplate>, Engine, bool, int)

Generate a Terrain from this terrain data.

public static Terrain ToRenderable<TTemplate>(this Terrain<TTemplate> terrain, Engine engine, bool lighting, int blockSize = 32) where TTemplate : TerrainTemplateBase<TTemplate>

Parameters

terrain Terrain<TTemplate>

The terrain data.

engine Engine

The Engine to use for rendering.

lighting bool

Shall this mesh be prepared for lighting? (calculate normal vectors, make shaders support lighting, ...)

blockSize int

How many points in X and Y direction shall one block for culling be?

Returns

Terrain

Type Parameters

TTemplate

Exceptions

FileNotFoundException

One of the specified texture files could not be found.

IOException

There was an error reading one of the texture files.

UnauthorizedAccessException

Read access to one of the texture files is not permitted.

InvalidDataException

One of the texture files does not contain a valid texture.