RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Member Functions | Private Attributes
RoR::TerrainGeometryManager Class Reference

this class handles all interactions with the Ogre Terrain system More...

#include <TerrainGeometryManager.h>

+ Collaboration diagram for RoR::TerrainGeometryManager:

Public Member Functions

 TerrainGeometryManager (Terrain *terrainManager)
 
 ~TerrainGeometryManager ()
 
bool InitTerrain (std::string otc_filename)
 
Ogre::TerrainGroup * getTerrainGroup ()
 
float getHeightAt (float x, float z)
 
Ogre::Vector3 getNormalAt (float x, float y, float z)
 
Ogre::Vector3 getMaxTerrainSize ()
 
bool isFlat ()
 
void UpdateMainLightPosition ()
 
void updateLightMap ()
 

Private Member Functions

float getHeightAtTerrainPosition (float x, float z)
 
bool getTerrainImage (int x, int y, Ogre::Image &img)
 
bool loadTerrainConfig (Ogre::String filename)
 
void configureTerrainDefaults ()
 
void SetupGeometry (RoR::OTCPage &page, bool flat=false)
 
void SetupBlendMaps (RoR::OTCPage &page, Ogre::Terrain *t)
 
void initTerrain ()
 
void SetupLayers (RoR::OTCPage &page, Ogre::Terrain *terrain)
 
Ogre::DataStreamPtr getPageConfig (int x, int z)
 

Private Attributes

std::shared_ptr< RoR::OTCFilem_spec
 
RoR::TerrainterrainManager
 
Ogre::TerrainGroup * m_ogre_terrain_group
 
bool m_was_new_geometry_generated
 
Ogre::Vector3 mPos = Ogre::Vector3::ZERO
 
Ogre::Real mBase = 0.f
 
Ogre::Real mScale = 0.f
 
Ogre::uint16 mSize = 0
 
float * mHeightData = nullptr
 
bool mIsFlat
 
float mMinHeight
 
float mMaxHeight
 

Detailed Description

this class handles all interactions with the Ogre Terrain system

Definition at line 38 of file TerrainGeometryManager.h.

Constructor & Destructor Documentation

◆ TerrainGeometryManager()

TerrainGeometryManager::TerrainGeometryManager ( Terrain terrainManager)

Definition at line 138 of file TerrainGeometryManager.cpp.

◆ ~TerrainGeometryManager()

TerrainGeometryManager::~TerrainGeometryManager ( )

Definition at line 149 of file TerrainGeometryManager.cpp.

Member Function Documentation

◆ configureTerrainDefaults()

void TerrainGeometryManager::configureTerrainDefaults ( )
private

Definition at line 420 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeightAt()

float TerrainGeometryManager::getHeightAt ( float  x,
float  z 
)

Definition at line 231 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHeightAtTerrainPosition()

float TerrainGeometryManager::getHeightAtTerrainPosition ( float  x,
float  z 
)
private
Author
Ported from OGRE engine, www.ogre3d.org, file OgreTerrain.cpp

Definition at line 158 of file TerrainGeometryManager.cpp.

+ Here is the caller graph for this function:

◆ getMaxTerrainSize()

Ogre::Vector3 TerrainGeometryManager::getMaxTerrainSize ( )

Definition at line 689 of file TerrainGeometryManager.cpp.

+ Here is the caller graph for this function:

◆ getNormalAt()

Ogre::Vector3 TerrainGeometryManager::getNormalAt ( float  x,
float  y,
float  z 
)

Definition at line 247 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:

◆ getPageConfig()

Ogre::DataStreamPtr RoR::TerrainGeometryManager::getPageConfig ( int  x,
int  z 
)
private

◆ getTerrainGroup()

Ogre::TerrainGroup* RoR::TerrainGeometryManager::getTerrainGroup ( )
inline

Definition at line 46 of file TerrainGeometryManager.h.

+ Here is the caller graph for this function:

◆ getTerrainImage()

bool RoR::TerrainGeometryManager::getTerrainImage ( int  x,
int  y,
Ogre::Image &  img 
)
private

◆ initTerrain()

void RoR::TerrainGeometryManager::initTerrain ( )
private

◆ InitTerrain()

bool TerrainGeometryManager::InitTerrain ( std::string  otc_filename)

Definition at line 255 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:

◆ isFlat()

bool RoR::TerrainGeometryManager::isFlat ( )
inline

Definition at line 54 of file TerrainGeometryManager.h.

◆ loadTerrainConfig()

bool RoR::TerrainGeometryManager::loadTerrainConfig ( Ogre::String  filename)
private

◆ SetupBlendMaps()

void TerrainGeometryManager::SetupBlendMaps ( RoR::OTCPage page,
Ogre::Terrain *  t 
)
private

Definition at line 549 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupGeometry()

void TerrainGeometryManager::SetupGeometry ( RoR::OTCPage page,
bool  flat = false 
)
private

Definition at line 657 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupLayers()

void TerrainGeometryManager::SetupLayers ( RoR::OTCPage page,
Ogre::Terrain *  terrain 
)
private

Definition at line 517 of file TerrainGeometryManager.cpp.

+ Here is the caller graph for this function:

◆ updateLightMap()

void TerrainGeometryManager::updateLightMap ( )

Definition at line 388 of file TerrainGeometryManager.cpp.

+ Here is the caller graph for this function:

◆ UpdateMainLightPosition()

void TerrainGeometryManager::UpdateMainLightPosition ( )

Definition at line 406 of file TerrainGeometryManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_ogre_terrain_group

Ogre::TerrainGroup* RoR::TerrainGeometryManager::m_ogre_terrain_group
private

Definition at line 74 of file TerrainGeometryManager.h.

◆ m_spec

std::shared_ptr<RoR::OTCFile> RoR::TerrainGeometryManager::m_spec
private

Definition at line 72 of file TerrainGeometryManager.h.

◆ m_was_new_geometry_generated

bool RoR::TerrainGeometryManager::m_was_new_geometry_generated
private

Definition at line 75 of file TerrainGeometryManager.h.

◆ mBase

Ogre::Real RoR::TerrainGeometryManager::mBase = 0.f
private

Definition at line 79 of file TerrainGeometryManager.h.

◆ mHeightData

float* RoR::TerrainGeometryManager::mHeightData = nullptr
private

Definition at line 82 of file TerrainGeometryManager.h.

◆ mIsFlat

bool RoR::TerrainGeometryManager::mIsFlat
private

Definition at line 84 of file TerrainGeometryManager.h.

◆ mMaxHeight

float RoR::TerrainGeometryManager::mMaxHeight
private

Definition at line 86 of file TerrainGeometryManager.h.

◆ mMinHeight

float RoR::TerrainGeometryManager::mMinHeight
private

Definition at line 85 of file TerrainGeometryManager.h.

◆ mPos

Ogre::Vector3 RoR::TerrainGeometryManager::mPos = Ogre::Vector3::ZERO
private

Definition at line 78 of file TerrainGeometryManager.h.

◆ mScale

Ogre::Real RoR::TerrainGeometryManager::mScale = 0.f
private

Definition at line 80 of file TerrainGeometryManager.h.

◆ mSize

Ogre::uint16 RoR::TerrainGeometryManager::mSize = 0
private

Definition at line 81 of file TerrainGeometryManager.h.

◆ terrainManager

RoR::Terrain* RoR::TerrainGeometryManager::terrainManager
private

Definition at line 73 of file TerrainGeometryManager.h.


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