Changeset 138 in flair-src
- Timestamp:
- Feb 14, 2017, 3:59:41 PM (8 years ago)
- Location:
- trunk/lib/FlairSimulator/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/Parser.cpp
r134 r138 138 138 ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length"))), 139 139 atof((char *)xmlGetProp(cur_node, (xmlChar *)"tesselation")), 140 SColor(100, 255, 100, 100)); 140 getScolor(cur_node->children)); 141 //SColor(100, 255, 100, 100)); 141 142 GenericObject *object = new GenericObject(parent, mesh); 142 143 object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position")); … … 182 183 } 183 184 } 185 186 SColor Parser::getScolor(xmlNode *mesh_node) { 187 xmlNode *cur_node = NULL; 188 for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) { 189 if (xmlStrEqual(cur_node->name, (xmlChar *)"color")) { 190 return SColor(atoi((char *)xmlGetProp(cur_node, (xmlChar *)"a")), 191 atoi((char *)xmlGetProp(cur_node, (xmlChar *)"r")), 192 atoi((char *)xmlGetProp(cur_node, (xmlChar *)"g")), 193 atoi((char *)xmlGetProp(cur_node, (xmlChar *)"b"))); 194 } 195 } 196 return SColor(255,0, 0, 0); 197 } 198 184 199 // todo rendre un vector3D framework 185 200 // retirer irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df -
trunk/lib/FlairSimulator/src/Parser.h
r87 r138 21 21 #include <libxml/parser.h> 22 22 #include <libxml/tree.h> 23 #include <SColor.h> 23 24 24 25 namespace flair { … … 49 50 void processObjects(xmlNode *a_node); 50 51 void processParams(xmlNode *a_node); 52 irr::video::SColor getScolor(xmlNode *mesh_node); 51 53 irr::core::vector3df getMeshVect(xmlNode *mesh_node, xmlChar *param); 52 54 irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param,
Note:
See TracChangeset
for help on using the changeset viewer.