18 #include "precompiled.h"
43 i0 = floor(std::min(std::min(corner0.
X, corner1.
X), std::min(corner2.
X, corner3.
X)) /
TERRAIN_TILE_SIZE);
44 j0 = floor(std::min(std::min(corner0.
Z, corner1.
Z), std::min(corner2.
Z, corner3.
Z)) /
TERRAIN_TILE_SIZE);
45 i1 = ceil(std::max(std::max(corner0.
X, corner1.
X), std::max(corner2.
X, corner3.
X)) /
TERRAIN_TILE_SIZE);
46 j1 = ceil(std::max(std::max(corner0.
Z, corner1.
Z), std::max(corner2.
Z, corner3.
Z)) /
TERRAIN_TILE_SIZE);
66 if (bi1 < i0 || bi0 > i1 || bj1 < j0 || bj0 > j1)
virtual void InvalidatePosition()
Mark this model's position and bone matrices, and all props' positions as invalid.
void Translate(float x, float y, float z)
void AddShaderDefine(CStrIntern key, CStrIntern value)
float GetYRotation() const
const ssize_t TERRAIN_TILE_SIZE
metres [world space units] per tile in x and z
void SetYRotation(float angle)
virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1)
Called when terrain has changed in the given inclusive bounds.
CBoundingBoxAligned GetVertexesBound(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1)
Returns a 3D bounding box encompassing the given vertex range (inclusive)
virtual CModelAbstract * Clone() const
#define RENDERDATA_UPDATE_VERTICES
virtual void SetTransform(const CMatrix3D &transform)
ssize_t GetVerticesPerSide() const
CVector3D Transform(const CVector3D &vector) const
bool m_PositionValid
True if both transform and and bone matrices are valid.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
CModelDecal(CTerrain *terrain, const SDecal &decal)
CBoundingBoxAligned m_WorldBounds
World-space bounds of this object.
void SetDirty(u32 dirtyflags)
void CalcVertexExtents(ssize_t &i0, ssize_t &j0, ssize_t &i1, ssize_t &j1)
Compute the terrain vertex indexes that bound the decal's projection onto the terrain.
Abstract base class for graphical objects that are used by units, or as props attached to other CMode...
const CMatrix3D & GetTransform() const
virtual void SetTransform(const CMatrix3D &transform)
virtual void CalcBounds()
(Re)calculates and stores any bounds or bound-dependent data for this object.
CVector3D GetTranslation() const
void RecomputeCombinedShaderDefines()
virtual void ValidatePosition()
Ensure that both the transformation and the bone matrices are correct for this model and all its prop...
T clamp(T value, T min, T max)
CModelAbstract * m_Parent
If non-null, points to the model that we are attached to.
virtual void ValidatePosition()=0
Ensure that both the transformation and the bone matrices are correct for this model and all its prop...