OgreTerrain.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Ogre_Terrain_H__
#define __Ogre_Terrain_H__
#include "OgreTerrainPrerequisites.h"
#include "OgreCommon.h"
#include "OgreVector3.h"
#include "OgreAxisAlignedBox.h"
#include "OgreSceneManager.h"
#include "OgreTerrainMaterialGenerator.h"
#include "OgreTerrainLayerBlendMap.h"
#include "OgreWorkQueue.h"
#include "OgreTerrainLodManager.h"
namespace Ogre
{
class _OgreTerrainExport Terrain : public SceneManager::Listener,
public WorkQueue::RequestHandler, public WorkQueue::ResponseHandler, public TerrainAlloc
{
public:
friend class TerrainLodManager;
Terrain(SceneManager* sm);
virtual ~Terrain();
static const uint32 TERRAIN_CHUNK_ID;
static const uint16 TERRAIN_CHUNK_VERSION;
static const uint16 TERRAIN_MAX_BATCH_SIZE;
static const uint64 TERRAIN_GENERATE_MATERIAL_INTERVAL_MS;
static const uint32 TERRAINLAYERDECLARATION_CHUNK_ID;
static const uint16 TERRAINLAYERDECLARATION_CHUNK_VERSION;
static const uint32 TERRAINLAYERSAMPLER_CHUNK_ID;
static const uint16 TERRAINLAYERSAMPLER_CHUNK_VERSION;
static const uint32 TERRAINLAYERSAMPLERELEMENT_CHUNK_ID;
static const uint16 TERRAINLAYERSAMPLERELEMENT_CHUNK_VERSION;
static const uint32 TERRAINLAYERINSTANCE_CHUNK_ID;
static const uint16 TERRAINLAYERINSTANCE_CHUNK_VERSION;
static const uint32 TERRAINDERIVEDDATA_CHUNK_ID;
static const uint16 TERRAINDERIVEDDATA_CHUNK_VERSION;
static const uint32 TERRAINGENERALINFO_CHUNK_ID;
static const uint16 TERRAINGENERALINFO_CHUNK_VERSION;
static const size_t LOD_MORPH_CUSTOM_PARAM;
typedef vector<Real>::type RealVector;
struct _OgreTerrainExport LayerInstance
{
Real worldSize;
StringVector textureNames;
LayerInstance()
: worldSize(100) {}
};
typedef vector<LayerInstance>::type LayerInstanceList;
enum Alignment
{
ALIGN_X_Z = 0,
ALIGN_X_Y = 1,
ALIGN_Y_Z = 2
};
struct ImportData
{
Alignment terrainAlign;
uint16 terrainSize;
uint16 maxBatchSize;
uint16 minBatchSize;
Vector3 pos;
Real worldSize;
Image* inputImage;
float* inputFloat;
float constantHeight;
bool deleteInputData;
Real inputScale;
Real inputBias;
TerrainLayerDeclaration layerDeclaration;
LayerInstanceList layerList;
ImportData()
: terrainAlign(ALIGN_X_Z)
, terrainSize(1025)
, maxBatchSize(65)
, minBatchSize(17)
, pos(Vector3::ZERO)
, worldSize(1000)
, inputImage(0)
, inputFloat(0)
, constantHeight(0)
, deleteInputData(false)
, inputScale(1.0)
, inputBias(0.0)
{
}
ImportData(const ImportData& rhs)
: terrainAlign(ALIGN_X_Z)
, terrainSize(1025)
, maxBatchSize(65)
, minBatchSize(17)
, pos(Vector3::ZERO)
, worldSize(1000)
, inputImage(0)
, inputFloat(0)
, constantHeight(0)
, deleteInputData(false)
, inputScale(1.0)
, inputBias(0.0)
{
*this = rhs;
}
ImportData& operator=(const ImportData& rhs)
{
// basic copy
terrainAlign = rhs.terrainAlign;
terrainSize = rhs.terrainSize;
maxBatchSize = rhs.maxBatchSize;
minBatchSize = rhs.minBatchSize;
pos = rhs.pos;
worldSize = rhs.worldSize;
constantHeight = rhs.constantHeight;
deleteInputData = rhs.deleteInputData;
inputScale = rhs.inputScale;
inputBias = rhs.inputBias;
layerDeclaration = rhs.layerDeclaration;
layerList = rhs.layerList;
// By-value copies in ownership cases
if (rhs.deleteInputData)
{
if (rhs.inputImage)
inputImage = OGRE_NEW Image(*rhs.inputImage);
else
inputImage = 0;
if (rhs.inputFloat)
{
inputFloat = OGRE_ALLOC_T(float, terrainSize*terrainSize, MEMCATEGORY_GEOMETRY);
memcpy(inputFloat, rhs.inputFloat, sizeof(float) * terrainSize*terrainSize);
}
else
inputFloat = 0;
}
else
{
// re-use pointers
inputImage = rhs.inputImage;
inputFloat = rhs.inputFloat;
}
return *this;
}
void destroy()
{
if (deleteInputData)
{
OGRE_DELETE inputImage;
OGRE_FREE(inputFloat, MEMCATEGORY_GEOMETRY);
inputImage = 0;
inputFloat = 0;
}
}
~ImportData()
{
destroy();
}
};
enum NeighbourIndex
{
NEIGHBOUR_EAST = 0,
NEIGHBOUR_NORTHEAST = 1,
NEIGHBOUR_NORTH = 2,
NEIGHBOUR_NORTHWEST = 3,
NEIGHBOUR_WEST = 4,
NEIGHBOUR_SOUTHWEST = 5,
NEIGHBOUR_SOUTH = 6,
NEIGHBOUR_SOUTHEAST = 7,
NEIGHBOUR_COUNT = 8
};
SceneManager* getSceneManager() const { return mSceneMgr; }
enum Space
{
WORLD_SPACE = 0,
LOCAL_SPACE = 1,
TERRAIN_SPACE = 2,
POINT_SPACE = 3
};
class _OgreTerrainExport GpuBufferAllocator : public TerrainAlloc
{
public:
GpuBufferAllocator() {}
virtual ~GpuBufferAllocator() {}
virtual void allocateVertexBuffers(Terrain* forTerrain, size_t numVertices, HardwareVertexBufferSharedPtr& destPos, HardwareVertexBufferSharedPtr& destDelta) = 0;
virtual void freeVertexBuffers(const HardwareVertexBufferSharedPtr& posbuf, const HardwareVertexBufferSharedPtr& deltabuf) = 0;
virtual HardwareIndexBufferSharedPtr getSharedIndexBuffer(uint16 batchSize,
uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols,
uint16 skirtRowColSkip) = 0;
virtual void freeAllBuffers() = 0;
};
class _OgreTerrainExport DefaultGpuBufferAllocator : public GpuBufferAllocator
{
public:
DefaultGpuBufferAllocator();
virtual ~DefaultGpuBufferAllocator();
void allocateVertexBuffers(Terrain* forTerrain, size_t numVertices, HardwareVertexBufferSharedPtr& destPos, HardwareVertexBufferSharedPtr& destDelta);
void freeVertexBuffers(const HardwareVertexBufferSharedPtr& posbuf, const HardwareVertexBufferSharedPtr& deltabuf);
HardwareIndexBufferSharedPtr getSharedIndexBuffer(uint16 batchSize,
uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols,
uint16 skirtRowColSkip);
void freeAllBuffers();
void warmStart(size_t numInstances, uint16 terrainSize, uint16 maxBatchSize,
uint16 minBatchSize);
protected:
typedef list<HardwareVertexBufferSharedPtr>::type VBufList;
VBufList mFreePosBufList;
VBufList mFreeDeltaBufList;
typedef map<uint32, HardwareIndexBufferSharedPtr>::type IBufMap;
IBufMap mSharedIBufMap;
uint32 hashIndexBuffer(uint16 batchSize,
uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols,
uint16 skirtRowColSkip);
HardwareVertexBufferSharedPtr getVertexBuffer(VBufList& list, size_t vertexSize, size_t numVertices);
};
void setGpuBufferAllocator(GpuBufferAllocator* alloc);
GpuBufferAllocator* getGpuBufferAllocator();
static size_t _getNumIndexesForBatchSize(uint16 batchSize);
static void _populateIndexBuffer(uint16* pIndexes, uint16 batchSize,
uint16 vdatasize, size_t vertexIncrement, uint16 xoffset, uint16 yoffset, uint16 numSkirtRowsCols,
uint16 skirtRowColSkip);
static uint16 _calcSkirtVertexIndex(uint16 mainIndex, uint16 vdatasize, bool isCol,
uint16 numSkirtRowsCols, uint16 skirtRowColSkip);
void convertPosition(Space inSpace, const Vector3& inPos, Space outSpace, Vector3& outPos) const;
Vector3 convertPosition(Space inSpace, const Vector3& inPos, Space outSpace) const;
void convertDirection(Space inSpace, const Vector3& inDir, Space outSpace, Vector3& outDir) const;
Vector3 convertDirection(Space inSpace, const Vector3& inDir, Space outSpace) const;
void setResourceGroup(const String& resGroup) { mResourceGroup = resGroup; }
const String& getResourceGroup() const { return mResourceGroup; }
const String& _getDerivedResourceGroup() const;
void save(const String& filename);
void save(StreamSerialiser& stream);
bool prepare(const String& filename);
bool prepare(DataStreamPtr& stream);
bool prepare(StreamSerialiser& stream);
bool prepare(const ImportData& importData);
void load(const String& filename);
void load(StreamSerialiser& stream);
void load(int lodLevel = 0, bool synchronous = true);
bool isLoaded() const { return mIsLoaded; }
bool isModified() const { return mModified; }
bool isHeightDataModified() const { return mHeightDataModified; }
void unload();
void unprepare();
float* getHeightData() const;
float* getHeightData(long x, long y) const;
float getHeightAtPoint(long x, long y) const;
void setHeightAtPoint(long x, long y, float h);
float getHeightAtTerrainPosition(Real x, Real y) const;
float getHeightAtWorldPosition(Real x, Real y, Real z) const;
float getHeightAtWorldPosition(const Vector3& pos) const;
const float* getDeltaData() const;
const float* getDeltaData(long x, long y) const;
void getPoint(long x, long y, Vector3* outpos) const;
void getPointFromSelfOrNeighbour(long x, long y, Vector3* outpos) const;
void getPoint(long x, long y, float height, Vector3* outpos) const;
void getPointTransform(Matrix4* outXform) const;
void getTerrainVector(const Vector3& inVec, Vector3* outVec) const;
void getTerrainVectorAlign(const Vector3& inVec, Alignment align, Vector3* outVec) const;
void getTerrainVector(Real x, Real y, Real z, Vector3* outVec) const;
void getTerrainVectorAlign(Real x, Real y, Real z, Alignment align, Vector3* outVec) const;
void getVector(const Vector3& inVec, Vector3* outVec) const;
void getVectorAlign(const Vector3& inVec, Alignment align, Vector3* outVec) const;
void getVector(Real x, Real y, Real z, Vector3* outVec) const;
void getVectorAlign(Real x, Real y, Real z, Alignment align, Vector3* outVec) const;
void getPosition(const Vector3& TSpos, Vector3* outWSpos) const;
void getPosition(Real x, Real y, Real z, Vector3* outWSpos) const;
void getTerrainPosition(const Vector3& WSpos, Vector3* outTSpos) const;
void getTerrainPosition(Real x, Real y, Real z, Vector3* outTSpos) const;
void getPositionAlign(const Vector3& TSpos, Alignment align, Vector3* outWSpos) const;
void getPositionAlign(Real x, Real y, Real z, Alignment align, Vector3* outWSpos) const;
void getTerrainPositionAlign(const Vector3& WSpos, Alignment align, Vector3* outTSpos) const;
void getTerrainPositionAlign(Real x, Real y, Real z, Alignment align, Vector3* outTSpos) const;
Alignment getAlignment() const;
uint16 getSize() const;
void setSize(uint16 newSize);
uint16 getMaxBatchSize() const;
uint16 getMinBatchSize() const;
Real getWorldSize() const;
void setWorldSize(Real newWorldSize);
uint8 getLayerCount() const { return static_cast<uint8>(mLayers.size()); }
const TerrainLayerDeclaration& getLayerDeclaration() const { return mLayerDecl; }
void addLayer(Real worldSize = 0, const StringVector* textureNames = 0);
void addLayer(uint8 index, Real worldSize = 0, const StringVector* textureNames = 0);
void removeLayer(uint8 index);
void replaceLayer(uint8 index, bool keepBlends, Real worldSize = 0, const StringVector* textureNames = 0);
uint8 getMaxLayers() const;
Real getLayerWorldSize(uint8 index) const;
void setLayerWorldSize(uint8 index, Real size);
Real getLayerUVMultiplier(uint8 index) const;
const String& getLayerTextureName(uint8 layerIndex, uint8 samplerIndex) const;
void setLayerTextureName(uint8 layerIndex, uint8 samplerIndex, const String& textureName);
uint16 getLayerBlendMapSize() const { return mLayerBlendMapSize; }
uint16 getLightmapSize() const { return mLightmapSize; }
const TexturePtr& getLightmap() const { return mLightmap; }
uint16 getCompositeMapSize() const { return mCompositeMapSize; }
const TexturePtr& getCompositeMap() const { return mCompositeMap; }
const Vector3& getPosition() const { return mPos; }
void setPosition(const Vector3& pos);
SceneNode* _getRootSceneNode() const;
void dirty();
void dirtyRect(const Rect& rect);
void _dirtyCompositeMapRect(const Rect& rect);
void dirtyLightmapRect(const Rect& rect);
void dirtyLightmap();
void update(bool synchronous = false);
void updateGeometry();
void updateGeometryWithoutNotifyNeighbours();
// Used as a type mask for updateDerivedData
static const uint8 DERIVED_DATA_DELTAS;
static const uint8 DERIVED_DATA_NORMALS;
static const uint8 DERIVED_DATA_LIGHTMAP;
static const uint8 DERIVED_DATA_ALL;
void updateDerivedData(bool synchronous = false, uint8 typeMask = 0xFF);
void updateCompositeMap();
void updateCompositeMapWithDelay(Real delay = 2);
Real getSkirtSize() const { return mSkirtSize; }
uint16 getNumLodLevels() const { return mNumLodLevels; }
uint16 getNumLodLevelsPerLeaf() const { return mNumLodLevelsPerLeafNode; }
Rect calculateHeightDeltas(const Rect& rect);
void finaliseHeightDeltas(const Rect& rect, bool cpuData);
PixelBox* calculateNormals(const Rect& rect, Rect& outFinalRect);
void finaliseNormals(const Rect& rect, PixelBox* normalsBox);
PixelBox* calculateLightmap(const Rect& rect, const Rect& extraTargetRect, Rect& outFinalRect);
void finaliseLightmap(const Rect& rect, PixelBox* lightmapBox);
uint16 getResolutionAtLod(uint16 lodLevel) const;
std::pair<bool, Vector3> rayIntersects(const Ray& ray,
bool cascadeToNeighbours = false, Real distanceLimit = 0); //const;
const AxisAlignedBox& getAABB() const;
AxisAlignedBox getWorldAABB() const;
Real getMinHeight() const;
Real getMaxHeight() const;
Real getBoundingRadius() const;
const MaterialPtr& getMaterial() const;
const MaterialPtr& _getMaterial() const { return mMaterial; }
const MaterialPtr& getCompositeMapMaterial() const;
const MaterialPtr& _getCompositeMapMaterial() const { return mCompositeMapMaterial; }
const String& getMaterialName() const { return mMaterialName; }
void preFindVisibleObjects(SceneManager* source,
SceneManager::IlluminationRenderStage irs, Viewport* v);
void sceneManagerDestroyed(SceneManager* source);
uint8 getRenderQueueGroup(void) const { return mRenderQueueGroup; }
void setRenderQueueGroup(uint8 grp) { mRenderQueueGroup = grp; }
uint32 getVisibilityFlags(void) const { return mVisibilityFlags; }
void setVisibilityFlags(uint32 flags) { mVisibilityFlags = flags; }
uint32 getQueryFlags(void) const { return mQueryFlags; }
void setQueryFlags(uint32 flags) { mQueryFlags = flags; }
void addQueryFlags(uint32 flags) { mQueryFlags |= flags; }
/* As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object. */
void removeQueryFlags(uint32 flags) { mQueryFlags &= ~flags; }
TerrainLayerBlendMap* getLayerBlendMap(uint8 layerIndex);
uint8 getBlendTextureIndex(uint8 layerIndex) const;
uint8 getBlendTextureCount() const;
uint8 getBlendTextureCount(uint8 numLayers) const;
const String& getBlendTextureName(uint8 textureIndex) const;
void setGlobalColourMapEnabled(bool enabled, uint16 size = 0);
bool getGlobalColourMapEnabled() const { return mGlobalColourMapEnabled; }
uint16 getGlobalColourMapSize() const { return mGlobalColourMapSize; }
const TexturePtr& getGlobalColourMap() const { return mColourMap; }
void widenRectByVector(const Vector3& vec, const Rect& inRect, Rect& outRect);
void widenRectByVector(const Vector3& vec, const Rect& inRect,
Real minHeight, Real maxHeight, Rect& outRect);
void freeTemporaryResources();
const TexturePtr& getLayerBlendTexture(uint8 index) const;
std::pair<uint8,uint8> getLayerBlendTextureIndex(uint8 layerIndex) const;
void _setMorphRequired(bool morph) { mLodMorphRequired = morph; }
bool _getMorphRequired() const { return mLodMorphRequired; }
void _setNormalMapRequired(bool normalMap);
void _setLightMapRequired(bool lightMap, bool shadowsOnly = false);
void _setCompositeMapRequired(bool compositeMap);
bool _getUseVertexCompression() const;
bool canHandleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ);
WorkQueue::Response* handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ);
bool canHandleResponse(const WorkQueue::Response* res, const WorkQueue* srcQ);
void handleResponse(const WorkQueue::Response* res, const WorkQueue* srcQ);
void handleGenerateMaterialResponse(const WorkQueue::Response* res, const WorkQueue* srcQ);
static const uint16 WORKQUEUE_DERIVED_DATA_REQUEST;
static const uint16 WORKQUEUE_GENERATE_MATERIAL_REQUEST;
uint16 getLODLevelWhenVertexEliminated(long x, long y) const;
uint16 getLODLevelWhenVertexEliminated(long rowOrColulmn) const;
TerrainQuadTreeNode* getQuadTree() { return mQuadTree; }
TexturePtr getTerrainNormalMap() const { return mTerrainNormalMap; }
Terrain* getNeighbour(NeighbourIndex index) const;
void setNeighbour(NeighbourIndex index, Terrain* neighbour, bool recalculate = false, bool notifyOther = true);
static NeighbourIndex getOppositeNeighbour(NeighbourIndex index);
static NeighbourIndex getNeighbourIndex(long offsetx, long offsety);
void notifyNeighbours();
void neighbourModified(NeighbourIndex index, const Rect& edgerect, const Rect& shadowrect);
Terrain* raySelectNeighbour(const Ray& ray, Real distanceLimit = 0);
void _dumpTextures(const String& prefix, const String& suffix);
bool isDerivedDataUpdateInProgress() const { return mDerivedDataUpdateInProgress; }
static void convertWorldToTerrainAxes(Alignment align, const Vector3& worldVec, Vector3* terrainVec);
static void convertTerrainToWorldAxes(Alignment align, const Vector3& terrainVec, Vector3* worldVec);
static void writeLayerDeclaration(const TerrainLayerDeclaration& decl, StreamSerialiser& ser);
static bool readLayerDeclaration(StreamSerialiser& ser, TerrainLayerDeclaration& targetdecl);
static void writeLayerInstanceList(const Terrain::LayerInstanceList& lst, StreamSerialiser& ser);
static bool readLayerInstanceList(StreamSerialiser& ser, size_t numSamplers, Terrain::LayerInstanceList& targetlst);
// This mutex is write-locked by neighbours if they are in the process of deleting themselves.
// It should be read-locked whenever using neighbours in calculations which are possibly running in a
// background thread.
OGRE_RW_MUTEX(mNeighbourMutex);
protected:
uint getGeoDataSizeAtLod(uint16 lodLevel) const;
inline int getPositiveLodLevel( int lodLevel ) const
{
return (lodLevel>=0) ? lodLevel : mNumLodLevels+lodLevel;
}
void freeLodData();
void freeCPUResources();
void freeGPUResources();
void determineLodLevels();
void distributeVertexData();
void updateBaseScale();
void createGPUBlendTextures();
void createLayerBlendMaps();
void createOrDestroyGPUNormalMap();
void createOrDestroyGPUColourMap();
void createOrDestroyGPULightmap();
void createOrDestroyGPUCompositeMap();
void waitForDerivedProcesses();
void convertSpace(Space inSpace, const Vector3& inVec, Space outSpace, Vector3& outVec, bool translation) const;
Vector3 convertWorldToTerrainAxes(const Vector3& inVec) const;
Vector3 convertTerrainToWorldAxes(const Vector3& inVec) const;
void getPointAlign(long x, long y, Alignment align, Vector3* outpos) const;
void getPointAlign(long x, long y, float height, Alignment align, Vector3* outpos) const;
void calculateCurrentLod(Viewport* vp);
std::pair<bool, Vector3> checkQuadIntersection(int x, int y, const Ray& ray); //const;
void deleteBlendMaps(uint8 lowIndex);
void shiftUpGPUBlendChannels(uint8 index);
void shiftDownGPUBlendChannels(uint8 index);
void copyBlendTextureChannel(uint8 srcIndex, uint8 srcChannel, uint8 destIndex, uint8 destChannel );
void clearGPUBlendChannel(uint8 index, uint channel);
void copyGlobalOptions();
void checkLayers(bool includeGPUResources);
void checkDeclaration();
void deriveUVMultipliers();
PixelFormat getBlendTextureFormat(uint8 textureIndex, uint8 numLayers) const;
void updateDerivedDataImpl(const Rect& rect, const Rect& lightmapExtraRect, bool synchronous, uint8 typeMask);
void getEdgeRect(NeighbourIndex index, long range, Rect* outRect) const;
// get the equivalent of the passed in edge rectangle in neighbour
void getNeighbourEdgeRect(NeighbourIndex index, const Rect& inRect, Rect* outRect) const;
// get the equivalent of the passed in edge point in neighbour
void getNeighbourPoint(NeighbourIndex index, long x, long y, long *outx, long *outy) const;
// overflow a point into a neighbour index and point
void getNeighbourPointOverflow(long x, long y, NeighbourIndex *outindex, long *outx, long *outy) const;
void removeFromNeighbours();
uint16 mWorkQueueChannel;
SceneManager* mSceneMgr;
SceneNode* mRootNode;
String mResourceGroup;
bool mIsLoaded;
bool mModified;
bool mHeightDataModified;
float* mHeightData;
float* mDeltaData;
Alignment mAlign;
Real mWorldSize;
uint16 mSize;
uint16 mMaxBatchSize;
uint16 mMinBatchSize;
Vector3 mPos;
TerrainQuadTreeNode* mQuadTree;
uint16 mNumLodLevels;
uint16 mNumLodLevelsPerLeafNode;
uint16 mTreeDepth;
Real mBase;
Real mScale;
TerrainLayerDeclaration mLayerDecl;
LayerInstanceList mLayers;
RealVector mLayerUVMultiplier;
Real mSkirtSize;
uint8 mRenderQueueGroup;
uint32 mVisibilityFlags;
uint32 mQueryFlags;
Rect mDirtyGeometryRect;
Rect mDirtyDerivedDataRect;
Rect mDirtyGeometryRectForNeighbours;
Rect mDirtyLightmapFromNeighboursRect;
bool mDerivedDataUpdateInProgress;
uint8 mDerivedUpdatePendingMask;
bool mGenerateMaterialInProgress;
mutable bool mPrepareInProgress;
struct DerivedDataRequest
{
Terrain* terrain;
// types requested
uint8 typeMask;
Rect dirtyRect;
Rect lightmapExtraDirtyRect;
_OgreTerrainExport friend std::ostream& operator<<(std::ostream& o, const DerivedDataRequest& r)
{ return o; }
};
struct DerivedDataResponse
{
Terrain* terrain;
uint8 remainingTypeMask;
Rect deltaUpdateRect;
Rect normalUpdateRect;
Rect lightmapUpdateRect;
PixelBox* normalMapBox;
PixelBox* lightMapBox;
_OgreTerrainExport friend std::ostream& operator<<(std::ostream& o, const DerivedDataResponse& r)
{ return o; }
};
enum GenerateMaterialStage{
GEN_MATERIAL,
GEN_COMPOSITE_MAP_MATERIAL
};
struct GenerateMaterialRequest
{
Terrain* terrain;
unsigned long startTime;
GenerateMaterialStage stage;
bool synchronous;
_OgreTerrainExport friend std::ostream& operator<<(std::ostream& o, const GenerateMaterialRequest& r)
{ return o; }
};
String mMaterialName;
mutable MaterialPtr mMaterial;
mutable TerrainMaterialGeneratorPtr mMaterialGenerator;
mutable unsigned long long int mMaterialGenerationCount;
mutable bool mMaterialDirty;
mutable bool mMaterialParamsDirty;
uint16 mLayerBlendMapSize;
uint16 mLayerBlendMapSizeActual;
typedef vector<uint8*>::type BytePointerList;
BytePointerList mCpuBlendMapStorage;
typedef vector<TexturePtr>::type TexturePtrList;
TexturePtrList mBlendTextureList;
TerrainLayerBlendMapList mLayerBlendMapList;
uint16 mGlobalColourMapSize;
bool mGlobalColourMapEnabled;
TexturePtr mColourMap;
uint8* mCpuColourMapStorage;
uint16 mLightmapSize;
uint16 mLightmapSizeActual;
TexturePtr mLightmap;
uint8* mCpuLightmapStorage;
uint16 mCompositeMapSize;
uint16 mCompositeMapSizeActual;
TexturePtr mCompositeMap;
uint8* mCpuCompositeMapStorage;
Rect mCompositeMapDirtyRect;
unsigned long mCompositeMapUpdateCountdown;
unsigned long mLastMillis;
bool mCompositeMapDirtyRectLightmapUpdate;
mutable MaterialPtr mCompositeMapMaterial;
static NameGenerator msBlendTextureGenerator;
static NameGenerator msNormalMapNameGenerator;
static NameGenerator msLightmapNameGenerator;
static NameGenerator msCompositeMapNameGenerator;
bool mLodMorphRequired;
bool mNormalMapRequired;
bool mLightMapRequired;
bool mLightMapShadowsOnly;
bool mCompositeMapRequired;
TexturePtr mTerrainNormalMap;
PixelBox* mCpuTerrainNormalMap;
const Camera* mLastLODCamera;
unsigned long mLastLODFrame;
int mLastViewportHeight;
Terrain* mNeighbours[NEIGHBOUR_COUNT];
GpuBufferAllocator* mCustomGpuBufferAllocator;
DefaultGpuBufferAllocator mDefaultGpuBufferAllocator;
size_t getPositionBufVertexSize() const;
size_t getDeltaBufVertexSize() const;
TerrainLodManager* mLodManager;
public:
void increaseLodLevel(bool synchronous = false);
void decreaseLodLevel();
int getHighestLodPrepared() const { return (mLodManager) ? mLodManager->getHighestLodPrepared() : -1; };
int getHighestLodLoaded() const { return (mLodManager) ? mLodManager->getHighestLodLoaded() : -1; };
int getTargetLodLevel() const { return (mLodManager) ? mLodManager->getTargetLodLevel() : -1; };
};
class _OgreTerrainExport TerrainGlobalOptions : public TerrainAlloc, public Singleton<TerrainGlobalOptions>
{
protected:
Real mSkirtSize;
Vector3 mLightMapDir;
bool mCastsShadows;
Real mMaxPixelError;
uint8 mRenderQueueGroup;
uint32 mVisibilityFlags;
uint32 mQueryFlags;
bool mUseRayBoxDistanceCalculation;
TerrainMaterialGeneratorPtr mDefaultMaterialGenerator;
uint16 mLayerBlendMapSize;
Real mDefaultLayerTextureWorldSize;
uint16 mDefaultGlobalColourMapSize;
uint16 mLightmapSize;
uint16 mCompositeMapSize;
ColourValue mCompositeMapAmbient;
ColourValue mCompositeMapDiffuse;
Real mCompositeMapDistance;
String mResourceGroup;
bool mUseVertexCompressionWhenAvailable;
public:
TerrainGlobalOptions();
virtual ~TerrainGlobalOptions() {}
Real getSkirtSize() const { return mSkirtSize; }
void setSkirtSize(Real skirtSz) { mSkirtSize = skirtSz; }
const Vector3& getLightMapDirection() const { return mLightMapDir; }
void setLightMapDirection(const Vector3& v) { mLightMapDir = v; }
const ColourValue& getCompositeMapAmbient() const { return mCompositeMapAmbient; }
void setCompositeMapAmbient(const ColourValue& c) { mCompositeMapAmbient = c; }
const ColourValue& getCompositeMapDiffuse() const { return mCompositeMapDiffuse; }
void setCompositeMapDiffuse(const ColourValue& c) { mCompositeMapDiffuse = c; }
Real getCompositeMapDistance() const { return mCompositeMapDistance; }
void setCompositeMapDistance(Real c) { mCompositeMapDistance = c; }
bool getCastsDynamicShadows() const { return mCastsShadows; }
void setCastsDynamicShadows(bool s) { mCastsShadows = s; }
Real getMaxPixelError() const { return mMaxPixelError; }
void setMaxPixelError(Real pixerr) { mMaxPixelError = pixerr; }
uint8 getRenderQueueGroup(void) const { return mRenderQueueGroup; }
void setRenderQueueGroup(uint8 grp) { mRenderQueueGroup = grp; }
uint32 getVisibilityFlags(void) const { return mVisibilityFlags; }
void setVisibilityFlags(uint32 flags) { mVisibilityFlags = flags; }
void setQueryFlags(uint32 flags) { mQueryFlags = flags; }
uint32 getQueryFlags(void) const { return mQueryFlags; }
void addQueryFlags(uint32 flags) { mQueryFlags |= flags; }
/* As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object. */
void removeQueryFlags(uint32 flags) { mQueryFlags &= ~flags; }
bool getUseRayBoxDistanceCalculation() const { return mUseRayBoxDistanceCalculation; }
void setUseRayBoxDistanceCalculation(bool rb) { mUseRayBoxDistanceCalculation = rb; }
TerrainMaterialGeneratorPtr getDefaultMaterialGenerator();
void setDefaultMaterialGenerator(TerrainMaterialGeneratorPtr gen);
uint16 getLayerBlendMapSize() const { return mLayerBlendMapSize; }
void setLayerBlendMapSize(uint16 sz) { mLayerBlendMapSize = sz;}
Real getDefaultLayerTextureWorldSize() const { return mDefaultLayerTextureWorldSize; }
void setDefaultLayerTextureWorldSize(Real sz) { mDefaultLayerTextureWorldSize = sz; }
uint16 getDefaultGlobalColourMapSize() const { return mDefaultGlobalColourMapSize; }
void setDefaultGlobalColourMapSize(uint16 sz) { mDefaultGlobalColourMapSize = sz;}
uint16 getLightMapSize() const { return mLightmapSize; }
void setLightMapSize(uint16 sz) { mLightmapSize = sz;}
uint16 getCompositeMapSize() const { return mCompositeMapSize; }
void setCompositeMapSize(uint16 sz) { mCompositeMapSize = sz;}
void setDefaultResourceGroup(const String& grp) { mResourceGroup = grp; }
const String& getDefaultResourceGroup() const { return mResourceGroup; }
bool getUseVertexCompressionWhenAvailable() const { return mUseVertexCompressionWhenAvailable; }
void setUseVertexCompressionWhenAvailable(bool enable) { mUseVertexCompressionWhenAvailable = enable; }
static TerrainGlobalOptions& getSingleton(void);
static TerrainGlobalOptions* getSingletonPtr(void);
};
}
#endif
Ogre::Terrain::DERIVED_DATA_DELTAS
static const uint8 DERIVED_DATA_DELTAS
Definition: OgreTerrain.h:1187
Ogre::Terrain::mDerivedUpdatePendingMask
uint8 mDerivedUpdatePendingMask
If another update is requested while one is already running.
Definition: OgreTerrain.h:1762
Ogre::Terrain::_setMorphRequired
void _setMorphRequired(bool morph)
Request internal implementation options for the terrain material to use, in this case vertex morphing...
Definition: OgreTerrain.h:1475
OgreWorkQueue.h
Ogre::Terrain::DerivedDataResponse::lightmapUpdateRect
Rect lightmapUpdateRect
The area of lightmap that was updated.
Definition: OgreTerrain.h:1790
Ogre::Terrain::TERRAINLAYERDECLARATION_CHUNK_VERSION
static const uint16 TERRAINLAYERDECLARATION_CHUNK_VERSION
Definition: OgreTerrain.h:280
Ogre::Terrain::mPos
Vector3 mPos
Definition: OgreTerrain.h:1738
Ogre::Terrain::DERIVED_DATA_ALL
static const uint8 DERIVED_DATA_ALL
Definition: OgreTerrain.h:1190
Ogre::Terrain::mDerivedDataUpdateInProgress
bool mDerivedDataUpdateInProgress
Definition: OgreTerrain.h:1760
OgreTerrainMaterialGenerator.h
Ogre::Terrain::TERRAINLAYERSAMPLER_CHUNK_ID
static const uint32 TERRAINLAYERSAMPLER_CHUNK_ID
Definition: OgreTerrain.h:281
Ogre::Terrain::ImportData::inputFloat
float * inputFloat
Optional list of terrainSize * terrainSize floats defining the terrain.
Definition: OgreTerrain.h:368
Ogre::Terrain::getGlobalColourMapEnabled
bool getGlobalColourMapEnabled() const
Get whether a global colour map is enabled on this terrain.
Definition: OgreTerrain.h:1417
Ogre::Terrain::mCustomGpuBufferAllocator
GpuBufferAllocator * mCustomGpuBufferAllocator
Definition: OgreTerrain.h:1873
Ogre::Terrain::mCpuBlendMapStorage
BytePointerList mCpuBlendMapStorage
Staging post for blend map data.
Definition: OgreTerrain.h:1824
Ogre::Terrain::mGlobalColourMapSize
uint16 mGlobalColourMapSize
Definition: OgreTerrain.h:1829
OgreAxisAlignedBox.h
OgreVector3.h
Ogre::Terrain::ImportData::terrainAlign
Alignment terrainAlign
The alignment of the terrain.
Definition: OgreTerrain.h:327
Ogre::TerrainGlobalOptions::setUseVertexCompressionWhenAvailable
void setUseVertexCompressionWhenAvailable(bool enable)
Set whether to allow vertex compression to be used when the material generator states that it support...
Definition: OgreTerrain.h:2107
Ogre::Terrain::LayerInstanceList
vector< LayerInstance >::type LayerInstanceList
Definition: OgreTerrain.h:308
Ogre::TerrainGlobalOptions::mLightMapDir
Vector3 mLightMapDir
Definition: OgreTerrain.h:1911
Ogre::Terrain::msCompositeMapNameGenerator
static NameGenerator msCompositeMapNameGenerator
Definition: OgreTerrain.h:1854
Ogre::Terrain::LayerInstance
An instance of a layer, with specific texture names.
Definition: OgreTerrain.h:298
Ogre::Terrain::setQueryFlags
void setQueryFlags(uint32 flags)
Set the query flags for this terrain.
Definition: OgreTerrain.h:1361
Ogre::TerrainLodManager::getTargetLodLevel
int getTargetLodLevel()
Definition: OgreTerrainLodManager.h:118
Ogre::list
Definition: OgrePrerequisites.h:505
Ogre::Terrain::mMaterial
MaterialPtr mMaterial
Definition: OgreTerrain.h:1814
Ogre::Terrain::ImportData::destroy
void destroy()
Delete any input data if this struct is set to do so.
Definition: OgreTerrain.h:476
Ogre::Terrain::DefaultGpuBufferAllocator::mFreeDeltaBufList
VBufList mFreeDeltaBufList
Definition: OgreTerrain.h:593
Ogre::TerrainGlobalOptions::getLightMapSize
uint16 getLightMapSize() const
Get the default size of the lightmaps for a new terrain.
Definition: OgreTerrain.h:2073
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::Terrain::GenerateMaterialRequest::synchronous
bool synchronous
Definition: OgreTerrain.h:1808
Ogre::Terrain::mWorkQueueChannel
uint16 mWorkQueueChannel
Definition: OgreTerrain.h:1721
Ogre::HardwareIndexBufferSharedPtr
Shared pointer implementation used to share index buffers.
Definition: OgreHardwareIndexBuffer.h:79
Ogre::TerrainGlobalOptions::setCastsDynamicShadows
void setCastsDynamicShadows(bool s)
Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps).
Definition: OgreTerrain.h:1973
Ogre::Terrain::ImportData::operator=
ImportData & operator=(const ImportData &rhs)
Definition: OgreTerrain.h:434
Ogre::Terrain::mLodManager
TerrainLodManager * mLodManager
Definition: OgreTerrain.h:1879
Ogre::TerrainGlobalOptions::getLightMapDirection
const Vector3 & getLightMapDirection() const
Get the shadow map light direction to use (world space)
Definition: OgreTerrain.h:1946
Ogre::Terrain::msBlendTextureGenerator
static NameGenerator msBlendTextureGenerator
Definition: OgreTerrain.h:1851
Ogre::TerrainGlobalOptions::getQueryFlags
uint32 getQueryFlags(void) const
Get the default query flags for terrains.
Definition: OgreTerrain.h:2008
Ogre::Terrain::mMaterialParamsDirty
bool mMaterialParamsDirty
Definition: OgreTerrain.h:1818
Ogre::Terrain::isDerivedDataUpdateInProgress
bool isDerivedDataUpdateInProgress() const
Query whether a derived data update is in progress or not.
Definition: OgreTerrain.h:1626
Ogre::Terrain::mLayerUVMultiplier
RealVector mLayerUVMultiplier
Definition: OgreTerrain.h:1749
Ogre::Terrain::mIsLoaded
bool mIsLoaded
Definition: OgreTerrain.h:1725
Ogre::Terrain::mQueryFlags
uint32 mQueryFlags
Definition: OgreTerrain.h:1754
OGRE_DELETE
#define OGRE_DELETE
Definition: OgreMemoryAllocatorConfig.h:474
Ogre::WorkQueue
Interface to a general purpose request / response style background work queue.
Definition: OgreWorkQueue.h:70
Ogre::Terrain::mCompositeMapUpdateCountdown
unsigned long mCompositeMapUpdateCountdown
Definition: OgreTerrain.h:1844
Ogre::Terrain::WORKQUEUE_DERIVED_DATA_REQUEST
static const uint16 WORKQUEUE_DERIVED_DATA_REQUEST
Definition: OgreTerrain.h:1541
Ogre::TerrainGlobalOptions::getLayerBlendMapSize
uint16 getLayerBlendMapSize() const
Get the default size of the blend maps for a new terrain.
Definition: OgreTerrain.h:2045
Ogre::TerrainGlobalOptions::getDefaultGlobalColourMapSize
uint16 getDefaultGlobalColourMapSize() const
Get the default size of the terrain global colour map for a new terrain.
Definition: OgreTerrain.h:2063
Ogre::TerrainGlobalOptions::getMaxPixelError
Real getMaxPixelError() const
Get the maximum screen pixel error that should be allowed when rendering.
Definition: OgreTerrain.h:1976
Ogre::Terrain::getSceneManager
SceneManager * getSceneManager() const
Definition: OgreTerrain.h:510
Ogre::uint64
unsigned long long uint64
Definition: OgrePlatform.h:370
Ogre::Terrain::getMaterialName
const String & getMaterialName() const
Get the name of the material being used for the terrain.
Definition: OgreTerrain.h:1334
Ogre::Terrain::getGlobalColourMap
const TexturePtr & getGlobalColourMap() const
Get access to the global colour map, if enabled.
Definition: OgreTerrain.h:1421
Ogre::Terrain::DerivedDataResponse::operator<<
_OgreTerrainExport friend std::ostream & operator<<(std::ostream &o, const DerivedDataResponse &r)
Definition: OgreTerrain.h:1794
Ogre::Terrain::mTreeDepth
uint16 mTreeDepth
Definition: OgreTerrain.h:1742
Ogre::Terrain::getCompositeMap
const TexturePtr & getCompositeMap() const
Get access to the composite map, if enabled (as requested by the material generator) ...
Definition: OgreTerrain.h:1093
Ogre::Terrain::GpuBufferAllocator
Interface used to by the Terrain instance to allocate GPU buffers.
Definition: OgreTerrain.h:533
Ogre::Terrain::DefaultGpuBufferAllocator::mFreePosBufList
VBufList mFreePosBufList
Definition: OgreTerrain.h:592
Ogre::NameGenerator
Utility class to generate a sequentially numbered series of names.
Definition: OgreNameGenerator.h:56
Ogre::Terrain::isModified
bool isModified() const
Returns whether this terrain has been modified since it was first loaded / defined.
Definition: OgreTerrain.h:756
Ogre::TerrainGlobalOptions::mCastsShadows
bool mCastsShadows
Definition: OgreTerrain.h:1912
Ogre::Terrain::mLastLODCamera
const Camera * mLastLODCamera
Definition: OgreTerrain.h:1867
Ogre::Terrain::DerivedDataResponse::remainingTypeMask
uint8 remainingTypeMask
Remaining types not yet processed.
Definition: OgreTerrain.h:1784
Ogre::TerrainGlobalOptions::getUseVertexCompressionWhenAvailable
bool getUseVertexCompressionWhenAvailable() const
Get whether to allow vertex compression to be used when the material generator states that it support...
Definition: OgreTerrain.h:2098
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Terrain::mLightMapShadowsOnly
bool mLightMapShadowsOnly
Definition: OgreTerrain.h:1859
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::TerrainGlobalOptions::getUseRayBoxDistanceCalculation
bool getUseRayBoxDistanceCalculation() const
Returns whether or not to use an accurate calculation of camera distance from a terrain tile (ray / A...
Definition: OgreTerrain.h:2020
Ogre::TerrainGlobalOptions::setMaxPixelError
void setMaxPixelError(Real pixerr)
Set the maximum screen pixel error that should be allowed when rendering.
Definition: OgreTerrain.h:1983
Ogre::TerrainGlobalOptions::setCompositeMapDiffuse
void setCompositeMapDiffuse(const ColourValue &c)
Set the composite map diffuse light to use.
Definition: OgreTerrain.h:1956
Ogre::TerrainGlobalOptions::getDefaultResourceGroup
const String & getDefaultResourceGroup() const
Get the default resource group to use to load / save terrains.
Definition: OgreTerrain.h:2093
Ogre::TRect< long >
Ogre::Terrain::mDirtyLightmapFromNeighboursRect
Rect mDirtyLightmapFromNeighboursRect
Definition: OgreTerrain.h:1759
OGRE_ALLOC_T
#define OGRE_ALLOC_T(T, count, category)
Allocate a block of memory for a primitive type, and indicate the category of usage.
Definition: OgreMemoryAllocatorConfig.h:428
Ogre::Terrain::mCpuLightmapStorage
uint8 * mCpuLightmapStorage
Definition: OgreTerrain.h:1837
Ogre::Terrain::mCompositeMapDirtyRectLightmapUpdate
bool mCompositeMapDirtyRectLightmapUpdate
True if the updates included lightmap changes (widen)
Definition: OgreTerrain.h:1847
Ogre::StringVector
vector< String >::type StringVector
Definition: OgreStringVector.h:45
Ogre::Terrain::mBlendTextureList
TexturePtrList mBlendTextureList
Definition: OgreTerrain.h:1826
Ogre::Terrain::ImportData::ImportData
ImportData()
Definition: OgreTerrain.h:400
Ogre::Terrain::TERRAINLAYERSAMPLERELEMENT_CHUNK_VERSION
static const uint16 TERRAINLAYERSAMPLERELEMENT_CHUNK_VERSION
Definition: OgreTerrain.h:284
Ogre::TerrainGlobalOptions::setLightMapDirection
void setLightMapDirection(const Vector3 &v)
Set the shadow map light direction to use (world space).
Definition: OgreTerrain.h:1948
Ogre::TerrainGlobalOptions::getDefaultLayerTextureWorldSize
Real getDefaultLayerTextureWorldSize() const
Get the default world size for a layer &#39;splat&#39; texture to cover.
Definition: OgreTerrain.h:2055
Ogre::PixelFormat
PixelFormat
The pixel format used for images, textures, and render surfaces.
Definition: OgrePixelFormat.h:43
Ogre::Terrain::getRenderQueueGroup
uint8 getRenderQueueGroup(void) const
Get the render queue group that this terrain will be rendered into.
Definition: OgreTerrain.h:1343
Ogre::Terrain::mCompositeMapSizeActual
uint16 mCompositeMapSizeActual
Definition: OgreTerrain.h:1840
Ogre::Terrain::mResourceGroup
String mResourceGroup
Definition: OgreTerrain.h:1724
Ogre::Terrain::GenerateMaterialRequest::stage
GenerateMaterialStage stage
Definition: OgreTerrain.h:1807
Ogre::SceneNode
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:58
Ogre::TerrainGlobalOptions::mMaxPixelError
Real mMaxPixelError
Definition: OgreTerrain.h:1913
Ogre::Terrain::mHeightData
float * mHeightData
The height data (world coords relative to mPos)
Definition: OgreTerrain.h:1730
Ogre::Terrain::TexturePtrList
vector< TexturePtr >::type TexturePtrList
Definition: OgreTerrain.h:1825
Ogre::SceneManager::IlluminationRenderStage
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
Definition: OgreSceneManager.h:173
Ogre::Terrain::msNormalMapNameGenerator
static NameGenerator msNormalMapNameGenerator
Definition: OgreTerrain.h:1852
Ogre::Viewport
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
Ogre::Terrain::getLightmapSize
uint16 getLightmapSize() const
Get the requested size of lightmap for this terrain.
Definition: OgreTerrain.h:1080
Ogre::Terrain::mLastLODFrame
unsigned long mLastLODFrame
Definition: OgreTerrain.h:1868
OGRE_NEW
#define OGRE_NEW
Definition: OgreMemoryAllocatorConfig.h:473
Ogre::Terrain::ImportData::constantHeight
float constantHeight
If neither inputImage or inputFloat are supplied, the constant height at which the initial terrain sh...
Definition: OgreTerrain.h:373
Ogre::Terrain::mLayerDecl
TerrainLayerDeclaration mLayerDecl
Definition: OgreTerrain.h:1747
Ogre::Terrain::ImportData::inputBias
Real inputBias
How to bias the input values provided (if any)
Definition: OgreTerrain.h:387
Ogre::Terrain::getResourceGroup
const String & getResourceGroup() const
Get the resource group to use when loading / saving.
Definition: OgreTerrain.h:672
Ogre::Terrain::mLightMapRequired
bool mLightMapRequired
Definition: OgreTerrain.h:1858
Ogre::Terrain::mCpuCompositeMapStorage
uint8 * mCpuCompositeMapStorage
Definition: OgreTerrain.h:1842
Ogre::TerrainGlobalOptions::mLayerBlendMapSize
uint16 mLayerBlendMapSize
Definition: OgreTerrain.h:1919
Ogre::Terrain::GEN_MATERIAL
Definition: OgreTerrain.h:1799
Ogre::Terrain::getNumLodLevels
uint16 getNumLodLevels() const
Get the total number of LOD levels in the terrain.
Definition: OgreTerrain.h:1237
Ogre::Terrain::getTargetLodLevel
int getTargetLodLevel() const
Definition: OgreTerrain.h:1893
Ogre::TerrainGlobalOptions::mUseRayBoxDistanceCalculation
bool mUseRayBoxDistanceCalculation
Definition: OgreTerrain.h:1917
Ogre::TerrainGlobalOptions::getSkirtSize
Real getSkirtSize() const
The default size of &#39;skirts&#39; used to hide terrain cracks (default 10)
Definition: OgreTerrain.h:1938
Ogre::Terrain::mLastMillis
unsigned long mLastMillis
Definition: OgreTerrain.h:1845
Ogre::TerrainGlobalOptions::mCompositeMapAmbient
ColourValue mCompositeMapAmbient
Definition: OgreTerrain.h:1924
Ogre::SceneManager::Listener
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
Definition: OgreSceneManager.h:222
Ogre::Terrain::DerivedDataRequest::operator<<
_OgreTerrainExport friend std::ostream & operator<<(std::ostream &o, const DerivedDataRequest &r)
Definition: OgreTerrain.h:1775
Ogre::Terrain::mLodMorphRequired
bool mLodMorphRequired
Definition: OgreTerrain.h:1856
Ogre::Terrain::mMaterialGenerator
TerrainMaterialGeneratorPtr mMaterialGenerator
Definition: OgreTerrain.h:1815
Ogre::Terrain::setVisibilityFlags
void setVisibilityFlags(uint32 flags)
Set the visibility flags for this terrain.
Definition: OgreTerrain.h:1354
Ogre::TerrainGlobalOptions::setUseRayBoxDistanceCalculation
void setUseRayBoxDistanceCalculation(bool rb)
Sets whether to use an accurate ray / box intersection to determine distance from a terrain tile...
Definition: OgreTerrain.h:2033
Ogre::Terrain::TERRAINLAYERSAMPLER_CHUNK_VERSION
static const uint16 TERRAINLAYERSAMPLER_CHUNK_VERSION
Definition: OgreTerrain.h:282
Ogre::MEMCATEGORY_GEOMETRY
Geometry held in main memory.
Definition: OgreMemoryAllocatorConfig.h:164
OgreCommon.h
Ogre::Terrain::TERRAIN_GENERATE_MATERIAL_INTERVAL_MS
static const uint64 TERRAIN_GENERATE_MATERIAL_INTERVAL_MS
Definition: OgreTerrain.h:277
Ogre::TerrainGlobalOptions::setLightMapSize
void setLightMapSize(uint16 sz)
Sets the default size of lightmaps for a new terrain.
Definition: OgreTerrain.h:2077
Ogre::Terrain::getLayerDeclaration
const TerrainLayerDeclaration & getLayerDeclaration() const
Get the declaration which describes the layers in this terrain.
Definition: OgreTerrain.h:992
Ogre::TerrainGlobalOptions::getCompositeMapSize
uint16 getCompositeMapSize() const
Get the default size of the composite maps for a new terrain.
Definition: OgreTerrain.h:2081
Ogre::Terrain::DefaultGpuBufferAllocator::IBufMap
map< uint32, HardwareIndexBufferSharedPtr >::type IBufMap
Definition: OgreTerrain.h:594
Ogre::TerrainGlobalOptions::mDefaultMaterialGenerator
TerrainMaterialGeneratorPtr mDefaultMaterialGenerator
Definition: OgreTerrain.h:1918
Ogre::Terrain::WORKQUEUE_GENERATE_MATERIAL_REQUEST
static const uint16 WORKQUEUE_GENERATE_MATERIAL_REQUEST
Definition: OgreTerrain.h:1542
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::Terrain
The main containing class for a chunk of terrain.
Definition: OgreTerrain.h:262
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::Terrain::isHeightDataModified
bool isHeightDataModified() const
Returns whether terrain heights have been modified since the terrain was first loaded / defined...
Definition: OgreTerrain.h:763
Ogre::Terrain::getVisibilityFlags
uint32 getVisibilityFlags(void) const
Get the visibility flags for this terrain.
Definition: OgreTerrain.h:1350
Ogre::TerrainGlobalOptions::addQueryFlags
void addQueryFlags(uint32 flags)
As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this ob...
Definition: OgreTerrain.h:2011
Ogre::Terrain::TERRAINLAYERSAMPLERELEMENT_CHUNK_ID
static const uint32 TERRAINLAYERSAMPLERELEMENT_CHUNK_ID
Definition: OgreTerrain.h:283
Ogre::Terrain::_getMaterial
const MaterialPtr & _getMaterial() const
Internal getting of material.
Definition: OgreTerrain.h:1327
Ogre::WorkQueue::Request
General purpose request structure.
Definition: OgreWorkQueue.h:83
Ogre::HardwareVertexBufferSharedPtr
Shared pointer implementation used to share vertex buffers.
Definition: OgreHardwareVertexBuffer.h:86
Ogre::Terrain::ImportData::pos
Vector3 pos
Position of the terrain.
Definition: OgreTerrain.h:352
Ogre::Terrain::TERRAINGENERALINFO_CHUNK_ID
static const uint32 TERRAINGENERALINFO_CHUNK_ID
Definition: OgreTerrain.h:289
OgreTerrainLayerBlendMap.h
Ogre::Terrain::ImportData::layerDeclaration
TerrainLayerDeclaration layerDeclaration
Definition of the contents of each layer (required).
Definition: OgreTerrain.h:393
Ogre::Terrain::mLayerBlendMapList
TerrainLayerBlendMapList mLayerBlendMapList
Definition: OgreTerrain.h:1827
Ogre::Terrain::DerivedDataResponse::deltaUpdateRect
Rect deltaUpdateRect
The area of deltas that was updated.
Definition: OgreTerrain.h:1786
Ogre::Terrain::mHeightDataModified
bool mHeightDataModified
Definition: OgreTerrain.h:1727
Ogre::Terrain::TERRAINLAYERDECLARATION_CHUNK_ID
static const uint32 TERRAINLAYERDECLARATION_CHUNK_ID
Definition: OgreTerrain.h:279
Ogre::Terrain::getCompositeMapSize
uint16 getCompositeMapSize() const
Get the requested size of composite map for this terrain.
Definition: OgreTerrain.h:1090
Ogre::Terrain::mCpuTerrainNormalMap
PixelBox * mCpuTerrainNormalMap
Pending data.
Definition: OgreTerrain.h:1865
Ogre::Terrain::mMinBatchSize
uint16 mMinBatchSize
Definition: OgreTerrain.h:1737
Ogre::Terrain::mCompositeMapSize
uint16 mCompositeMapSize
Definition: OgreTerrain.h:1839
Ogre::Terrain::GenerateMaterialRequest
A data holder for communicating with the background GetMaterial.
Definition: OgreTerrain.h:1803
Ogre::TerrainGlobalOptions::getCompositeMapAmbient
const ColourValue & getCompositeMapAmbient() const
Get the composite map ambient light to use.
Definition: OgreTerrain.h:1950
Ogre::TerrainGlobalOptions::setDefaultLayerTextureWorldSize
void setDefaultLayerTextureWorldSize(Real sz)
Set the default world size for a layer &#39;splat&#39; texture to cover.
Definition: OgreTerrain.h:2059
Ogre::Terrain::getGlobalColourMapSize
uint16 getGlobalColourMapSize() const
Get the size of the global colour map (if used)
Definition: OgreTerrain.h:1419
Ogre::Terrain::ImportData::inputScale
Real inputScale
How to scale the input values provided (if any)
Definition: OgreTerrain.h:385
Ogre::Terrain::getPosition
const Vector3 & getPosition() const
Get the world position of the terrain centre.
Definition: OgreTerrain.h:1096
Ogre::Terrain::GpuBufferAllocator::~GpuBufferAllocator
virtual ~GpuBufferAllocator()
Definition: OgreTerrain.h:537
Ogre::Terrain::TERRAINDERIVEDDATA_CHUNK_ID
static const uint32 TERRAINDERIVEDDATA_CHUNK_ID
Definition: OgreTerrain.h:287
Ogre::Terrain::mModified
bool mModified
Definition: OgreTerrain.h:1726
Ogre::Terrain::mBase
Real mBase
Base position in world space, relative to mPos.
Definition: OgreTerrain.h:1744
Ogre::Terrain::DerivedDataResponse::normalUpdateRect
Rect normalUpdateRect
The area of normals that was updated.
Definition: OgreTerrain.h:1788
Ogre::Terrain::DerivedDataResponse::terrain
Terrain * terrain
Definition: OgreTerrain.h:1782
Ogre::Terrain::setRenderQueueGroup
void setRenderQueueGroup(uint8 grp)
Set the render queue group that this terrain will be rendered into.
Definition: OgreTerrain.h:1347
Ogre::TerrainGlobalOptions::setCompositeMapSize
void setCompositeMapSize(uint16 sz)
Sets the default size of composite maps for a new terrain.
Definition: OgreTerrain.h:2085
Ogre::WorkQueue::Response
General purpose response structure.
Definition: OgreWorkQueue.h:122
Ogre::Terrain::DERIVED_DATA_LIGHTMAP
static const uint8 DERIVED_DATA_LIGHTMAP
Definition: OgreTerrain.h:1189
OGRE_RW_MUTEX
#define OGRE_RW_MUTEX(name)
Definition: OgreThreadDefinesBoost.h:62
Ogre::TerrainGlobalOptions::mQueryFlags
uint32 mQueryFlags
Definition: OgreTerrain.h:1916
Ogre::TerrainGlobalOptions::setSkirtSize
void setSkirtSize(Real skirtSz)
method - the default size of &#39;skirts&#39; used to hide terrain cracks (default 10)
Definition: OgreTerrain.h:1944
Ogre::uint8
unsigned char uint8
Definition: OgrePlatform.h:361
OGRE_FREE
#define OGRE_FREE(ptr, category)
Free the memory allocated with OGRE_MALLOC or OGRE_ALLOC_T. Category is required to be restated to en...
Definition: OgreMemoryAllocatorConfig.h:430
Ogre::Terrain::mColourMap
TexturePtr mColourMap
Definition: OgreTerrain.h:1831
Ogre::Terrain::getTerrainNormalMap
TexturePtr getTerrainNormalMap() const
Get the (global) normal map texture.
Definition: OgreTerrain.h:1554
Ogre::Terrain::mSize
uint16 mSize
Definition: OgreTerrain.h:1735
Ogre::TerrainGlobalOptions::mCompositeMapSize
uint16 mCompositeMapSize
Definition: OgreTerrain.h:1923
Ogre::Terrain::mRootNode
SceneNode * mRootNode
Definition: OgreTerrain.h:1723
Ogre::TerrainGlobalOptions::getRenderQueueGroup
uint8 getRenderQueueGroup(void) const
Get the render queue group that this terrain will be rendered into.
Definition: OgreTerrain.h:1986
Ogre::Terrain::mVisibilityFlags
uint32 mVisibilityFlags
Definition: OgreTerrain.h:1753
Ogre::Terrain::getHighestLodLoaded
int getHighestLodLoaded() const
Definition: OgreTerrain.h:1892
Ogre::Terrain::mSkirtSize
Real mSkirtSize
Definition: OgreTerrain.h:1751
Ogre::Terrain::DerivedDataResponse::normalMapBox
PixelBox * normalMapBox
All CPU-side data, independent of textures; to be blitted in main thread.
Definition: OgreTerrain.h:1792
Ogre::TerrainGlobalOptions::mRenderQueueGroup
uint8 mRenderQueueGroup
Definition: OgreTerrain.h:1914
Ogre::Terrain::getQuadTree
TerrainQuadTreeNode * getQuadTree()
Get the top level of the quad tree which is used to divide up the terrain.
Definition: OgreTerrain.h:1551
_OgreTerrainExport
#define _OgreTerrainExport
Definition: OgreTerrainPrerequisites.h:58
Ogre::TerrainLayerBlendMapList
vector< TerrainLayerBlendMap * >::type TerrainLayerBlendMapList
Definition: OgreTerrainLayerBlendMap.h:189
Ogre::Terrain::ImportData::layerList
LayerInstanceList layerList
List of layer structures, one for each layer required.
Definition: OgreTerrain.h:398
Ogre::Terrain::Alignment
Alignment
The alignment of the terrain.
Definition: OgreTerrain.h:311
Ogre::TerrainLodManager
Terrain LOD data manager.
Definition: OgreTerrainLodManager.h:52
Ogre::Terrain::mLayerBlendMapSizeActual
uint16 mLayerBlendMapSizeActual
Definition: OgreTerrain.h:1821
Ogre::Terrain::LOD_MORPH_CUSTOM_PARAM
static const size_t LOD_MORPH_CUSTOM_PARAM
Definition: OgreTerrain.h:292
Ogre::Terrain::Space
Space
Enumeration of relative spaces that you might want to use to address the terrain. ...
Definition: OgreTerrain.h:513
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Terrain::DERIVED_DATA_NORMALS
static const uint8 DERIVED_DATA_NORMALS
Definition: OgreTerrain.h:1188
Ogre::Terrain::_getCompositeMapMaterial
const MaterialPtr & _getCompositeMapMaterial() const
Internal getting of material for the terrain composite map.
Definition: OgreTerrain.h:1331
Ogre::TerrainGlobalOptions::mDefaultLayerTextureWorldSize
Real mDefaultLayerTextureWorldSize
Definition: OgreTerrain.h:1920
Ogre::Terrain::mDefaultGpuBufferAllocator
DefaultGpuBufferAllocator mDefaultGpuBufferAllocator
Definition: OgreTerrain.h:1874
Ogre::Terrain::getLayerCount
uint8 getLayerCount() const
Get the number of layers in this terrain.
Definition: OgreTerrain.h:989
Ogre::TerrainGlobalOptions::setLayerBlendMapSize
void setLayerBlendMapSize(uint16 sz)
Sets the default size of blend maps for a new terrain.
Definition: OgreTerrain.h:2051
Ogre::Terrain::removeQueryFlags
void removeQueryFlags(uint32 flags)
Definition: OgreTerrain.h:1367
Ogre::TerrainGlobalOptions::getCastsDynamicShadows
bool getCastsDynamicShadows() const
Whether the terrain will be able to cast shadows (texture shadows only are supported, and you must be using depth shadow maps).
Definition: OgreTerrain.h:1966
Ogre::Terrain::_getMorphRequired
bool _getMorphRequired() const
Get whether LOD morphing is needed.
Definition: OgreTerrain.h:1477
Ogre::TerrainGlobalOptions::setQueryFlags
void setQueryFlags(uint32 flags)
Set the default query flags for terrains.
Definition: OgreTerrain.h:2005
Ogre::Terrain::mSceneMgr
SceneManager * mSceneMgr
Definition: OgreTerrain.h:1722
Ogre::Terrain::ImportData::minBatchSize
uint16 minBatchSize
Minimum batch size (along one edge) in vertices; must be 2^n+1.
Definition: OgreTerrain.h:346
Ogre::TerrainLayerBlendMap
Class exposing an interface to a blend map for a given layer.
Definition: OgreTerrainLayerBlendMap.h:61
Ogre::Terrain::mMaxBatchSize
uint16 mMaxBatchSize
Definition: OgreTerrain.h:1736
Ogre::Terrain::DerivedDataRequest::lightmapExtraDirtyRect
Rect lightmapExtraDirtyRect
Definition: OgreTerrain.h:1774
Ogre::StreamSerialiser
Utility class providing helper methods for reading / writing structured data held in a DataStream...
Definition: OgreStreamSerialiser.h:66
Ogre::Terrain::ImportData::terrainSize
uint16 terrainSize
Terrain size (along one edge) in vertices; must be 2^n+1.
Definition: OgreTerrain.h:329
Ogre::Terrain::GenerateMaterialRequest::terrain
Terrain * terrain
Definition: OgreTerrain.h:1805
Ogre::TerrainGlobalOptions::mCompositeMapDiffuse
ColourValue mCompositeMapDiffuse
Definition: OgreTerrain.h:1925
Ogre::Terrain::mGlobalColourMapEnabled
bool mGlobalColourMapEnabled
Definition: OgreTerrain.h:1830
Ogre::Terrain::getPositiveLodLevel
int getPositiveLodLevel(int lodLevel) const
Get the real lod level.
Definition: OgreTerrain.h:1657
Ogre::Terrain::NeighbourIndex
NeighbourIndex
Neighbour index enumeration - indexed anticlockwise from East like angles.
Definition: OgreTerrain.h:496
Ogre::TerrainGlobalOptions::mDefaultGlobalColourMapSize
uint16 mDefaultGlobalColourMapSize
Definition: OgreTerrain.h:1921
Ogre::Terrain::TERRAINGENERALINFO_CHUNK_VERSION
static const uint16 TERRAINGENERALINFO_CHUNK_VERSION
Definition: OgreTerrain.h:290
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::Terrain::ImportData::deleteInputData
bool deleteInputData
Whether this structure should &#39;own&#39; the input data (inputImage and inputFloat), and therefore delete ...
Definition: OgreTerrain.h:382
Ogre::TerrainQuadTreeNode
A node in a quad tree used to store a patch of terrain.
Definition: OgreTerrainQuadTreeNode.h:85
Ogre::TerrainGlobalOptions::setVisibilityFlags
void setVisibilityFlags(uint32 flags)
Set the visbility flags that terrains will be rendered with.
Definition: OgreTerrain.h:1999
Ogre::TerrainGlobalOptions::setCompositeMapAmbient
void setCompositeMapAmbient(const ColourValue &c)
Set the composite map ambient light to use.
Definition: OgreTerrain.h:1952
Ogre::Terrain::TERRAINDERIVEDDATA_CHUNK_VERSION
static const uint16 TERRAINDERIVEDDATA_CHUNK_VERSION
Definition: OgreTerrain.h:288
Ogre::Terrain::mMaterialName
String mMaterialName
Definition: OgreTerrain.h:1813
OgreSceneManager.h
Ogre::uint32
unsigned int uint32
Definition: OgrePlatform.h:359
Ogre::TerrainGlobalOptions
Options class which just stores default options for the terrain.
Definition: OgreTerrain.h:1906
Ogre::Image
Class representing an image file.
Definition: OgreImage.h:61
Ogre::TerrainGlobalOptions::removeQueryFlags
void removeQueryFlags(uint32 flags)
Definition: OgreTerrain.h:2014
Ogre::TerrainGlobalOptions::mCompositeMapDistance
Real mCompositeMapDistance
Definition: OgreTerrain.h:1926
Ogre::WorkQueue::ResponseHandler
Interface definition for a handler of responses.
Definition: OgreWorkQueue.h:196
Ogre::TerrainGlobalOptions::getCompositeMapDistance
Real getCompositeMapDistance() const
Get the distance at which to start using a composite map if present.
Definition: OgreTerrain.h:1958
Ogre::Terrain::mDirtyDerivedDataRect
Rect mDirtyDerivedDataRect
Definition: OgreTerrain.h:1757
Ogre::TerrainLodManager::getHighestLodLoaded
int getHighestLodLoaded()
Definition: OgreTerrainLodManager.h:117
Ogre::Terrain::mPrepareInProgress
bool mPrepareInProgress
Don&#39;t release Height/DeltaData when preparing.
Definition: OgreTerrain.h:1766
Ogre::Terrain::mQuadTree
TerrainQuadTreeNode * mQuadTree
Definition: OgreTerrain.h:1739
Ogre::Terrain::addQueryFlags
void addQueryFlags(uint32 flags)
As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this ob...
Definition: OgreTerrain.h:1364
Ogre::Terrain::mWorldSize
Real mWorldSize
Definition: OgreTerrain.h:1734
Ogre::Terrain::DerivedDataRequest::terrain
Terrain * terrain
Definition: OgreTerrain.h:1770
Ogre::TerrainGlobalOptions::setCompositeMapDistance
void setCompositeMapDistance(Real c)
Set the distance at which to start using a composite map if present.
Definition: OgreTerrain.h:1960
Ogre::Terrain::mDeltaData
float * mDeltaData
The delta information defining how a vertex moves before it is removed at a lower LOD...
Definition: OgreTerrain.h:1732
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Terrain::GenerateMaterialRequest::operator<<
_OgreTerrainExport friend std::ostream & operator<<(std::ostream &o, const GenerateMaterialRequest &r)
Definition: OgreTerrain.h:1809
Ogre::Terrain::mCompositeMapMaterial
MaterialPtr mCompositeMapMaterial
Definition: OgreTerrain.h:1848
Ogre::Terrain::ImportData::maxBatchSize
uint16 maxBatchSize
Maximum batch size (along one edge) in vertices; must be 2^n+1 and <= 65.
Definition: OgreTerrain.h:335
Ogre::Terrain::DerivedDataRequest
A data holder for communicating with the background derived data update.
Definition: OgreTerrain.h:1768
Ogre::Terrain::mDirtyGeometryRectForNeighbours
Rect mDirtyGeometryRectForNeighbours
Definition: OgreTerrain.h:1758
Ogre::TerrainGlobalOptions::setDefaultResourceGroup
void setDefaultResourceGroup(const String &grp)
Set the default resource group to use to load / save terrains.
Definition: OgreTerrain.h:2089
Ogre::Terrain::getLayerBlendMapSize
uint16 getLayerBlendMapSize() const
Get the requested size of the blend maps used to blend between layers for this terrain.
Definition: OgreTerrain.h:1073
Ogre::TerrainLayerDeclaration
The definition of the information each layer will contain in this terrain.
Definition: OgreTerrainMaterialGenerator.h:131
Ogre::Terrain::ImportData::ImportData
ImportData(const ImportData &rhs)
Definition: OgreTerrain.h:417
Ogre::Terrain::ImportData
Structure encapsulating import data that you may use to bootstrap the terrain without loading from a ...
Definition: OgreTerrain.h:324
Ogre::Terrain::DerivedDataRequest::dirtyRect
Rect dirtyRect
Definition: OgreTerrain.h:1773
Ogre::Terrain::mLayerBlendMapSize
uint16 mLayerBlendMapSize
Definition: OgreTerrain.h:1820
Ogre::Terrain::isLoaded
bool isLoaded() const
Return whether the terrain is loaded.
Definition: OgreTerrain.h:750
Ogre::Terrain::mGenerateMaterialInProgress
bool mGenerateMaterialInProgress
Definition: OgreTerrain.h:1764
Ogre::Terrain::GenerateMaterialRequest::startTime
unsigned long startTime
Definition: OgreTerrain.h:1806
Ogre::Terrain::DefaultGpuBufferAllocator::mSharedIBufMap
IBufMap mSharedIBufMap
Definition: OgreTerrain.h:595
Ogre::SharedPtr< DataStream >
Ogre::Terrain::mNumLodLevels
uint16 mNumLodLevels
Definition: OgreTerrain.h:1740
Ogre::Terrain::getHighestLodPrepared
int getHighestLodPrepared() const
Definition: OgreTerrain.h:1891
OgreTerrainLodManager.h
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::Terrain::ImportData::inputImage
Image * inputImage
Optional heightmap providing the initial heights for the terrain.
Definition: OgreTerrain.h:362
Ogre::Terrain::getLightmap
const TexturePtr & getLightmap() const
Get access to the lightmap, if enabled (as requested by the material generator)
Definition: OgreTerrain.h:1083
Ogre::Terrain::mNormalMapRequired
bool mNormalMapRequired
Definition: OgreTerrain.h:1857
Ogre::TerrainGlobalOptions::mVisibilityFlags
uint32 mVisibilityFlags
Definition: OgreTerrain.h:1915
Ogre::TerrainGlobalOptions::mLightmapSize
uint16 mLightmapSize
Definition: OgreTerrain.h:1922
Ogre::Terrain::TERRAINLAYERINSTANCE_CHUNK_ID
static const uint32 TERRAINLAYERINSTANCE_CHUNK_ID
Definition: OgreTerrain.h:285
Ogre::Terrain::TERRAIN_CHUNK_ID
static const uint32 TERRAIN_CHUNK_ID
Definition: OgreTerrain.h:274
Ogre::TerrainLodManager::getHighestLodPrepared
int getHighestLodPrepared()
Definition: OgreTerrainLodManager.h:116
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
OgreTerrainPrerequisites.h
Ogre::Terrain::LayerInstance::worldSize
Real worldSize
The world size of the texture to be applied in this layer.
Definition: OgreTerrain.h:301
Ogre::TerrainGlobalOptions::setRenderQueueGroup
void setRenderQueueGroup(uint8 grp)
Set the render queue group that terrains will be rendered into.
Definition: OgreTerrain.h:1991
Ogre::Terrain::DefaultGpuBufferAllocator::VBufList
list< HardwareVertexBufferSharedPtr >::type VBufList
Definition: OgreTerrain.h:591
Ogre::TerrainGlobalOptions::~TerrainGlobalOptions
virtual ~TerrainGlobalOptions()
Definition: OgreTerrain.h:1932
Ogre::Terrain::setResourceGroup
void setResourceGroup(const String &resGroup)
Set the resource group to use when loading / saving.
Definition: OgreTerrain.h:667
Ogre::map
Definition: OgrePrerequisites.h:533
Ogre::Terrain::mAlign
Alignment mAlign
Definition: OgreTerrain.h:1733
Ogre::PixelBox
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
Definition: OgrePixelFormat.h:304
Ogre::TerrainGlobalOptions::getCompositeMapDiffuse
const ColourValue & getCompositeMapDiffuse() const
Get the composite map iffuse light to use.
Definition: OgreTerrain.h:1954
Ogre::Terrain::mDirtyGeometryRect
Rect mDirtyGeometryRect
Definition: OgreTerrain.h:1756
Ogre::TerrainGlobalOptions::mSkirtSize
Real mSkirtSize
Definition: OgreTerrain.h:1910
Ogre::Terrain::mLightmapSize
uint16 mLightmapSize
Definition: OgreTerrain.h:1834
Ogre::TerrainGlobalOptions::mUseVertexCompressionWhenAvailable
bool mUseVertexCompressionWhenAvailable
Definition: OgreTerrain.h:1928
Ogre::Terrain::mLightmapSizeActual
uint16 mLightmapSizeActual
Definition: OgreTerrain.h:1835
Ogre::Terrain::mRenderQueueGroup
uint8 mRenderQueueGroup
Definition: OgreTerrain.h:1752
Ogre::Terrain::mScale
Real mScale
Relationship between one point on the terrain and world size.
Definition: OgreTerrain.h:1746
Ogre::Terrain::ImportData::~ImportData
~ImportData()
Definition: OgreTerrain.h:488
Ogre::TerrainGlobalOptions::setDefaultGlobalColourMapSize
void setDefaultGlobalColourMapSize(uint16 sz)
Set the default size of the terrain global colour map for a new terrain.
Definition: OgreTerrain.h:2068
Ogre::Terrain::ImportData::worldSize
Real worldSize
The world size of the terrain.
Definition: OgreTerrain.h:355
Ogre::Terrain::mNumLodLevelsPerLeafNode
uint16 mNumLodLevelsPerLeafNode
Definition: OgreTerrain.h:1741
Ogre::Terrain::msLightmapNameGenerator
static NameGenerator msLightmapNameGenerator
Definition: OgreTerrain.h:1853
Ogre::Terrain::mMaterialGenerationCount
unsigned long long int mMaterialGenerationCount
Definition: OgreTerrain.h:1816
Ogre::Terrain::DerivedDataRequest::typeMask
uint8 typeMask
Definition: OgreTerrain.h:1772
Ogre::AxisAlignedBox
A 3D box aligned with the x/y/z axes.
Definition: OgreAxisAlignedBox.h:54
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::Terrain::mLayers
LayerInstanceList mLayers
Definition: OgreTerrain.h:1748
Ogre::Terrain::getSkirtSize
Real getSkirtSize() const
The default size of &#39;skirts&#39; used to hide terrain cracks (default 10, set for new Terrain using Terra...
Definition: OgreTerrain.h:1234
Ogre::Terrain::mMaterialDirty
bool mMaterialDirty
Definition: OgreTerrain.h:1817
Ogre::Terrain::DerivedDataResponse
A data holder for communicating with the background derived data update.
Definition: OgreTerrain.h:1780
Ogre::TerrainGlobalOptions::mResourceGroup
String mResourceGroup
Definition: OgreTerrain.h:1927
Ogre::Terrain::DefaultGpuBufferAllocator
Standard implementation of a buffer allocator which re-uses buffers.
Definition: OgreTerrain.h:572
Ogre::Terrain::LayerInstance::LayerInstance
LayerInstance()
Definition: OgreTerrain.h:305
Ogre::Terrain::GenerateMaterialStage
GenerateMaterialStage
Definition: OgreTerrain.h:1798
Ogre::WorkQueue::RequestHandler
Interface definition for a handler of requests.
Definition: OgreWorkQueue.h:161
Ogre::Terrain::TERRAIN_MAX_BATCH_SIZE
static const uint16 TERRAIN_MAX_BATCH_SIZE
Definition: OgreTerrain.h:276
Ogre::Terrain::BytePointerList
vector< uint8 * >::type BytePointerList
Definition: OgreTerrain.h:1822
Ogre::TerrainGlobalOptions::getVisibilityFlags
uint32 getVisibilityFlags(void) const
Get the visbility flags that terrains will be rendered with.
Definition: OgreTerrain.h:1994
Ogre::Terrain::mCompositeMap
TexturePtr mCompositeMap
Definition: OgreTerrain.h:1841
Ogre::Terrain::getNumLodLevelsPerLeaf
uint16 getNumLodLevelsPerLeaf() const
Get the number of LOD levels in a leaf of the terrain quadtree.
Definition: OgreTerrain.h:1240
Ogre::Terrain::mLightmap
TexturePtr mLightmap
Definition: OgreTerrain.h:1836
Ogre::uint16
unsigned short uint16
Definition: OgrePlatform.h:360
Ogre::Terrain::DerivedDataResponse::lightMapBox
PixelBox * lightMapBox
Definition: OgreTerrain.h:1793
Ogre::Terrain::RealVector
vector< Real >::type RealVector
Definition: OgreTerrain.h:294
Ogre::Terrain::mCompositeMapDirtyRect
Rect mCompositeMapDirtyRect
Definition: OgreTerrain.h:1843
Ogre::Terrain::GpuBufferAllocator::GpuBufferAllocator
GpuBufferAllocator()
Definition: OgreTerrain.h:536
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::Terrain::getQueryFlags
uint32 getQueryFlags(void) const
Get the query flags for this terrain.
Definition: OgreTerrain.h:1357
Ogre::Ray
Representation of a ray in space, i.e.
Definition: OgreRay.h:46
Ogre::Terrain::LayerInstance::textureNames
StringVector textureNames
List of texture names to import; must match with TerrainLayerDeclaration.
Definition: OgreTerrain.h:303
Ogre::Terrain::mCompositeMapRequired
bool mCompositeMapRequired
Definition: OgreTerrain.h:1860
Ogre::Terrain::mLastViewportHeight
int mLastViewportHeight
Definition: OgreTerrain.h:1869
Ogre::Terrain::mCpuColourMapStorage
uint8 * mCpuColourMapStorage
Definition: OgreTerrain.h:1832
Ogre::Terrain::mTerrainNormalMap
TexturePtr mTerrainNormalMap
Texture storing normals for the whole terrrain.
Definition: OgreTerrain.h:1862
Ogre::Terrain::TERRAIN_CHUNK_VERSION
static const uint16 TERRAIN_CHUNK_VERSION
Definition: OgreTerrain.h:275
Ogre::Terrain::TERRAINLAYERINSTANCE_CHUNK_VERSION
static const uint16 TERRAINLAYERINSTANCE_CHUNK_VERSION
Definition: OgreTerrain.h:286

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.