RigsofRods
Soft-body Physics Simulation
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
RoR::TerrainObjectManager Class Reference

#include <TerrainObjectManager.h>

+ Inheritance diagram for RoR::TerrainObjectManager:
+ Collaboration diagram for RoR::TerrainObjectManager:

Data Structures

struct  AnimatedObject
 
struct  ParticleEffectObject
 

Public Member Functions

 TerrainObjectManager (Terrain *terrainManager)
 
 ~TerrainObjectManager ()
 
TerrainEditorObjectPtrVecGetEditorObjects ()
 
std::vector< TObjDocumentPtr > & GetTobjCache ()
 
void LoadTObjFile (Ogre::String filename)
 
bool LoadTerrainObject (const Ogre::String &name, const Ogre::Vector3 &pos, const Ogre::Vector3 &rot, const Ogre::String &instancename, const Ogre::String &type, float rendering_distance=0, bool enable_collisions=true, int scripthandler=-1, bool uniquifyMaterial=false)
 
bool LoadTerrainScript (const Ogre::String &filename)
 
void moveObjectVisuals (const Ogre::String &instancename, const Ogre::Vector3 &pos)
 
void destroyObject (const Ogre::String &instancename)
 
void LoadTelepoints ()
 
void SpawnSinglePredefinedActor (TerrainEditorObjectPtr const &object)
 
bool GetEditorObjectFlagRotYXZ (TerrainEditorObjectPtr const &object)
 
void LoadPredefinedActors ()
 
bool HasPredefinedActors ()
 
bool UpdateTerrainObjects (float dt)
 
void ProcessTree (float yawfrom, float yawto, float scalefrom, float scaleto, char *ColorMap, char *DensityMap, char *treemesh, char *treeCollmesh, float gridspacing, float highdens, int minDist, int maxDist, int mapsizex, int mapsizez)
 
void ProcessGrass (float SwaySpeed, float SwayLength, float SwayDistribution, float Density, float minx, float miny, float minH, float maxx, float maxy, float maxH, char *grassmat, char *colorMapFilename, char *densityMapFilename, int growtechnique, int techn, int range, int mapsizex, int mapsizez)
 
void ProcessPredefinedActor (int tobj_cache_id, const std::string &name, const Ogre::Vector3 position, const Ogre::Vector3 rotation, const TObjSpecialObject type)
 
LocalizerVecGetLocalizers ()
 
ProceduralManagerPtrgetProceduralManager ()
 
Ogre::SceneNode * getGroupingSceneNode ()
 
- Public Member Functions inherited from RefCountingObject< TerrainObjectManager >
 RefCountingObject ()
 
virtual ~RefCountingObject ()
 
void AddRef ()
 
void Release ()
 

Protected Member Functions

RoR::ODefDocumentFetchODef (std::string const &odef_name)
 
void ProcessODefCollisionBoxes (TerrainEditorObjectPtr obj, ODefDocument *odef, const TerrainEditorObjectPtr &params, bool race_event)
 
void UpdateAnimatedObjects (float dt)
 
void UpdateParticleEffectObjects ()
 
TerrainEditorObjectID_t FindEditorObjectByInstanceName (std::string const &instance_name)
 Returns offset to m_editor_objects or -1 if not found. More...
 

Protected Attributes

LocalizerVec m_localizers
 
std::unordered_map< std::string, std::shared_ptr< RoR::ODefDocument > > m_odef_cache
 
std::vector< TObjDocumentPtrm_tobj_cache
 
int m_tobj_cache_active_id = -1
 
TerrainEditorObjectPtrVec m_editor_objects
 
bool m_has_predefined_actors
 
std::vector< AnimatedObjectm_animated_objects
 
std::vector< ParticleEffectObjectm_particle_effect_objects
 
std::vector< MeshObject * > m_mesh_objects
 
SurveyMapEntityVec m_map_entities
 
TerrainterrainManager
 
ProceduralManagerPtr m_procedural_manager
 
int m_entity_counter = 0
 
Ogre::SceneNode * m_terrn2_grouping_node = nullptr
 For a readable scene graph (via inspector script) More...
 
Ogre::SceneNode * m_tobj_grouping_node = nullptr
 For even more readable scene graph (via inspector script) More...
 
Ogre::SceneNode * m_angelscript_grouping_node = nullptr
 For even more readable scene graph (via inspector script) More...
 

Friends

class Terrain
 

Additional Inherited Members

- Static Public Member Functions inherited from RefCountingObject< TerrainObjectManager >
static void RegisterRefCountingObject (AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name)
 
- Data Fields inherited from RefCountingObject< TerrainObjectManager >
int m_refcount
 
std::mutex m_refcount_mtx
 

Detailed Description

Definition at line 58 of file TerrainObjectManager.h.

Constructor & Destructor Documentation

◆ TerrainObjectManager()

TerrainObjectManager::TerrainObjectManager ( Terrain terrainManager)

Definition at line 68 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

◆ ~TerrainObjectManager()

TerrainObjectManager::~TerrainObjectManager ( )

Definition at line 76 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ destroyObject()

void TerrainObjectManager::destroyObject ( const Ogre::String &  instancename)

Definition at line 504 of file TerrainObjectManager.cpp.

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

◆ FetchODef()

ODefDocument * TerrainObjectManager::FetchODef ( std::string const &  odef_name)
protected

Definition at line 558 of file TerrainObjectManager.cpp.

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

◆ FindEditorObjectByInstanceName()

TerrainEditorObjectID_t TerrainObjectManager::FindEditorObjectByInstanceName ( std::string const &  instance_name)
protected

Returns offset to m_editor_objects or -1 if not found.

Definition at line 1158 of file TerrainObjectManager.cpp.

+ Here is the caller graph for this function:

◆ GetEditorObjectFlagRotYXZ()

bool TerrainObjectManager::GetEditorObjectFlagRotYXZ ( TerrainEditorObjectPtr const &  object)

Definition at line 1020 of file TerrainObjectManager.cpp.

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

◆ GetEditorObjects()

TerrainEditorObjectPtrVec& RoR::TerrainObjectManager::GetEditorObjects ( )
inline

Definition at line 66 of file TerrainObjectManager.h.

+ Here is the caller graph for this function:

◆ getGroupingSceneNode()

Ogre::SceneNode * TerrainObjectManager::getGroupingSceneNode ( )

Definition at line 1143 of file TerrainObjectManager.cpp.

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

◆ GetLocalizers()

LocalizerVec& RoR::TerrainObjectManager::GetLocalizers ( )
inline

Definition at line 95 of file TerrainObjectManager.h.

+ Here is the caller graph for this function:

◆ getProceduralManager()

ProceduralManagerPtr& RoR::TerrainObjectManager::getProceduralManager ( )
inline

Definition at line 97 of file TerrainObjectManager.h.

◆ GetTobjCache()

std::vector<TObjDocumentPtr>& RoR::TerrainObjectManager::GetTobjCache ( )
inline

Definition at line 67 of file TerrainObjectManager.h.

+ Here is the caller graph for this function:

◆ HasPredefinedActors()

bool RoR::TerrainObjectManager::HasPredefinedActors ( )
inline

Definition at line 77 of file TerrainObjectManager.h.

◆ LoadPredefinedActors()

void TerrainObjectManager::LoadPredefinedActors ( )

Definition at line 1072 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

◆ LoadTelepoints()

void TerrainObjectManager::LoadTelepoints ( )

Definition at line 1012 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

◆ LoadTerrainObject()

bool TerrainObjectManager::LoadTerrainObject ( const Ogre::String &  name,
const Ogre::Vector3 &  pos,
const Ogre::Vector3 &  rot,
const Ogre::String &  instancename,
const Ogre::String &  type,
float  rendering_distance = 0,
bool  enable_collisions = true,
int  scripthandler = -1,
bool  uniquifyMaterial = false 
)

Definition at line 600 of file TerrainObjectManager.cpp.

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

◆ LoadTerrainScript()

bool TerrainObjectManager::LoadTerrainScript ( const Ogre::String &  filename)

Definition at line 973 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

◆ LoadTObjFile()

void TerrainObjectManager::LoadTObjFile ( Ogre::String  filename)

Definition at line 150 of file TerrainObjectManager.cpp.

+ Here is the call graph for this function:

◆ moveObjectVisuals()

void TerrainObjectManager::moveObjectVisuals ( const Ogre::String &  instancename,
const Ogre::Vector3 &  pos 
)

Definition at line 489 of file TerrainObjectManager.cpp.

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

◆ ProcessGrass()

void TerrainObjectManager::ProcessGrass ( float  SwaySpeed,
float  SwayLength,
float  SwayDistribution,
float  Density,
float  minx,
float  miny,
float  minH,
float  maxx,
float  maxy,
float  maxH,
char *  grassmat,
char *  colorMapFilename,
char *  densityMapFilename,
int  growtechnique,
int  techn,
int  range,
int  mapsizex,
int  mapsizez 
)

Definition at line 400 of file TerrainObjectManager.cpp.

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

◆ ProcessODefCollisionBoxes()

void TerrainObjectManager::ProcessODefCollisionBoxes ( TerrainEditorObjectPtr  obj,
ODefDocument odef,
const TerrainEditorObjectPtr params,
bool  race_event 
)
protected

Definition at line 1110 of file TerrainObjectManager.cpp.

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

◆ ProcessPredefinedActor()

void TerrainObjectManager::ProcessPredefinedActor ( int  tobj_cache_id,
const std::string &  name,
const Ogre::Vector3  position,
const Ogre::Vector3  rotation,
const TObjSpecialObject  type 
)

Definition at line 473 of file TerrainObjectManager.cpp.

+ Here is the caller graph for this function:

◆ ProcessTree()

void TerrainObjectManager::ProcessTree ( float  yawfrom,
float  yawto,
float  scalefrom,
float  scaleto,
char *  ColorMap,
char *  DensityMap,
char *  treemesh,
char *  treeCollmesh,
float  gridspacing,
float  highdens,
int  minDist,
int  maxDist,
int  mapsizex,
int  mapsizez 
)

Definition at line 275 of file TerrainObjectManager.cpp.

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

◆ SpawnSinglePredefinedActor()

void TerrainObjectManager::SpawnSinglePredefinedActor ( TerrainEditorObjectPtr const &  object)

Definition at line 1036 of file TerrainObjectManager.cpp.

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

◆ UpdateAnimatedObjects()

void TerrainObjectManager::UpdateAnimatedObjects ( float  dt)
protected

Definition at line 984 of file TerrainObjectManager.cpp.

+ Here is the caller graph for this function:

◆ UpdateParticleEffectObjects()

void TerrainObjectManager::UpdateParticleEffectObjects ( )
protected

Definition at line 1001 of file TerrainObjectManager.cpp.

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

◆ UpdateTerrainObjects()

bool TerrainObjectManager::UpdateTerrainObjects ( float  dt)

Definition at line 1096 of file TerrainObjectManager.cpp.

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

Friends And Related Function Documentation

◆ Terrain

friend class Terrain
friend

Definition at line 60 of file TerrainObjectManager.h.

Field Documentation

◆ m_angelscript_grouping_node

Ogre::SceneNode* RoR::TerrainObjectManager::m_angelscript_grouping_node = nullptr
protected

For even more readable scene graph (via inspector script)

Definition at line 147 of file TerrainObjectManager.h.

◆ m_animated_objects

std::vector<AnimatedObject> RoR::TerrainObjectManager::m_animated_objects
protected

Definition at line 138 of file TerrainObjectManager.h.

◆ m_editor_objects

TerrainEditorObjectPtrVec RoR::TerrainObjectManager::m_editor_objects
protected

Definition at line 136 of file TerrainObjectManager.h.

◆ m_entity_counter

int RoR::TerrainObjectManager::m_entity_counter = 0
protected

Definition at line 144 of file TerrainObjectManager.h.

◆ m_has_predefined_actors

bool RoR::TerrainObjectManager::m_has_predefined_actors
protected

Definition at line 137 of file TerrainObjectManager.h.

◆ m_localizers

LocalizerVec RoR::TerrainObjectManager::m_localizers
protected

Definition at line 132 of file TerrainObjectManager.h.

◆ m_map_entities

SurveyMapEntityVec RoR::TerrainObjectManager::m_map_entities
protected

Definition at line 141 of file TerrainObjectManager.h.

◆ m_mesh_objects

std::vector<MeshObject*> RoR::TerrainObjectManager::m_mesh_objects
protected

Definition at line 140 of file TerrainObjectManager.h.

◆ m_odef_cache

std::unordered_map<std::string, std::shared_ptr<RoR::ODefDocument> > RoR::TerrainObjectManager::m_odef_cache
protected

Definition at line 133 of file TerrainObjectManager.h.

◆ m_particle_effect_objects

std::vector<ParticleEffectObject> RoR::TerrainObjectManager::m_particle_effect_objects
protected

Definition at line 139 of file TerrainObjectManager.h.

◆ m_procedural_manager

ProceduralManagerPtr RoR::TerrainObjectManager::m_procedural_manager
protected

Definition at line 143 of file TerrainObjectManager.h.

◆ m_terrn2_grouping_node

Ogre::SceneNode* RoR::TerrainObjectManager::m_terrn2_grouping_node = nullptr
protected

For a readable scene graph (via inspector script)

Definition at line 145 of file TerrainObjectManager.h.

◆ m_tobj_cache

std::vector<TObjDocumentPtr> RoR::TerrainObjectManager::m_tobj_cache
protected

Definition at line 134 of file TerrainObjectManager.h.

◆ m_tobj_cache_active_id

int RoR::TerrainObjectManager::m_tobj_cache_active_id = -1
protected

Definition at line 135 of file TerrainObjectManager.h.

◆ m_tobj_grouping_node

Ogre::SceneNode* RoR::TerrainObjectManager::m_tobj_grouping_node = nullptr
protected

For even more readable scene graph (via inspector script)

Definition at line 146 of file TerrainObjectManager.h.

◆ terrainManager

Terrain* RoR::TerrainObjectManager::terrainManager
protected

Definition at line 142 of file TerrainObjectManager.h.


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