#include <object_cfg.h>
Inheritance diagram for ObjectConfig:
Public Member Functions | |
ObjectConfig () | |
~ObjectConfig () | |
void | LoadXml (const std::string &obj_name, const std::string &config_file) |
Public Attributes | |
double | m_mass |
double | m_wind_factor |
double | m_air_resist_factor |
double | m_gravity_factor |
bool | m_rebounding |
double | m_rebound_factor |
Definition at line 29 of file object_cfg.h.
ObjectConfig::ObjectConfig | ( | ) |
Definition at line 31 of file object_cfg.cpp.
00032 { 00033 m_rebounding = false; 00034 m_rebound_factor = 0.01; 00035 m_air_resist_factor = 1.0; 00036 m_wind_factor = 1.0; 00037 m_gravity_factor = 1.0; 00038 m_mass = 1.0; 00039 }
ObjectConfig::~ObjectConfig | ( | ) |
void ObjectConfig::LoadXml | ( | const std::string & | obj_name, | |
const std::string & | config_file | |||
) |
Definition at line 45 of file object_cfg.cpp.
00046 { 00047 std::string file; 00048 if(config_file=="") 00049 file = Config::GetInstance()->GetDataDir() + PATH_SEPARATOR + "game_mode" + PATH_SEPARATOR + "objects.xml"; 00050 else 00051 file = config_file; 00052 00053 // Load Xml configuration 00054 XmlReader doc; 00055 assert(doc.Load(file)); 00056 xmlpp::Element* elem = XmlReader::GetMarker(doc.GetRoot(), obj_name); 00057 00058 assert(elem != NULL); 00059 XmlReader::ReadDouble(elem, "mass", m_mass); 00060 XmlReader::ReadDouble(elem, "wind_factor", m_wind_factor); 00061 XmlReader::ReadDouble(elem, "air_resist_factor", m_air_resist_factor); 00062 XmlReader::ReadDouble(elem, "gravity_factor", m_gravity_factor); 00063 XmlReader::ReadDouble(elem, "rebound_factor", m_rebound_factor); 00064 XmlReader::ReadBool(elem, "rebounding", m_rebounding); 00065 }
Here is the call graph for this function:
Here is the caller graph for this function:
Definition at line 39 of file object_cfg.h.
Definition at line 42 of file object_cfg.h.
double ObjectConfig::m_mass |
Definition at line 33 of file object_cfg.h.
Definition at line 48 of file object_cfg.h.
Definition at line 45 of file object_cfg.h.
double ObjectConfig::m_wind_factor |
Definition at line 36 of file object_cfg.h.