Changeset 426 in flair-src for trunk/lib/FlairSimulator
- Timestamp:
- May 20, 2021, 4:07:59 PM (4 years ago)
- Location:
- trunk/lib/FlairSimulator/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/GenericObject.cpp
r286 r426 37 37 namespace simulator { 38 38 39 GenericObject::GenericObject(IMesh *mesh) 40 { 39 GenericObject::GenericObject(IMesh *mesh) { 41 40 meshSceneNode=getGui()->getSceneManager()->addMeshSceneNode(mesh); 42 41 /* -
trunk/lib/FlairSimulator/src/Parser.cpp
r302 r426 117 117 FILE *fp; 118 118 std::string fileName = this->media_path+"/"; 119 fileName.append((char *)xmlGetProp(cur_node, (xmlChar *)"model")); 119 120 fp = NULL; 120 fp = fopen(fileName.append((char *)xmlGetProp( 121 cur_node, (xmlChar *)"model")).c_str(),"rb"); 121 fp = fopen(fileName.c_str(),"rb"); 122 122 if (fp != NULL) { 123 GenericObject *object = 124 new GenericObject(getGui()->getMesh((char *)xmlGetProp(cur_node, (xmlChar *)"model"))); 125 object->setPosition( 126 getMeshVect(cur_node->children, (xmlChar *)"position")); 127 object->setRotation( 128 getMeshVect(cur_node->children, (xmlChar *)"rotation")); 123 fclose(fp); 124 GenericObject *object =new GenericObject(getGui()->getMesh((char *)xmlGetProp(cur_node, (xmlChar *)"model"))); 125 object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position")); 126 object->setRotation(getMeshVect(cur_node->children, (xmlChar *)"rotation")); 129 127 object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale")); 130 128 } else { 131 Err("FATAL ERROR : File %s %s doesn't exist !\r\n", 132 (char *)xmlGetProp(cur_node, (xmlChar *)"model"),fileName.c_str()); 129 Err("FATAL ERROR : File %s doesn't exist !\n",fileName.c_str()); 133 130 } 134 131 } else if (xmlStrEqual(cur_node->name, (xmlChar *)"cylinder")) { … … 154 151 155 152 GenericObject *object =new GenericObject(mesh); 156 object->setPosition( 157 getMeshVect(cur_node->children, (xmlChar *)"position")); 158 object->setRotation( 159 getMeshVect(cur_node->children, (xmlChar *)"rotation")); 153 object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position")); 154 object->setRotation(getMeshVect(cur_node->children, (xmlChar *)"rotation")); 160 155 object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale")); 161 156 }
Note:
See TracChangeset
for help on using the changeset viewer.