Changeset 138 in flair-src for trunk/lib


Ignore:
Timestamp:
Feb 14, 2017, 3:59:41 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

color cylinder

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

Legend:

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

    r134 r138  
    138138          ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length"))),
    139139          atof((char *)xmlGetProp(cur_node, (xmlChar *)"tesselation")),
    140           SColor(100, 255, 100, 100));
     140          getScolor(cur_node->children));
     141          //SColor(100, 255, 100, 100));
    141142      GenericObject *object = new GenericObject(parent, mesh);
    142143      object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position"));
     
    182183  }
    183184}
     185
     186SColor 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
    184199// todo rendre un vector3D framework
    185200// retirer irr::core::vector3df ToIrrlichtCoordinates(irr::core::vector3df
  • trunk/lib/FlairSimulator/src/Parser.h

    r87 r138  
    2121#include <libxml/parser.h>
    2222#include <libxml/tree.h>
     23#include <SColor.h>
    2324
    2425namespace flair {
     
    4950  void processObjects(xmlNode *a_node);
    5051  void processParams(xmlNode *a_node);
     52        irr::video::SColor getScolor(xmlNode *mesh_node);
    5153  irr::core::vector3df getMeshVect(xmlNode *mesh_node, xmlChar *param);
    5254  irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param,
Note: See TracChangeset for help on using the changeset viewer.