Sly Engine
TerrainObject Class Reference

#include <TerrainObject.h>

Inheritance diagram for TerrainObject:
Inheritance graph
Collaboration diagram for TerrainObject:
Collaboration graph

Classes

struct  Cell
 A cell as it is stored within the terrain. More...
 

Public Member Functions

 TerrainObject ()=delete
 
 TerrainObject (const TerrainObject &)=delete
 
 TerrainObject (TerrainObject &&)=delete
 
TerrainObjectoperator= (const TerrainObject &)=delete
 
TerrainObjectoperator= (TerrainObject &&)=delete
 
virtual ~TerrainObject ()
 
 TerrainObject (const char *heightMapFile, std::string textureKey, float sideLength, float maxHeight, int repeatU, int repeatV)
 
float GetAltitude (Vect pos)
 
Vect GetNormal (Vect pos)
 
void SetWorld (Matrix world)
 
Matrix & GetWorld ()
 
virtual void Draw () override
 Pure virtual function draw. Derived objects must override. More...
 
void Initialize ()
 Sets the terrain object up for drawing. More...
 
void Deinitialize ()
 Deregisters the terrain. More...
 
int GetSideVertCount ()
 Gets the number of side vertices. More...
 
void ComputeMinMax ()
 
int CellMinMaxIndex (int i, int j)
 
int GetCellDimension ()
 
void ShowLinePosition (Vect &pos)
 
void ShowNormal (Frigate *theFrigate)
 
void ShowCellsUnderCollidable (Collidable *colObject)
 
void GetMinMaxVects (int i, int j, Vect &outputMin, Vect &outputMax)
 
void VisualizeAllCells ()
 Visualize all cell's AABB's. More...
 
- Public Member Functions inherited from DrawableGameObject
 DrawableGameObject ()=default
 
 DrawableGameObject (const DrawableGameObject &)=delete
 
 DrawableGameObject (DrawableGameObject &&)=delete
 
DrawableGameObjectoperator= (const DrawableGameObject &)=delete
 
DrawableGameObjectoperator= (DrawableGameObject &&)=delete
 
virtual ~DrawableGameObject ()=default
 
- Public Member Functions inherited from Drawable
 Drawable ()
 Default constructor. More...
 
 Drawable (const Drawable &)=delete
 Copy constructor. More...
 
 Drawable (Drawable &&)=delete
 Move constructor. More...
 
Drawableoperator= (const Drawable &)=delete
 Assignment operator. More...
 
Drawableoperator= (Drawable &&)=delete
 Move assignment operator. More...
 
virtual ~Drawable ()
 Deconstructor. More...
 

Private Member Functions

int VertexIndex (int i, int j)
 
int PixelIndex (int side, int i, int j)
 
int TriIndex (int i, int j)
 
float PixelToFloat (unsigned char hval)
 

Private Attributes

VertexStride_VUN * pVerts
 The vertices, only to be used at construction. More...
 
TriangleIndex * pTriList
 
std::vector< CellTerrainCells
 The cells of the terrain containing min/max vectors. More...
 
GraphicsObject_TextureFlat * pGObjFT
 
GraphicsObject_WireframeConstantColor * pObjWF
 
Model * pModTerrain
 
Matrix WorldMat
 
float maxHeight
 
float deltaLength
 
float dimension
 
int SideVertCount
 
int length
 

Additional Inherited Members

- Protected Member Functions inherited from Drawable
void SubmitDrawRegistration ()
 Submit draw registration. More...
 
void SubmitDrawDeregistration ()
 Submit draw deregistration. More...
 

Constructor & Destructor Documentation

◆ TerrainObject() [1/4]

TerrainObject::TerrainObject ( )
delete

◆ TerrainObject() [2/4]

TerrainObject::TerrainObject ( const TerrainObject )
delete

◆ TerrainObject() [3/4]

TerrainObject::TerrainObject ( TerrainObject &&  )
delete

◆ ~TerrainObject()

TerrainObject::~TerrainObject ( )
virtual

◆ TerrainObject() [4/4]

TerrainObject::TerrainObject ( const char *  heightMapFile,
std::string  textureKey,
float  sideLength,
float  maxHeight,
int  repeatU,
int  repeatV 
)
Here is the call graph for this function:

Member Function Documentation

◆ CellMinMaxIndex()

int TerrainObject::CellMinMaxIndex ( int  i,
int  j 
)

◆ ComputeMinMax()

void TerrainObject::ComputeMinMax ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Deinitialize()

void TerrainObject::Deinitialize ( )

Deregisters the terrain.

Here is the call graph for this function:

◆ Draw()

void TerrainObject::Draw ( )
overridevirtual

Pure virtual function draw. Derived objects must override.

Implements Drawable.

Here is the call graph for this function:

◆ GetAltitude()

float TerrainObject::GetAltitude ( Vect  pos)
Here is the call graph for this function:

◆ GetCellDimension()

int TerrainObject::GetCellDimension ( )
Here is the caller graph for this function:

◆ GetMinMaxVects()

void TerrainObject::GetMinMaxVects ( int  i,
int  j,
Vect &  outputMin,
Vect &  outputMax 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNormal()

Vect TerrainObject::GetNormal ( Vect  pos)
Here is the call graph for this function:

◆ GetSideVertCount()

int TerrainObject::GetSideVertCount ( )

Gets the number of side vertices.

Returns
The side vertical count.
Here is the caller graph for this function:

◆ GetWorld()

Matrix & TerrainObject::GetWorld ( )

◆ Initialize()

void TerrainObject::Initialize ( )

Sets the terrain object up for drawing.

Here is the call graph for this function:

◆ operator=() [1/2]

TerrainObject& TerrainObject::operator= ( const TerrainObject )
delete

◆ operator=() [2/2]

TerrainObject& TerrainObject::operator= ( TerrainObject &&  )
delete

◆ PixelIndex()

int TerrainObject::PixelIndex ( int  side,
int  i,
int  j 
)
private
Here is the caller graph for this function:

◆ PixelToFloat()

float TerrainObject::PixelToFloat ( unsigned char  hval)
private
Here is the caller graph for this function:

◆ SetWorld()

void TerrainObject::SetWorld ( Matrix  world)

◆ ShowCellsUnderCollidable()

void TerrainObject::ShowCellsUnderCollidable ( Collidable colObject)
Here is the call graph for this function:

◆ ShowLinePosition()

void TerrainObject::ShowLinePosition ( Vect &  pos)
Here is the call graph for this function:

◆ ShowNormal()

void TerrainObject::ShowNormal ( Frigate *  theFrigate)
Here is the call graph for this function:

◆ TriIndex()

int TerrainObject::TriIndex ( int  i,
int  j 
)
private

◆ VertexIndex()

int TerrainObject::VertexIndex ( int  i,
int  j 
)
private
Here is the caller graph for this function:

◆ VisualizeAllCells()

void TerrainObject::VisualizeAllCells ( )

Visualize all cell's AABB's.

This is an expensive operation that loops through all the cell's and pulls their Vects to visualize an AABB. Use only for debugging purposes. A small heightmap may be required.

Here is the call graph for this function:

Member Data Documentation

◆ deltaLength

float TerrainObject::deltaLength
private

◆ dimension

float TerrainObject::dimension
private

◆ length

int TerrainObject::length
private

◆ maxHeight

float TerrainObject::maxHeight
private

◆ pGObjFT

GraphicsObject_TextureFlat* TerrainObject::pGObjFT
private

◆ pModTerrain

Model* TerrainObject::pModTerrain
private

◆ pObjWF

GraphicsObject_WireframeConstantColor* TerrainObject::pObjWF
private

◆ pTriList

TriangleIndex* TerrainObject::pTriList
private

◆ pVerts

VertexStride_VUN* TerrainObject::pVerts
private

The vertices, only to be used at construction.

◆ SideVertCount

int TerrainObject::SideVertCount
private

◆ TerrainCells

std::vector<Cell> TerrainObject::TerrainCells
private

The cells of the terrain containing min/max vectors.

◆ WorldMat

Matrix TerrainObject::WorldMat
private

The documentation for this class was generated from the following files: