Changeset 426 in flair-src for trunk/lib/FlairSimulator


Ignore:
Timestamp:
05/20/21 16:07:59 (3 years ago)
Author:
Sanahuja Guillaume
Message:

up

Location:
trunk/lib/FlairSimulator/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/GenericObject.cpp

    r286 r426  
    3737namespace simulator {
    3838
    39 GenericObject::GenericObject(IMesh *mesh)
    40 {
     39GenericObject::GenericObject(IMesh *mesh) {
    4140        meshSceneNode=getGui()->getSceneManager()->addMeshSceneNode(mesh);
    4241        /*
  • trunk/lib/FlairSimulator/src/Parser.cpp

    r302 r426  
    117117                        FILE *fp;
    118118                        std::string fileName = this->media_path+"/";
     119      fileName.append((char *)xmlGetProp(cur_node, (xmlChar *)"model"));
    119120      fp = NULL;
    120       fp = fopen(fileName.append((char *)xmlGetProp(
    121                                      cur_node, (xmlChar *)"model")).c_str(),"rb");
     121      fp = fopen(fileName.c_str(),"rb");
    122122      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"));
    129127        object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
    130128      } 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());
    133130      }
    134131    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"cylinder")) {
     
    154151                       
    155152      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"));
    160155      object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
    161156    }
Note: See TracChangeset for help on using the changeset viewer.