Class TerrainExtensions
- Namespace
- AlphaFramework.Presentation
- Assembly
- AlphaFramework.Presentation.dll
Contains extension methods for Terrain<TTemplate>.
public static class TerrainExtensions
- Inheritance
-
objectTerrainExtensions
Methods
Flatten(DoubleVector3)
Maps X to X and Z to -Y. Drops Y.
[Pure]
public static Vector2 Flatten(this DoubleVector3 vector)
Parameters
vectorDoubleVector3
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
terrainTerrain<TTemplate>The terrain data.
engineEngineThe Engine to use for rendering.
lightingboolShall this mesh be prepared for lighting? (calculate normal vectors, make shaders support lighting, ...)
blockSizeintHow many points in X and Y direction shall one block for culling be?
Returns
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.