XLE
v0.02.0
|
Represents a single "uber" field of terrain data More...
#include <TerrainUberSurface.h>
Public Member Functions | |
Type | GetValue (unsigned x, unsigned y) const |
void | SetValue (unsigned x, unsigned y, Type newValue) |
Type | GetValueFast (unsigned x, unsigned y) const |
TerrainUberSurface (const ::Assets::ResChar filename[]) | |
Public Member Functions inherited from SceneEngine::TerrainUberSurfaceGeneric | |
void * | GetData (UInt2 coord) |
void * | GetDataFast (UInt2 coord) |
unsigned | GetStride () const |
ImpliedTyping::TypeDesc | Format () const |
unsigned | GetWidth () const |
unsigned | GetHeight () const |
TerrainUberSurfaceGeneric (const ::Assets::ResChar filename[]) | |
TerrainUberSurfaceGeneric (TerrainUberSurfaceGeneric &&moveFrom) | |
TerrainUberSurfaceGeneric & | operator= (TerrainUberSurfaceGeneric &&moveFrom) |
Friends | |
class | HeightsUberSurfaceInterface |
Additional Inherited Members | |
Protected Attributes inherited from SceneEngine::TerrainUberSurfaceGeneric | |
std::unique_ptr< Utility::MemoryMappedFile > | _mappedFile |
unsigned | _width |
unsigned | _height |
void * | _dataStart |
ImpliedTyping::TypeDesc | _format |
unsigned | _sampleBytes |
Represents a single "uber" field of terrain data
Normally the terrain is separated into many cells, each with limited dimensions. But while editing, it's useful to see the terrain as just a single large field of information (particularly because there is some overlap between adjacent cells). This object allows us to see terrain data in that format, by mapping a large file into memory.
Note that this is a little restrictive at the moment, because we need to know the format of the data at compile time. It might be handy to make this interface more generic, so that the format of the element is defined by a NativeFormat::Enum type, and allow queries with dynamic casting. Clients of this type often want to re-sample the data. So they need to be able to manipulate it in full precision, whatever true format it is. That means we can't just cast all data to a Float4... we probably need something a little nicer than that.