29#ifndef __Ogre_TerrainLayerBlendMap_H__
30#define __Ogre_TerrainLayerBlendMap_H__
#define _OgreTerrainExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Specialisation of HardwareBuffer for a pixel buffer.
Class representing an image file.
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Class exposing an interface to a blend map for a given layer.
virtual ~TerrainLayerBlendMap()
HardwarePixelBuffer * mBuffer
void convertUVToWorldSpace(Real x, Real y, Vector3 *outWorldPos)
Helper method - convert a point in local space to worldspace based on the terrain settings.
void blit(const PixelBox &src)
Blits a set of values into the entire map.
Terrain * getParent() const
Get the parent terrain.
void blit(const PixelBox &src, const Box &dstBox)
Blits a set of values into a region on the blend map.
void loadImage(const Image &img)
Load an image into this blend layer.
void convertUVToImageSpace(Real x, Real y, size_t *outX, size_t *outY)
Convert local space values (0,1) to image space (0, imageSize).
void update()
Publish any changes you made to the blend data back to the blend map.
TerrainLayerBlendMap(Terrain *parent, uint8 layerIndex, HardwarePixelBuffer *buf)
Constructor.
void setBlendValue(size_t x, size_t y, float val)
Set a single value of blend information (0 = transparent, 255 = solid)
void convertImageToUVSpace(size_t x, size_t y, Real *outX, Real *outY)
Convert image space (0, imageSize) to local space values (0,1).
void loadImage(DataStreamPtr &stream, const String &ext=StringUtil::BLANK)
Load an image into this blend layer.
uint8 getLayerIndex() const
Get the index of the layer this is targeting.
void dirtyRect(const Rect &rect)
Indicate that a portion of the blend data is dirty and needs updating.
float * getBlendPointer()
Get a pointer to the whole blend data.
void convertWorldToUVSpace(const Vector3 &worldPos, Real *outX, Real *outY)
Helper method - convert a point in world space to UV space based on the terrain settings.
void convertImageToTerrainSpace(size_t x, size_t y, Real *outX, Real *outY)
Convert image space (0, imageSize) to terrain space values (0,1).
void convertTerrainToImageSpace(Real x, Real y, size_t *outX, size_t *outY)
Convert terrain space values (0,1) to image space (0, imageSize).
void loadImage(const String &filename, const String &groupName)
Load an image into this blend layer.
float getBlendValue(size_t x, size_t y)
Get a single value of blend information, in image space.
void dirty()
Indicate that all of the blend data is dirty and needs updating.
The main containing class for a chunk of terrain.
Standard 3-dimensional vector.
vector< TerrainLayerBlendMap * >::type TerrainLayerBlendMapList
Structure used to define a box in a 3-D integer space.