OGRE: Ogre::Terrain::ImportData Struct Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::Terrain::ImportData Struct Reference

Structure encapsulating import data that you may use to bootstrap the terrain without loading from a native data stream. More...

`#include <OgreTerrain.h>`

## Public Member Functions
| ImportData ()
| ImportData (const ImportData &rhs)
| ~ImportData ()
void | destroy ()
| Delete any input data if this struct is set to do so.
ImportData & | operator= (const ImportData &rhs)

## Public Attributes
float | constantHeight
| If neither inputImage or inputFloat are supplied, the constant height at which the initial terrain should be created (flat).
bool | deleteInputData
| Whether this structure should 'own' the input data (inputImage and inputFloat), and therefore delete it on destruction.
Real | inputBias
| How to bias the input values provided (if any).
float * | inputFloat
| Optional list of terrainSize * terrainSize floats defining the terrain.
Image * | inputImage
| Optional heightmap providing the initial heights for the terrain.
Real | inputScale
| How to scale the input values provided (if any).
TerrainLayerDeclaration | layerDeclaration
| Definition of the contents of each layer (required).
LayerInstanceList | layerList
| List of layer structures, one for each layer required.
uint16 | maxBatchSize
| Maximum batch size (along one edge) in vertices; must be 2^n+1 and <= 65.
uint16 | minBatchSize
| Minimum batch size (along one edge) in vertices; must be 2^n+1.
Vector3 | pos
| Position of the terrain.
Alignment | terrainAlign
| The alignment of the terrain.
uint16 | terrainSize
| Terrain size (along one edge) in vertices; must be 2^n+1.
Real | worldSize
| The world size of the terrain.

## Detailed Description

Structure encapsulating import data that you may use to bootstrap the terrain without loading from a native data stream.

## Constructor & Destructor Documentation

## ◆ ImportData() [1/2]

Ogre::Terrain::ImportData::ImportData | ( |  | ) |
| inline

References Ogre::Terrain::ALIGN_X_Z, constantHeight, deleteInputData, inputBias, inputFloat, inputImage, inputScale, maxBatchSize, minBatchSize, pos, terrainAlign, terrainSize, and worldSize.

Referenced by ImportData(), and operator=().

## ◆ ImportData() [2/2]

Ogre::Terrain::ImportData::ImportData | ( | const ImportData & | rhs | ) |
| inline

References ImportData(), Ogre::Terrain::ALIGN_X_Z, constantHeight, deleteInputData, inputBias, inputFloat, inputImage, inputScale, maxBatchSize, minBatchSize, pos, terrainAlign, terrainSize, and worldSize.

## ◆ ~ImportData()

Ogre::Terrain::ImportData::~ImportData | ( |  | ) |
| inline

References destroy().

## Member Function Documentation

## ◆ operator=()

ImportData & Ogre::Terrain::ImportData::operator= | ( | const ImportData & | rhs | ) |
| inline

References ImportData(), constantHeight, deleteInputData, inputBias, inputFloat, inputImage, inputScale, layerDeclaration, layerList, maxBatchSize, minBatchSize, pos, terrainAlign, terrainSize, and worldSize.

## ◆ destroy()

void Ogre::Terrain::ImportData::destroy | ( |  | ) |
| inline

Delete any input data if this struct is set to do so.

References deleteInputData, inputFloat, and inputImage.

Referenced by ~ImportData().

## Member Data Documentation

## ◆ terrainAlign

Alignment Ogre::Terrain::ImportData::terrainAlign

The alignment of the terrain.

Referenced by ImportData(), ImportData(), and operator=().

## ◆ terrainSize

uint16 Ogre::Terrain::ImportData::terrainSize

Terrain size (along one edge) in vertices; must be 2^n+1.

Referenced by ImportData(), ImportData(), and operator=().

## ◆ maxBatchSize

uint16 Ogre::Terrain::ImportData::maxBatchSize

Maximum batch size (along one edge) in vertices; must be 2^n+1 and <= 65.

The terrain will be divided into hierarchical tiles, and this is the maximum size of one tile in vertices (at any LOD).

Referenced by ImportData(), ImportData(), and operator=().

## ◆ minBatchSize

uint16 Ogre::Terrain::ImportData::minBatchSize

Minimum batch size (along one edge) in vertices; must be 2^n+1.

The terrain will be divided into tiles, and this is the minimum size of one tile in vertices (at any LOD). Adjacent tiles will be collected together into one batch to drop LOD levels once they are individually at this minimum, so setting this value higher means greater batching at the expense of making adjacent tiles use a common LOD. Once the entire terrain is collected together into one batch this effectively sets the minimum LOD.

Referenced by ImportData(), ImportData(), and operator=().

## ◆ pos

Vector3 Ogre::Terrain::ImportData::pos

Position of the terrain.

Represents the position of the centre of the terrain.

Referenced by ImportData(), ImportData(), and operator=().

## ◆ worldSize

Real Ogre::Terrain::ImportData::worldSize

The world size of the terrain.

Referenced by ImportData(), ImportData(), and operator=().

## ◆ inputImage

Image* Ogre::Terrain::ImportData::inputImage

Optional heightmap providing the initial heights for the terrain.

If supplied, should ideally be terrainSize * terrainSize, but if it isn't it will be resized.

Referenced by ImportData(), ImportData(), destroy(), and operator=().

## ◆ inputFloat

float* Ogre::Terrain::ImportData::inputFloat

Optional list of terrainSize * terrainSize floats defining the terrain.

The list of floats wil be interpreted such that the first row in the array equates to the bottom row of vertices.

Referenced by ImportData(), ImportData(), destroy(), and operator=().

## ◆ constantHeight

float Ogre::Terrain::ImportData::constantHeight

If neither inputImage or inputFloat are supplied, the constant height at which the initial terrain should be created (flat).

Referenced by ImportData(), ImportData(), and operator=().

## ◆ deleteInputData

bool Ogre::Terrain::ImportData::deleteInputData

Whether this structure should 'own' the input data (inputImage and inputFloat), and therefore delete it on destruction.

The default is false so you have to manage your own memory. If you set it to true, then you must have allocated the memory through OGRE_NEW (for Image) and OGRE_ALLOC_T (for inputFloat), the latter with the category MEMCATEGORY_GEOMETRY.

Referenced by ImportData(), ImportData(), destroy(), and operator=().

## ◆ inputScale

Real Ogre::Terrain::ImportData::inputScale

How to scale the input values provided (if any).

Referenced by ImportData(), ImportData(), and operator=().

## ◆ inputBias

Real Ogre::Terrain::ImportData::inputBias

How to bias the input values provided (if any).

Referenced by ImportData(), ImportData(), and operator=().

## ◆ layerDeclaration

TerrainLayerDeclaration Ogre::Terrain::ImportData::layerDeclaration

Definition of the contents of each layer (required).

Most likely, you will pull a declaration from a TerrainMaterialGenerator of your choice.

Referenced by operator=().

## ◆ layerList

LayerInstanceList Ogre::Terrain::ImportData::layerList

List of layer structures, one for each layer required.

Can be empty or underfilled if required, list will be padded with blank textures.

Referenced by operator=().

The documentation for this struct was generated from the following file:

- OgreTerrain.h