29 #ifndef __Ogre_TerrainGroup_H__
30 #define __Ogre_TerrainGroup_H__
81 Real terrainWorldSize);
111 virtual void setOrigin(
const Vector3& pos);
128 virtual void setTerrainWorldSize(
Real newWorldSize);
137 virtual void setTerrainSize(
uint16 newTerrainSize);
151 void setFilenameConvention(
const String& prefix,
const String& extension);
153 void setFilenamePrefix(
const String& prefix);
155 void setFilenameExtension(
const String& extension);
178 virtual void defineTerrain(
long x,
long y);
190 virtual void defineTerrain(
long x,
long y,
float constantHeight);
242 virtual void defineTerrain(
long x,
long y,
const String& filename);
249 virtual void loadAllTerrains(
bool synchronous =
false);
257 virtual void loadTerrain(
long x,
long y,
bool synchronous =
false);
271 virtual void unloadTerrain(
long x,
long y);
279 virtual void removeTerrain(
long x,
long y);
283 void removeAllTerrains();
299 void saveAllTerrains(
bool onlyIfModified,
bool replaceManualFilenames =
true);
314 void useImportData();
318 void freeImportData();
345 virtual TerrainSlotDefinition* getTerrainDefinition(
long x,
long y)
const;
352 virtual Terrain* getTerrain(
long x,
long y)
const;
358 void freeTemporaryResources();
363 void update(
bool synchronous =
false);
368 void updateGeometry();
373 void updateDerivedData(
bool synchronous =
false,
uint8 typeMask = 0xFF);
387 : hit(_hit), terrain(_terrain), position(_pos) {}
406 float getHeightAtWorldPosition(
const Vector3& pos,
Terrain** ppTerrain = 0);
417 RayResult rayIntersects(
const Ray& ray,
Real distanceLimit = 0)
const;
445 void convertWorldPositionToTerrainSlot(
const Vector3& pos,
long *x,
long *y)
const;
451 void convertTerrainSlotToWorldPosition(
long x,
long y,
Vector3* pos)
const;
456 bool isDerivedDataUpdateInProgress()
const;
478 uint32 packIndex(
long x,
long y)
const;
481 void unpackIndex(
uint32 key,
long *x,
long *y);
484 String generateFilename(
long x,
long y)
const;
488 void saveGroupDefinition(
const String& filename);
494 void loadGroupDefinition(
const String& filename);
505 void increaseLodLevel(
long x,
long y,
bool synchronous =
false);
507 void decreaseLodLevel(
long x,
long y);
511 void autoUpdateLod(
long x,
long y,
bool synchronous,
const Any &data);
512 void autoUpdateLodAll(
bool synchronous,
const Any &data);
530 Vector3 getTerrainSlotPosition(
long x,
long y);
532 TerrainSlot* getTerrainSlot(
long x,
long y,
bool createIfMissing);
534 void connectNeighbour(
TerrainSlot* slot,
long offsetx,
long offsety);
536 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
Variant type that can hold Any other type.
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...
Terrain automatic LOD loading.
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.
TerrainAutoUpdateLod * mAutoUpdateLod
virtual Terrain::ImportData & getDefaultImportSettings()
Retrieve a shared structure which will provide the base settings for all terrains created via this gr...
String mFilenameExtension
static uint loadingTaskNum
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)