Privacy
An open-source, flexible 3D physical simulation framework
mars::MultiResHeightMapRenderer Class Reference

#include <MultiResHeightMapRenderer.h>

Public Member Functions

 MultiResHeightMapRenderer (int gridW, int gridH, double visualWidth, double visualHeight, double scaleX, double scaleY, double scaleZ, double texScaleX, double texScaleY)
 
 ~MultiResHeightMapRenderer ()
 
void initialize ()
 
void highInitialize ()
 
void render ()
 
void collideSphere (double xPos, double yPos, double zPos, double radius)
 
void setHeight (unsigned int gridX, unsigned int gridY, double height)
 
double getHeight (unsigned int gridX, unsigned int gridY)
 
void setOffset (double x, double y, double z)
 
void setDrawSolid (bool drawSolid)
 
void setDrawWireframe (bool drawWireframe)
 
int getLowResVertexCntX () const
 
int getLowResVertexCntY () const
 
int getLowResCellCntX () const
 
int getLowResCellCntY () const
 
int getHighResVertexCntX () const
 
int getHighResVertexCntY () const
 
int getHighResCellCntX () const
 
int getHighResCellCntY () const
 

Protected Member Functions

void clear ()
 
void cutHole (int x, int y)
 
void fillCell (SubTile *tile)
 
void copyLast (int indicesOffsetPos, int verticesOffsetPos)
 
void adaptSubTile (SubTile *tile, double xPos, double yPos, double zPos, double radius)
 
double intersectReplacementSphere (double x, double y, double z, double radius, double vx, double vy, double vz)
 
bool initPlane (bool highRes)
 
void recalcSteps ()
 

Private Member Functions

double interpolateCell (int gridX, int gridY, double x, double y)
 
void prepare ()
 
void getNormal (int x, int y, int mx, int my, double x_step, double y_step, double **height_data, float *normal, float *tangent, bool skipBorder)
 
void normalize (float *v)
 
void collideSphereI (double xPos, double yPos, double zPos, double radius)
 
void fillOriginal (int x, int y)
 
double getHeight (int x, int y, SubTile *tile)
 
void drawSubTile (SubTile *tile)
 
void render (bool highRes)
 

Private Attributes

GLuint * vboIds
 
bool isInitialized
 
bool highIsInitialized
 
double targetWidth
 
double targetHeight
 
int width
 
int height
 
double scaleX
 
double scaleY
 
double scaleZ
 
double texScaleX
 
double texScaleY
 
VertexData * vertices
 
GLuint * indices
 
VertexData * highVertices
 
GLuint * highIndices
 
int numVertices
 
int numIndices
 
int highNumVertices
 
int highNumIndices
 
int indicesToDraw
 
int highIndicesToDraw
 
double stepX
 
double stepY
 
double highStepX
 
double highStepY
 
int highWidth
 
int highHeight
 
int maxNumSubTiles
 
int numSubTiles
 
double newIndicesPos
 
double newVerticesPos
 
double ** heightData
 
bool dirty
 
double offset [3]
 
double minX
 
double minY
 
double minZ
 
double maxX
 
double maxY
 
double maxZ
 
bool wireframe
 
bool solid
 
bool highWireframe
 
bool highSolid
 
std::map< int, SubTile * > subTiles
 
std::list< SubTile * > listSubTiles
 
std::list< FootPrintfootPrints
 

Detailed Description

Definition at line 60 of file MultiResHeightMapRenderer.h.

Constructor & Destructor Documentation

◆ MultiResHeightMapRenderer()

mars::MultiResHeightMapRenderer::MultiResHeightMapRenderer ( int  gridW,
int  gridH,
double  visualWidth,
double  visualHeight,
double  scaleX,
double  scaleY,
double  scaleZ,
double  texScaleX,
double  texScaleY 
)

◆ ~MultiResHeightMapRenderer()

mars::MultiResHeightMapRenderer::~MultiResHeightMapRenderer ( )

Member Function Documentation

◆ adaptSubTile()

void mars::MultiResHeightMapRenderer::adaptSubTile ( SubTile tile,
double  xPos,
double  yPos,
double  zPos,
double  radius 
)
protected

◆ clear()

void mars::MultiResHeightMapRenderer::clear ( )
protected

◆ collideSphere()

void mars::MultiResHeightMapRenderer::collideSphere ( double  xPos,
double  yPos,
double  zPos,
double  radius 
)

◆ collideSphereI()

void mars::MultiResHeightMapRenderer::collideSphereI ( double  xPos,
double  yPos,
double  zPos,
double  radius 
)
private

◆ copyLast()

void mars::MultiResHeightMapRenderer::copyLast ( int  indicesOffsetPos,
int  verticesOffsetPos 
)
protected

◆ cutHole()

void mars::MultiResHeightMapRenderer::cutHole ( int  x,
int  y 
)
protected

◆ drawSubTile()

void mars::MultiResHeightMapRenderer::drawSubTile ( SubTile tile)
private

◆ fillCell()

void mars::MultiResHeightMapRenderer::fillCell ( SubTile tile)
protected

◆ fillOriginal()

void mars::MultiResHeightMapRenderer::fillOriginal ( int  x,
int  y 
)
private

◆ getHeight() [1/2]

double mars::MultiResHeightMapRenderer::getHeight ( unsigned int  gridX,
unsigned int  gridY 
)

◆ getHeight() [2/2]

double mars::MultiResHeightMapRenderer::getHeight ( int  x,
int  y,
SubTile tile 
)
private

◆ getHighResCellCntX()

int mars::MultiResHeightMapRenderer::getHighResCellCntX ( ) const
inline

Definition at line 92 of file MultiResHeightMapRenderer.h.

◆ getHighResCellCntY()

int mars::MultiResHeightMapRenderer::getHighResCellCntY ( ) const
inline

Definition at line 94 of file MultiResHeightMapRenderer.h.

◆ getHighResVertexCntX()

int mars::MultiResHeightMapRenderer::getHighResVertexCntX ( ) const
inline

Definition at line 88 of file MultiResHeightMapRenderer.h.

◆ getHighResVertexCntY()

int mars::MultiResHeightMapRenderer::getHighResVertexCntY ( ) const
inline

Definition at line 90 of file MultiResHeightMapRenderer.h.

◆ getLowResCellCntX()

int mars::MultiResHeightMapRenderer::getLowResCellCntX ( ) const
inline

Definition at line 84 of file MultiResHeightMapRenderer.h.

◆ getLowResCellCntY()

int mars::MultiResHeightMapRenderer::getLowResCellCntY ( ) const
inline

Definition at line 86 of file MultiResHeightMapRenderer.h.

◆ getLowResVertexCntX()

int mars::MultiResHeightMapRenderer::getLowResVertexCntX ( ) const
inline

Definition at line 80 of file MultiResHeightMapRenderer.h.

◆ getLowResVertexCntY()

int mars::MultiResHeightMapRenderer::getLowResVertexCntY ( ) const
inline

Definition at line 82 of file MultiResHeightMapRenderer.h.

◆ getNormal()

void mars::MultiResHeightMapRenderer::getNormal ( int  x,
int  y,
int  mx,
int  my,
double  x_step,
double  y_step,
double **  height_data,
float *  normal,
float *  tangent,
bool  skipBorder 
)
private

◆ highInitialize()

void mars::MultiResHeightMapRenderer::highInitialize ( )

◆ initialize()

void mars::MultiResHeightMapRenderer::initialize ( )

◆ initPlane()

bool mars::MultiResHeightMapRenderer::initPlane ( bool  highRes)
protected

◆ interpolateCell()

double mars::MultiResHeightMapRenderer::interpolateCell ( int  gridX,
int  gridY,
double  x,
double  y 
)
private

◆ intersectReplacementSphere()

double mars::MultiResHeightMapRenderer::intersectReplacementSphere ( double  x,
double  y,
double  z,
double  radius,
double  vx,
double  vy,
double  vz 
)
protected

◆ normalize()

void mars::MultiResHeightMapRenderer::normalize ( float *  v)
private

◆ prepare()

void mars::MultiResHeightMapRenderer::prepare ( )
private

◆ recalcSteps()

void mars::MultiResHeightMapRenderer::recalcSteps ( )
protected

◆ render() [1/2]

void mars::MultiResHeightMapRenderer::render ( )

◆ render() [2/2]

void mars::MultiResHeightMapRenderer::render ( bool  highRes)
private

◆ setDrawSolid()

void mars::MultiResHeightMapRenderer::setDrawSolid ( bool  drawSolid)

◆ setDrawWireframe()

void mars::MultiResHeightMapRenderer::setDrawWireframe ( bool  drawWireframe)

◆ setHeight()

void mars::MultiResHeightMapRenderer::setHeight ( unsigned int  gridX,
unsigned int  gridY,
double  height 
)

◆ setOffset()

void mars::MultiResHeightMapRenderer::setOffset ( double  x,
double  y,
double  z 
)

Member Data Documentation

◆ dirty

bool mars::MultiResHeightMapRenderer::dirty
private

Definition at line 137 of file MultiResHeightMapRenderer.h.

◆ footPrints

std::list<FootPrint> mars::MultiResHeightMapRenderer::footPrints
private

Definition at line 151 of file MultiResHeightMapRenderer.h.

◆ height

int mars::MultiResHeightMapRenderer::height
private

Definition at line 118 of file MultiResHeightMapRenderer.h.

◆ heightData

double** mars::MultiResHeightMapRenderer::heightData
private

Definition at line 136 of file MultiResHeightMapRenderer.h.

◆ highHeight

int mars::MultiResHeightMapRenderer::highHeight
private

Definition at line 133 of file MultiResHeightMapRenderer.h.

◆ highIndices

GLuint* mars::MultiResHeightMapRenderer::highIndices
private

Definition at line 125 of file MultiResHeightMapRenderer.h.

◆ highIndicesToDraw

int mars::MultiResHeightMapRenderer::highIndicesToDraw
private

Definition at line 129 of file MultiResHeightMapRenderer.h.

◆ highIsInitialized

bool mars::MultiResHeightMapRenderer::highIsInitialized
private

Definition at line 116 of file MultiResHeightMapRenderer.h.

◆ highNumIndices

int mars::MultiResHeightMapRenderer::highNumIndices
private

Definition at line 128 of file MultiResHeightMapRenderer.h.

◆ highNumVertices

int mars::MultiResHeightMapRenderer::highNumVertices
private

Definition at line 128 of file MultiResHeightMapRenderer.h.

◆ highSolid

bool mars::MultiResHeightMapRenderer::highSolid
private

Definition at line 140 of file MultiResHeightMapRenderer.h.

◆ highStepX

double mars::MultiResHeightMapRenderer::highStepX
private

Definition at line 132 of file MultiResHeightMapRenderer.h.

◆ highStepY

double mars::MultiResHeightMapRenderer::highStepY
private

Definition at line 132 of file MultiResHeightMapRenderer.h.

◆ highVertices

VertexData* mars::MultiResHeightMapRenderer::highVertices
private

Definition at line 124 of file MultiResHeightMapRenderer.h.

◆ highWidth

int mars::MultiResHeightMapRenderer::highWidth
private

Definition at line 133 of file MultiResHeightMapRenderer.h.

◆ highWireframe

bool mars::MultiResHeightMapRenderer::highWireframe
private

Definition at line 140 of file MultiResHeightMapRenderer.h.

◆ indices

GLuint* mars::MultiResHeightMapRenderer::indices
private

Definition at line 123 of file MultiResHeightMapRenderer.h.

◆ indicesToDraw

int mars::MultiResHeightMapRenderer::indicesToDraw
private

Definition at line 129 of file MultiResHeightMapRenderer.h.

◆ isInitialized

bool mars::MultiResHeightMapRenderer::isInitialized
private

Definition at line 116 of file MultiResHeightMapRenderer.h.

◆ listSubTiles

std::list<SubTile*> mars::MultiResHeightMapRenderer::listSubTiles
private

Definition at line 143 of file MultiResHeightMapRenderer.h.

◆ maxNumSubTiles

int mars::MultiResHeightMapRenderer::maxNumSubTiles
private

Definition at line 134 of file MultiResHeightMapRenderer.h.

◆ maxX

double mars::MultiResHeightMapRenderer::maxX
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ maxY

double mars::MultiResHeightMapRenderer::maxY
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ maxZ

double mars::MultiResHeightMapRenderer::maxZ
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ minX

double mars::MultiResHeightMapRenderer::minX
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ minY

double mars::MultiResHeightMapRenderer::minY
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ minZ

double mars::MultiResHeightMapRenderer::minZ
private

Definition at line 139 of file MultiResHeightMapRenderer.h.

◆ newIndicesPos

double mars::MultiResHeightMapRenderer::newIndicesPos
private

Definition at line 135 of file MultiResHeightMapRenderer.h.

◆ newVerticesPos

double mars::MultiResHeightMapRenderer::newVerticesPos
private

Definition at line 135 of file MultiResHeightMapRenderer.h.

◆ numIndices

int mars::MultiResHeightMapRenderer::numIndices
private

Definition at line 127 of file MultiResHeightMapRenderer.h.

◆ numSubTiles

int mars::MultiResHeightMapRenderer::numSubTiles
private

Definition at line 134 of file MultiResHeightMapRenderer.h.

◆ numVertices

int mars::MultiResHeightMapRenderer::numVertices
private

Definition at line 127 of file MultiResHeightMapRenderer.h.

◆ offset

double mars::MultiResHeightMapRenderer::offset[3]
private

Definition at line 138 of file MultiResHeightMapRenderer.h.

◆ scaleX

double mars::MultiResHeightMapRenderer::scaleX
private

Definition at line 119 of file MultiResHeightMapRenderer.h.

◆ scaleY

double mars::MultiResHeightMapRenderer::scaleY
private

Definition at line 119 of file MultiResHeightMapRenderer.h.

◆ scaleZ

double mars::MultiResHeightMapRenderer::scaleZ
private

Definition at line 119 of file MultiResHeightMapRenderer.h.

◆ solid

bool mars::MultiResHeightMapRenderer::solid
private

Definition at line 140 of file MultiResHeightMapRenderer.h.

◆ stepX

double mars::MultiResHeightMapRenderer::stepX
private

Definition at line 131 of file MultiResHeightMapRenderer.h.

◆ stepY

double mars::MultiResHeightMapRenderer::stepY
private

Definition at line 131 of file MultiResHeightMapRenderer.h.

◆ subTiles

std::map<int, SubTile*> mars::MultiResHeightMapRenderer::subTiles
private

Definition at line 142 of file MultiResHeightMapRenderer.h.

◆ targetHeight

double mars::MultiResHeightMapRenderer::targetHeight
private

Definition at line 117 of file MultiResHeightMapRenderer.h.

◆ targetWidth

double mars::MultiResHeightMapRenderer::targetWidth
private

Definition at line 117 of file MultiResHeightMapRenderer.h.

◆ texScaleX

double mars::MultiResHeightMapRenderer::texScaleX
private

Definition at line 120 of file MultiResHeightMapRenderer.h.

◆ texScaleY

double mars::MultiResHeightMapRenderer::texScaleY
private

Definition at line 120 of file MultiResHeightMapRenderer.h.

◆ vboIds

GLuint* mars::MultiResHeightMapRenderer::vboIds
private

Definition at line 115 of file MultiResHeightMapRenderer.h.

◆ vertices

VertexData* mars::MultiResHeightMapRenderer::vertices
private

Definition at line 122 of file MultiResHeightMapRenderer.h.

◆ width

int mars::MultiResHeightMapRenderer::width
private

Definition at line 118 of file MultiResHeightMapRenderer.h.

◆ wireframe

bool mars::MultiResHeightMapRenderer::wireframe
private

Definition at line 140 of file MultiResHeightMapRenderer.h.


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