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();
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);
429 void boxIntersects(
const AxisAlignedBox& box, TerrainList* resultList)
const;
439 void sphereIntersects(
const Sphere& sphere, TerrainList* resultList)
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;
464 TerrainIterator getTerrainIterator();
466 ConstTerrainIterator getTerrainIterator()
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);
Terrain::Alignment mAlignment
TerrainSlot(long _x, long _y)
Vector3 position
Position at which the intersection occurred.
Slot for a terrain instance, together with its definition.
virtual const Vector3 & getOrigin() const
Retrieve the centre position of the grid of terrain.
vector< LayerInstance >::type LayerInstanceList
Interface to a general purpose request / response style background work queue.
MapIterator< TerrainSlotMap > TerrainIterator
Terrain automatic LOD loading.
A sphere primitive, mostly used for bounds checking.
bool hit
Whether an intersection occurred.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
void setResourceGroup(const String &grp)
Set the resource group in which files will be located.
Concrete IteratorWrapper for const access to the underlying key-value container.
virtual Terrain::ImportData & getDefaultImportSettings()
Retrieve a shared structure which will provide the base settings for all terrains created via this gr...
Structure for holding the load request.
static const uint16 WORKQUEUE_LOAD_REQUEST
float Real
Software floating point type.
Terrain::ImportData * importData
Import data, if this is to be defined based on importing.
SceneManager * mSceneManager
String mFilenameExtension
virtual SceneManager * getSceneManager() const
Retrieve the SceneManager being used for this group.
ConstMapIterator< TerrainSlotMap > ConstTerrainIterator
const String & getFilenameExtension() const
virtual uint16 getTerrainSize() const
Retrieve the size of each terrain instance in number of vertices down one side.
Variant type that can hold Any other type.
virtual Real getTerrainWorldSize() const
Retrieve the world size of each terrain instance.
Terrain * instance
Actual terrain instance.
The main containing class for a chunk of terrain.
Standard 3-dimensional vector.
General purpose request structure.
Result from a terrain ray intersection with the terrain group.
virtual Terrain::Alignment getAlignment() const
Retrieve the alignment of the grid of terrain (cannot be modified after construction).
Helper class to assist you in managing multiple terrain instances that are connected to each other...
General purpose response structure.
Terrain::DefaultGpuBufferAllocator mBufferAllocator
TerrainSlotDefinition def
Definition used to load the terrain.
static const uint16 CHUNK_VERSION
#define _OgreTerrainExport
Alignment
The alignment of the terrain.
TerrainAutoUpdateLod * mAutoUpdateLod
vector< Terrain * >::type TerrainList
Terrain * terrain
Which terrain instance was hit, if any.
_OgreTerrainExport friend std::ostream & operator<<(std::ostream &o, const LoadRequest &r)
Utility class providing helper methods for reading / writing structured data held in a DataStream...
RayResult(bool _hit, Terrain *_terrain, const Vector3 &_pos)
String filename
Filename, if this is to be loaded from a file.
Class representing an image file.
map< uint32, TerrainSlot * >::type TerrainSlotMap
Packed map, signed 16 bits for each axis from -32767 to +32767.
Interface definition for a handler of responses.
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
static const uint32 CHUNK_ID
const String & getResourceGroup() const
Get the resource group in which files will be located.
Structure encapsulating import data that you may use to bootstrap the terrain without loading from a ...
Definition of how to populate a 'slot' in the terrain group.
TerrainSlotMap mTerrainSlots
Terrain::ImportData mDefaultImportData
A 3D box aligned with the x/y/z axes.
Manages the organisation and rendering of a 'scene' i.e.
static uint loadingTaskNum
Standard implementation of a buffer allocator which re-uses buffers.
Interface definition for a handler of requests.
const String & getFilenamePrefix() const
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Representation of a ray in space, i.e.