Changeset 87 in flair-src for trunk/lib/FlairSimulator/src/Parser.cpp
- Timestamp:
- Sep 28, 2016, 8:41:02 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/Parser.cpp
r69 r87 19 19 #include "Simulator.h" 20 20 #include "GenericObject.h" 21 #include "FixedCamera.h" 21 22 #include <vector3d.h> 23 #include <Vector3D.h> 22 24 #include <IrrlichtDevice.h> 23 25 #include <IFileSystem.h> … … 188 190 getSceneVect(cur_node->children, (xmlChar *)"rotation"), 189 191 getSceneVect(cur_node->children, (xmlChar *)"scale", true)); 192 } else if (xmlStrEqual(cur_node->name, (xmlChar *)"camera")) { 193 FixedCamera* fixedCamera=new FixedCamera(std::string((char *)xmlGetProp(cur_node, (xmlChar *)"name")), 194 getMeshVector3D(cur_node->children, (xmlChar *)"position"), 195 getMeshVector3D(cur_node->children, (xmlChar *)"lookat")); 190 196 } 191 197 } … … 204 210 } 205 211 return vector3df(0, 0, 0); 212 } 213 214 Vector3D Parser::getMeshVector3D(xmlNode *mesh_node, xmlChar *param) { 215 xmlNode *cur_node = NULL; 216 for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) { 217 if (xmlStrEqual(cur_node->name, param)) { 218 return Vector3D(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")), 219 atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")), 220 atof((char *)xmlGetProp(cur_node, (xmlChar *)"z"))); 221 } 222 } 223 return Vector3D(0, 0, 0); 206 224 } 207 225
Note:
See TracChangeset
for help on using the changeset viewer.