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

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15