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

#include <TerrainDrawObject.h>

Public Member Functions

 TerrainDrawObject (GraphicsManager *g, const mars::interfaces::terrainStruct *ts, std::string gridFile="")
 
virtual ~TerrainDrawObject (void)
 
virtual void generateTangents ()
 
virtual void collideSphere (mars::utils::Vector pos, mars::interfaces::sReal radius)
 
void createObject (unsigned long id, const utils::Vector &pivot, unsigned long sharedID)
 
void setData (configmaps::ConfigMap map)
 
- Public Member Functions inherited from mars::graphics::DrawObject
 DrawObject (GraphicsManager *g)
 
virtual ~DrawObject ()
 
void setStateFilename (const std::string &filename, int create)
 
void exportState (void)
 
void exportModel (const std::string &filename)
 
virtual void setMaterial (const std::string &name)
 
virtual void setPosition (const mars::utils::Vector &_pos)
 
virtual void setQuaternion (const mars::utils::Quaternion &_q)
 
virtual const mars::utils::VectorgetPosition ()
 
virtual const mars::utils::QuaterniongetQuaternion ()
 
virtual void setScaledSize (const mars::utils::Vector &scaledSize)
 
void setScale (const mars::utils::Vector &scale)
 
void removeBits (unsigned int bits)
 
void setBits (unsigned int bits)
 
void setNodeMask (unsigned int mask)
 
void setBrightness (double v)
 
void setRenderBinNumber (int number)
 
bool containsNode (osg::Node *node)
 
virtual void setSelected (bool val)
 
bool isSelected (void)
 
void setSelectable (bool val)
 
void setShowSelected (bool val)
 
unsigned long getID (void) const
 
void setID (unsigned long _id)
 
void showNormals (bool val)
 
osg::ref_ptr< osg::PositionAttitudeTransform > getTransform ()
 
osg::ref_ptr< osg::MatrixTransform > getScaleMatrix ()
 
osg::Group * getObject (void) const
 
osg::PositionAttitudeTransform * getPosTransform (void) const
 
osg::MatrixTransform * getScaleTransform (void) const
 
void setExperimentalLineLaser (utils::Vector lineLasePos, utils::Vector lineLaserNormal, utils::Vector lineLaserColor, utils::Vector LaserAngle, float openingAngle)
 Sets the line laser : position of the laser : normalvector of the laser-plane : color of the laser in RGB : Angle of the laser, as an direction-vector : Opening angle of the laser; for complete laserLine, choose PI. More...
 
void setMaxNumLights (int n)
 
void show ()
 
void hide ()
 
osg_material_manager::MaterialNodegetStateGroup ()
 
void addLODGeodes (std::list< osg::ref_ptr< osg::Geode > > geodes, float start, float end)
 
void seperateMaterial ()
 
void addSelectionChild (DrawObject *c)
 

Static Public Attributes

static int countSubTiles = 0
 
- Static Public Attributes inherited from mars::graphics::DrawObject
static osg::ref_ptr< osg::Material > selectionMaterial = makeSelectionMaterial()
 

Private Member Functions

virtual std::list< osg::ref_ptr< osg::Geode > > createGeometry ()
 
void createNewSubTile (SubTile *newSubTile, mars::utils::Vector pos, double radius)
 
mars::utils::Vector getNormal (int x, int y, int mx, int my, double x_step, double y_step, double **height_data, osg::Vec3d *t, bool skipBorder=false)
 
int rectangleIntersect (const osg::Vec3 &first_leftup, const osg::Vec3 &first_downright, const osg::Vec3 &second_leftup, const osg::Vec3 &second_downright)
 
osg::Vec3d intersectReplacementSphere (osg::Vec3 center, double radius, osg::Vec3 vertex)
 
void cutHole (int x1, int x2, int y1, int y2)
 
bool adaptSubtile (SubTile *tile, mars::utils::Vector pos, double radius)
 
void removeSubTile (SubTile *tile)
 
void updateShadowObject (mars::utils::Vector pos)
 
void drawSubTile (SubTile *tile)
 
double getHeight (int x, int y, SubTile *tile)
 

Private Attributes

mars::interfaces::terrainStruct info
 
osg::ref_ptr< osg::Vec4Array > tangents
 
osg::ref_ptr< osg::Geometry > geom
 
osg::ref_ptr< osg::Vec3Array > vertices
 
osg::ref_ptr< osg::Vec2Array > texcoords
 
osg::ref_ptr< osg::Vec3Array > normals
 
osg::ref_ptr< osg::Vec3Array > normal_debug
 
osg::ref_ptr< osg::Geometry > normal_geom
 
double ** height_data
 
int tangentUnit
 
int num_y
 
int num_x
 
double x_step
 
double y_step
 
double x_step2
 
double y_step2
 
double tex_scale_x
 
double tex_scale_y
 
std::string gridFile
 
std::vector< std::vector< LoadDrawObjectPSetBox * > * > gridPSets
 
std::map< int, SubTile * > subTiles
 
std::vector< SubTile * > vSubTiles
 
configmaps::ConfigMap map
 

Additional Inherited Members

- Protected Attributes inherited from mars::graphics::DrawObject
unsigned long id_
 
unsigned int nodeMask_
 
std::string stateFilename_
 
bool selected_
 
bool selectable_
 
bool showSelected
 
osg::ref_ptr< osg_material_manager::MaterialNodematerialNode
 
osg::ref_ptr< osg::Group > group_
 
std::list< osg::ref_ptr< osg::Geometry > > geometry_
 
osg::ref_ptr< osg::Geode > normal_geode
 
osg::ref_ptr< osg::LOD > lod
 
osg::ref_ptr< osg::PositionAttitudeTransform > posTransform_
 
osg::ref_ptr< osg::MatrixTransform > scaleTransform_
 
std::vector< DrawObject * > selectionChilds
 
mars::utils::Vector position_
 
mars::utils::Vector pivot_
 
mars::utils::Vector geometrySize_
 
mars::utils::Vector scaledSize_
 
mars::utils::Quaternion quaternion_
 
osg::ref_ptr< osg::Program > selectShader
 
int maxNumLights
 
bool sharedStateGroup
 
bool isHidden
 
double brightness
 
GraphicsManagerg
 

Detailed Description

Definition at line 84 of file TerrainDrawObject.h.

Constructor & Destructor Documentation

◆ TerrainDrawObject()

mars::graphics::TerrainDrawObject::TerrainDrawObject ( GraphicsManager g,
const mars::interfaces::terrainStruct ts,
std::string  gridFile = "" 
)

Definition at line 57 of file TerrainDrawObject.cpp.

◆ ~TerrainDrawObject()

mars::graphics::TerrainDrawObject::~TerrainDrawObject ( void  )
virtual

Definition at line 75 of file TerrainDrawObject.cpp.

Member Function Documentation

◆ adaptSubtile()

bool mars::graphics::TerrainDrawObject::adaptSubtile ( SubTile tile,
mars::utils::Vector  pos,
double  radius 
)
private

Definition at line 954 of file TerrainDrawObject.cpp.

◆ collideSphere()

void mars::graphics::TerrainDrawObject::collideSphere ( mars::utils::Vector  pos,
mars::interfaces::sReal  radius 
)
virtual

Reimplemented from mars::graphics::DrawObject.

Definition at line 437 of file TerrainDrawObject.cpp.

◆ createGeometry()

std::list< osg::ref_ptr< osg::Geode > > mars::graphics::TerrainDrawObject::createGeometry ( )
privatevirtual

Implements mars::graphics::DrawObject.

Definition at line 133 of file TerrainDrawObject.cpp.

◆ createNewSubTile()

void mars::graphics::TerrainDrawObject::createNewSubTile ( SubTile newSubTile,
mars::utils::Vector  pos,
double  radius 
)
private

Definition at line 606 of file TerrainDrawObject.cpp.

◆ createObject()

void mars::graphics::TerrainDrawObject::createObject ( unsigned long  id,
const utils::Vector pivot,
unsigned long  sharedID 
)
virtual

Reimplemented from mars::graphics::DrawObject.

Definition at line 90 of file TerrainDrawObject.cpp.

◆ cutHole()

void mars::graphics::TerrainDrawObject::cutHole ( int  x1,
int  x2,
int  y1,
int  y2 
)
private

Definition at line 844 of file TerrainDrawObject.cpp.

◆ drawSubTile()

void mars::graphics::TerrainDrawObject::drawSubTile ( SubTile tile)
private

Definition at line 1082 of file TerrainDrawObject.cpp.

◆ generateTangents()

void mars::graphics::TerrainDrawObject::generateTangents ( )
virtual

Definition at line 422 of file TerrainDrawObject.cpp.

◆ getHeight()

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

Definition at line 1097 of file TerrainDrawObject.cpp.

◆ getNormal()

Vector mars::graphics::TerrainDrawObject::getNormal ( int  x,
int  y,
int  mx,
int  my,
double  x_step,
double  y_step,
double **  height_data,
osg::Vec3d *  t,
bool  skipBorder = false 
)
private

Definition at line 743 of file TerrainDrawObject.cpp.

◆ intersectReplacementSphere()

osg::Vec3d mars::graphics::TerrainDrawObject::intersectReplacementSphere ( osg::Vec3  center,
double  radius,
osg::Vec3  vertex 
)
private

Definition at line 835 of file TerrainDrawObject.cpp.

◆ rectangleIntersect()

int mars::graphics::TerrainDrawObject::rectangleIntersect ( const osg::Vec3 &  first_leftup,
const osg::Vec3 &  first_downright,
const osg::Vec3 &  second_leftup,
const osg::Vec3 &  second_downright 
)
private

Definition at line 918 of file TerrainDrawObject.cpp.

◆ removeSubTile()

void mars::graphics::TerrainDrawObject::removeSubTile ( SubTile tile)
private

Definition at line 1121 of file TerrainDrawObject.cpp.

◆ setData()

void mars::graphics::TerrainDrawObject::setData ( configmaps::ConfigMap  map)

Definition at line 83 of file TerrainDrawObject.cpp.

◆ updateShadowObject()

void mars::graphics::TerrainDrawObject::updateShadowObject ( mars::utils::Vector  pos)
private

Definition at line 1245 of file TerrainDrawObject.cpp.

Member Data Documentation

◆ countSubTiles

int mars::graphics::TerrainDrawObject::countSubTiles = 0
static

Definition at line 94 of file TerrainDrawObject.h.

◆ geom

osg::ref_ptr<osg::Geometry> mars::graphics::TerrainDrawObject::geom
private

Definition at line 111 of file TerrainDrawObject.h.

◆ gridFile

std::string mars::graphics::TerrainDrawObject::gridFile
private

Definition at line 126 of file TerrainDrawObject.h.

◆ gridPSets

std::vector<std::vector<LoadDrawObjectPSetBox*>*> mars::graphics::TerrainDrawObject::gridPSets
private

Definition at line 127 of file TerrainDrawObject.h.

◆ height_data

double** mars::graphics::TerrainDrawObject::height_data
private

Definition at line 119 of file TerrainDrawObject.h.

◆ info

mars::interfaces::terrainStruct mars::graphics::TerrainDrawObject::info
private

Definition at line 109 of file TerrainDrawObject.h.

◆ map

configmaps::ConfigMap mars::graphics::TerrainDrawObject::map
private

Definition at line 132 of file TerrainDrawObject.h.

◆ normal_debug

osg::ref_ptr<osg::Vec3Array> mars::graphics::TerrainDrawObject::normal_debug
private

Definition at line 116 of file TerrainDrawObject.h.

◆ normal_geom

osg::ref_ptr<osg::Geometry> mars::graphics::TerrainDrawObject::normal_geom
private

Definition at line 117 of file TerrainDrawObject.h.

◆ normals

osg::ref_ptr<osg::Vec3Array> mars::graphics::TerrainDrawObject::normals
private

Definition at line 115 of file TerrainDrawObject.h.

◆ num_x

int mars::graphics::TerrainDrawObject::num_x
private

Definition at line 122 of file TerrainDrawObject.h.

◆ num_y

int mars::graphics::TerrainDrawObject::num_y
private

Definition at line 122 of file TerrainDrawObject.h.

◆ subTiles

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

Definition at line 130 of file TerrainDrawObject.h.

◆ tangents

osg::ref_ptr<osg::Vec4Array> mars::graphics::TerrainDrawObject::tangents
private

Definition at line 110 of file TerrainDrawObject.h.

◆ tangentUnit

int mars::graphics::TerrainDrawObject::tangentUnit
private

Definition at line 121 of file TerrainDrawObject.h.

◆ tex_scale_x

double mars::graphics::TerrainDrawObject::tex_scale_x
private

Definition at line 125 of file TerrainDrawObject.h.

◆ tex_scale_y

double mars::graphics::TerrainDrawObject::tex_scale_y
private

Definition at line 125 of file TerrainDrawObject.h.

◆ texcoords

osg::ref_ptr<osg::Vec2Array> mars::graphics::TerrainDrawObject::texcoords
private

Definition at line 114 of file TerrainDrawObject.h.

◆ vertices

osg::ref_ptr<osg::Vec3Array> mars::graphics::TerrainDrawObject::vertices
private

Definition at line 113 of file TerrainDrawObject.h.

◆ vSubTiles

std::vector<SubTile*> mars::graphics::TerrainDrawObject::vSubTiles
private

Definition at line 131 of file TerrainDrawObject.h.

◆ x_step

double mars::graphics::TerrainDrawObject::x_step
private

Definition at line 123 of file TerrainDrawObject.h.

◆ x_step2

double mars::graphics::TerrainDrawObject::x_step2
private

Definition at line 124 of file TerrainDrawObject.h.

◆ y_step

double mars::graphics::TerrainDrawObject::y_step
private

Definition at line 123 of file TerrainDrawObject.h.

◆ y_step2

double mars::graphics::TerrainDrawObject::y_step2
private

Definition at line 124 of file TerrainDrawObject.h.


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