29 #ifndef __Ogre_TerrainGroup_H__
30 #define __Ogre_TerrainGroup_H__
80 Real terrainWorldSize);
110 virtual void setOrigin(
const Vector3& pos);
127 virtual void setTerrainWorldSize(
Real newWorldSize);
136 virtual void setTerrainSize(
uint16 newTerrainSize);
150 void setFilenameConvention(
const String& prefix,
const String& extension);
152 void setFilenamePrefix(
const String& prefix);
154 void setFilenameExtension(
const String& extension);
177 virtual void defineTerrain(
long x,
long y);
189 virtual void defineTerrain(
long x,
long y,
float constantHeight);
241 virtual void defineTerrain(
long x,
long y,
const String& filename);
248 virtual void loadAllTerrains(
bool synchronous =
false);
256 virtual void loadTerrain(
long x,
long y,
bool synchronous =
false);
270 virtual void unloadTerrain(
long x,
long y);
278 virtual void removeTerrain(
long x,
long y);
282 void removeAllTerrains();
298 void saveAllTerrains(
bool onlyIfModified,
bool replaceManualFilenames =
true);
313 void useImportData();
317 void freeImportData();
344 virtual TerrainSlotDefinition* getTerrainDefinition(
long x,
long y)
const;
351 virtual Terrain* getTerrain(
long x,
long y)
const;
357 void freeTemporaryResources();
362 void update(
bool synchronous =
false);
367 void updateGeometry();
372 void updateDerivedData(
bool synchronous =
false,
uint8 typeMask = 0xFF);
386 : hit(_hit), terrain(_terrain), position(_pos) {}
405 float getHeightAtWorldPosition(
const Vector3& pos,
Terrain** ppTerrain = 0);
416 RayResult rayIntersects(
const Ray& ray,
Real distanceLimit = 0)
const;
444 void convertWorldPositionToTerrainSlot(
const Vector3& pos,
long *x,
long *y)
const;
450 void convertTerrainSlotToWorldPosition(
long x,
long y,
Vector3* pos)
const;
455 bool isDerivedDataUpdateInProgress()
const;
477 uint32 packIndex(
long x,
long y)
const;
480 void unpackIndex(
uint32 key,
long *x,
long *y);
483 String generateFilename(
long x,
long y)
const;
487 void saveGroupDefinition(
const String& filename);
493 void loadGroupDefinition(
const String& filename);
518 Vector3 getTerrainSlotPosition(
long x,
long y);
520 TerrainSlot* getTerrainSlot(
long x,
long y,
bool createIfMissing);
522 void connectNeighbour(
TerrainSlot* slot,
long offsetx,
long offsety);
524 void loadTerrainImpl(
TerrainSlot* slot,
bool synchronous);
Representation of a ray in space, i.e.
Vector3 position
Position at which the intersection occurred.
virtual const Vector3 & getOrigin() const
Retrieve the centre position of the grid of terrain.
Structure encapsulating import data that you may use to bootstrap the terrain without loading from a ...
float Real
Software floating point type.
const String & getFilenamePrefix() const
static const uint32 CHUNK_ID
The main containing class for a chunk of terrain.
vector< LayerInstance >::type LayerInstanceList
ConstMapIterator< TerrainSlotMap > ConstTerrainIterator
General purpose request structure.
SceneManager * mSceneManager
General purpose response structure.
Definition of how to populate a 'slot' in the terrain group.
Manages the organisation and rendering of a 'scene' i.e.
_OgreTerrainExport friend std::ostream & operator<<(std::ostream &o, const LoadRequest &r)
Terrain::ImportData mDefaultImportData
A 3D box aligned with the x/y/z axes.
void setResourceGroup(const String &grp)
Set the resource group in which files will be located.
const String & getFilenameExtension() const
virtual SceneManager * getSceneManager() const
Retrieve the SceneManager being used for this group.
static const uint16 WORKQUEUE_LOAD_REQUEST
Terrain::Alignment mAlignment
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Structure for holding the load request.
virtual uint16 getTerrainSize() const
Retrieve the size of each terrain instance in number of vertices down one side.
bool hit
Whether an intersection occurred.
Terrain * instance
Actual terrain instance.
MapIterator< TerrainSlotMap > TerrainIterator
Terrain::DefaultGpuBufferAllocator mBufferAllocator
static const uint16 CHUNK_VERSION
Terrain * terrain
Which terrain instance was hit, if any.
Interface definition for a handler of requests.
RayResult(bool _hit, Terrain *_terrain, const Vector3 &_pos)
String filename
Filename, if this is to be loaded from a file.
virtual Terrain::Alignment getAlignment() const
Retrieve the alignment of the grid of terrain (cannot be modified after construction).
A sphere primitive, mostly used for bounds checking.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
TerrainSlotDefinition def
Definition used to load the terrain.
Terrain::ImportData * importData
Import data, if this is to be defined based on importing.
#define _OgreTerrainExport
Alignment
The alignment of the terrain.
Utility class providing helper methods for reading / writing structured data held in a DataStream...
Standard 3-dimensional vector.
Interface definition for a handler of responses.
Class representing an image file.
Result from a terrain ray intersection with the terrain group.
virtual Terrain::ImportData & getDefaultImportSettings()
Retrieve a shared structure which will provide the base settings for all terrains created via this gr...
String mFilenameExtension
Concrete IteratorWrapper for const access to the underlying key-value container.
map< uint32, TerrainSlot * >::type TerrainSlotMap
Packed map, signed 16 bits for each axis from -32767 to +32767.
Standard implementation of a buffer allocator which re-uses buffers.
Slot for a terrain instance, together with its definition.
virtual Real getTerrainWorldSize() const
Retrieve the world size of each terrain instance.
Interface to a general purpose request / response style background work queue.
const String & getResourceGroup() const
Get the resource group in which files will be located.
TerrainSlotMap mTerrainSlots
vector< Terrain * >::type TerrainList
Helper class to assist you in managing multiple terrain instances that are connected to each other...
TerrainSlot(long _x, long _y)