Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Decal.h
Show All 16 Lines | |||||
#ifndef INCLUDED_DECAL | #ifndef INCLUDED_DECAL | ||||
#define INCLUDED_DECAL | #define INCLUDED_DECAL | ||||
#include "graphics/Material.h" | #include "graphics/Material.h" | ||||
#include "graphics/ModelAbstract.h" | #include "graphics/ModelAbstract.h" | ||||
class CTerrain; | class CTerrain; | ||||
class CWater; | |||||
/** | /** | ||||
* Terrain decal definition. | * Terrain decal definition. | ||||
* Decals are rectangular textures that are projected vertically downwards | * Decals are rectangular textures that are projected vertically downwards | ||||
* onto the terrain. | * onto the terrain. | ||||
*/ | */ | ||||
struct SDecal | struct SDecal | ||||
{ | { | ||||
Show All 11 Lines | struct SDecal | ||||
float m_OffsetX; | float m_OffsetX; | ||||
float m_OffsetZ; | float m_OffsetZ; | ||||
bool m_Floating; | bool m_Floating; | ||||
}; | }; | ||||
class CModelDecal : public CModelAbstract | class CModelDecal : public CModelAbstract | ||||
{ | { | ||||
public: | public: | ||||
CModelDecal(CTerrain* terrain, const SDecal& decal) | CModelDecal(CTerrain* terrain, CWater* water, const SDecal& decal) | ||||
: m_Terrain(terrain), m_Decal(decal) | : m_Terrain(terrain), m_Water(water), m_Decal(decal) | ||||
{ | { | ||||
ENSURE(terrain != NULL); | ENSURE(terrain != NULL); | ||||
} | } | ||||
/// Dynamic cast | /// Dynamic cast | ||||
virtual CModelDecal* ToCModelDecal() | virtual CModelDecal* ToCModelDecal() | ||||
{ | { | ||||
return this; | return this; | ||||
Show All 14 Lines | public: | ||||
/** | /** | ||||
* Compute the terrain vertex indexes that bound the decal's | * Compute the terrain vertex indexes that bound the decal's | ||||
* projection onto the terrain. | * projection onto the terrain. | ||||
* The returned indexes are clamped to the terrain size. | * The returned indexes are clamped to the terrain size. | ||||
*/ | */ | ||||
void CalcVertexExtents(ssize_t& i0, ssize_t& j0, ssize_t& i1, ssize_t& j1); | void CalcVertexExtents(ssize_t& i0, ssize_t& j0, ssize_t& i1, ssize_t& j1); | ||||
CTerrain* m_Terrain; | CTerrain* m_Terrain; | ||||
CWater* m_Water; | |||||
SDecal m_Decal; | SDecal m_Decal; | ||||
}; | }; | ||||
#endif // INCLUDED_DECAL | #endif // INCLUDED_DECAL |
Wildfire Games · Phabricator