29 #ifndef __Ogre_TerrainGroup_H__
30 #define __Ogre_TerrainGroup_H__
80 Real terrainWorldSize);
110 virtual void setOrigin(
const Vector3& pos);
137 void setFilenameConvention(
const String& prefix,
const String& extension);
139 void setFilenamePrefix(
const String& prefix);
141 void setFilenameExtension(
const String& extension);
164 virtual void defineTerrain(
long x,
long y);
176 virtual void defineTerrain(
long x,
long y,
float constantHeight);
228 virtual void defineTerrain(
long x,
long y,
const String& filename);
235 virtual void loadAllTerrains(
bool synchronous =
false);
243 virtual void loadTerrain(
long x,
long y,
bool synchronous =
false);
257 virtual void unloadTerrain(
long x,
long y);
265 virtual void removeTerrain(
long x,
long y);
269 void removeAllTerrains();
285 void saveAllTerrains(
bool onlyIfModified,
bool replaceManualFilenames =
true);
300 void useImportData();
304 void freeImportData();
331 virtual TerrainSlotDefinition* getTerrainDefinition(
long x,
long y)
const;
338 virtual Terrain* getTerrain(
long x,
long y)
const;
344 void freeTemporaryResources();
349 void update(
bool synchronous =
false);
354 void updateGeometry();
359 void updateDerivedData(
bool synchronous =
false,
uint8 typeMask = 0xFF);
373 : hit(_hit), terrain(_terrain), position(_pos) {}
392 float getHeightAtWorldPosition(
const Vector3& pos,
Terrain** ppTerrain = 0);
403 RayResult rayIntersects(
const Ray& ray,
Real distanceLimit = 0)
const;
431 void convertWorldPositionToTerrainSlot(
const Vector3& pos,
long *x,
long *y)
const;
437 void convertTerrainSlotToWorldPosition(
long x,
long y,
Vector3* pos)
const;
442 bool isDerivedDataUpdateInProgress()
const;
464 uint32 packIndex(
long x,
long y)
const;
467 void unpackIndex(
uint32 key,
long *x,
long *y);
470 String generateFilename(
long x,
long y)
const;
474 void saveGroupDefinition(
const String& filename);
480 void loadGroupDefinition(
const String& filename);
505 Vector3 getTerrainSlotPosition(
long x,
long y);
507 TerrainSlot* getTerrainSlot(
long x,
long y,
bool createIfMissing);
509 void connectNeighbour(
TerrainSlot* slot,
long offsetx,
long offsety);
511 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
#define _OgreTerrainExport
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Structure for holding the load request.
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.
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 (cannot be modified after construction).
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)