Changeset 3658 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Mar 27, 2005, 7:44:39 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/Makefile.am
r3657 r3658 33 33 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 34 34 $(MAINSRCDIR)/lib/lang/base_object.cc \ 35 $(MAINSRCDIR)/lib/math/vector.cc 35 $(MAINSRCDIR)/lib/math/vector.cc \ 36 $(MAINSRCDIR)/lib/util/resource_manager.cc 36 37 37 38 noinst_HEADERS= framework.h \ -
orxonox/trunk/src/lib/graphics/importer/Makefile.in
r3657 r3658 57 57 array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \ 58 58 graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \ 59 vector.$(OBJEXT) 59 vector.$(OBJEXT) resource_manager.$(OBJEXT) 60 60 importer_OBJECTS = $(am_importer_OBJECTS) 61 61 importer_LDADD = $(LDADD) … … 70 70 @AMDEP_TRUE@ ./$(DEPDIR)/objModel.Po \ 71 71 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ 72 @AMDEP_TRUE@ ./$(DEPDIR)/resource_manager.Po \ 72 73 @AMDEP_TRUE@ ./$(DEPDIR)/texture.Po ./$(DEPDIR)/vector.Po \ 73 74 @AMDEP_TRUE@ ./$(DEPDIR)/windowHandler.Po … … 204 205 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 205 206 $(MAINSRCDIR)/lib/lang/base_object.cc \ 206 $(MAINSRCDIR)/lib/math/vector.cc 207 $(MAINSRCDIR)/lib/math/vector.cc \ 208 $(MAINSRCDIR)/lib/util/resource_manager.cc 207 209 208 210 noinst_HEADERS = framework.h \ … … 289 291 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@ 290 292 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ 293 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@ 291 294 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 292 295 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ … … 356 359 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 357 360 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi` 361 362 resource_manager.o: $(MAINSRCDIR)/lib/util/resource_manager.cc 363 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/resource_manager.cc; \ 364 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@ 366 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 367 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 368 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/resource_manager.cc 369 370 resource_manager.obj: $(MAINSRCDIR)/lib/util/resource_manager.cc 371 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/resource_manager.cc'; fi`; \ 372 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 373 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@ 374 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 375 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 376 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/resource_manager.cc'; fi` 358 377 uninstall-info-am: 359 378 -
orxonox/trunk/src/lib/graphics/importer/material.cc
r3655 r3658 21 21 #include "texture.h" 22 22 #include "debug.h" 23 #include "resource_manager.h" 23 24 #include <stdlib.h> 24 25 #include <string.h> … … 61 62 delete []this->name; 62 63 if (this->diffuseTexture) 63 this->diffuseTexture;64 ResourceManager::unload(this->diffuseTexture); 64 65 if (this->nextMat) 65 66 delete this->nextMat; … … 92 93 this->nextMat = NULL; 93 94 this->name =""; 94 this->setIllum( 1);95 this->setIllum(3); 95 96 this->setDiffuse(0,0,0); 96 97 this->setAmbient(0,0,0); … … 168 169 } 169 170 170 171 171 /** 172 172 \brief Set the Name of the Material. (Important for searching) … … 322 322 void Material::addTexturePath(char* pathName) 323 323 { 324 PathList::getInstance()->addPath(pathName);324 ResourceManager::getInstance()->addImageDir(pathName); 325 325 } 326 326 … … 334 334 { 335 335 PRINTF(4)("setting Diffuse Map %s\n", dMap); 336 diffuseTexture = new Texture();337 this->diffuseTextureSet = diffuseTexture->loadImage(dMap);336 // diffuseTexture = new Texture(); 337 // this->diffuseTextureSet = diffuseTexture->loadImage(dMap); 338 338 339 339 //! \todo check if RESOURCE MANAGER is availiable 340 //this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::load(dMap, IMAGE); 340 //! \todo Textures from .mtl-file need special care. 341 this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::load(dMap, IMAGE); 341 342 } 342 343 -
orxonox/trunk/src/lib/graphics/importer/objModel.cc
r3655 r3658 185 185 delete []fileName; 186 186 return true; 187 188 187 } 189 188 -
orxonox/trunk/src/lib/graphics/importer/primitive_model.cc
r3657 r3658 24 24 using namespace std; 25 25 26 27 /**28 \brief standard constructor29 \todo this constructor is not jet implemented - do it30 */31 PrimitiveModel::PrimitiveModel ()32 {33 this->initialize();34 35 this->cubeModel();36 37 this->importToGL ();38 39 this->cleanup();40 }41 42 26 /** 43 27 \brief Creates a 3D-Model of Primitive-Type type … … 75 59 } 76 60 77 78 61 /** 79 62 \brief standard deconstructor … … 83 66 { 84 67 // delete what has to be deleted here 85 }86 87 88 89 90 /**91 \brief Includes a default model92 93 This will inject a Cube, because this is the most basic model.94 */95 void PrimitiveModel::cubeModel(void)96 {97 this->addVertex (-0.5, -0.5, 0.5);98 this->addVertex (0.5, -0.5, 0.5);99 this->addVertex (-0.5, 0.5, 0.5);100 this->addVertex (0.5, 0.5, 0.5);101 this->addVertex (-0.5, 0.5, -0.5);102 this->addVertex (0.5, 0.5, -0.5);103 this->addVertex (-0.5, -0.5, -0.5);104 this->addVertex (0.5, -0.5, -0.5);105 106 this->addVertexTexture (0.0, 0.0);107 this->addVertexTexture (1.0, 0.0);108 this->addVertexTexture (0.0, 1.0);109 this->addVertexTexture (1.0, 1.0);110 this->addVertexTexture (0.0, 2.0);111 this->addVertexTexture (1.0, 2.0);112 this->addVertexTexture (0.0, 3.0);113 this->addVertexTexture (1.0, 3.0);114 this->addVertexTexture (0.0, 4.0);115 this->addVertexTexture (1.0, 4.0);116 this->addVertexTexture (2.0, 0.0);117 this->addVertexTexture (2.0, 1.0);118 this->addVertexTexture (-1.0, 0.0);119 this->addVertexTexture (-1.0, 1.0);120 121 this->addVertexNormal (0.0, 0.0, 1.0);122 this->addVertexNormal (0.0, 0.0, 1.0);123 this->addVertexNormal (0.0, 0.0, 1.0);124 this->addVertexNormal (0.0, 0.0, 1.0);125 this->addVertexNormal (0.0, 1.0, 0.0);126 this->addVertexNormal (0.0, 1.0, 0.0);127 this->addVertexNormal (0.0, 1.0, 0.0);128 this->addVertexNormal (0.0, 1.0, 0.0);129 this->addVertexNormal (0.0, 0.0, -1.0);130 this->addVertexNormal (0.0, 0.0, -1.0);131 this->addVertexNormal (0.0, 0.0, -1.0);132 this->addVertexNormal (0.0, 0.0, -1.0);133 this->addVertexNormal (0.0, -1.0, 0.0);134 this->addVertexNormal (0.0, -1.0, 0.0);135 this->addVertexNormal (0.0, -1.0, 0.0);136 this->addVertexNormal (0.0, -1.0, 0.0);137 this->addVertexNormal (1.0, 0.0, 0.0);138 this->addVertexNormal (1.0, 0.0, 0.0);139 this->addVertexNormal (1.0, 0.0, 0.0);140 this->addVertexNormal (1.0, 0.0, 0.0);141 this->addVertexNormal (-1.0, 0.0, 0.0);142 this->addVertexNormal (-1.0, 0.0, 0.0);143 this->addVertexNormal (-1.0, 0.0, 0.0);144 this->addVertexNormal (-1.0, 0.0, 0.0);145 146 /* normaleLess-testingMode147 this->addFace ("1 2 4 3");148 this->addFace ("3 4 6 5");149 this->addFace ("5 6 8 7");150 this->addFace ("7 8 2 1");151 this->addFace ("2 8 6 4");152 this->addFace ("7 1 3 5");153 */154 155 this->addFace (4, 3, 1,1,1, 2,2,2, 4,4,3, 3,3,4);156 this->addFace (4, 3, 3,3,5, 4,4,6, 6,6,7, 5,5,8);157 this->addFace (4, 3, 5,5,9, 6,6,10, 8,8,11, 7,7,12);158 this->addFace (4, 3, 7,7,13, 8,8,14, 2,10,15, 1,9,16);159 this->addFace (4, 3, 2,2,17, 8,11,18, 6,12,19, 4,4,20);160 this->addFace (4, 3, 7,13,21, 1,1,22, 3,3,23, 5,14,24);161 162 68 } 163 69 … … 247 153 this->addVertex(0, 0, size); 248 154 249 250 155 if (count != detail) 251 156 PRINTF(1)("calculation error, count should be %d but is %d.\n", detail, count); -
orxonox/trunk/src/lib/graphics/importer/primitive_model.h
r3657 r3658 1 1 /*! 2 \file primitive_model.h 3 2 \file primitive_model.h 3 \brief a Class to handle different simple models like planes cubes spheres and so on. 4 (cube is also an option of Model, but is extended here. 4 5 */ 5 6 … … 10 11 11 12 //! Specification of different primitives the Model knows 12 enum PRIMITIVE { PLANE, CUBE, SPHERE, CYLINDER, CONE};13 enum PRIMITIVE {CUBE, SPHERE, PLANE, CYLINDER, CONE}; 13 14 14 15 // FORWARD DEFINITION \\ … … 18 19 19 20 public: 20 PrimitiveModel();21 21 PrimitiveModel(PRIMITIVE type, float size = 1.0, unsigned int detail = 10); 22 23 22 virtual ~PrimitiveModel(); 24 23 25 24 protected: 26 void cubeModel(void);27 25 void sphereModel(float size = 1.0, unsigned int detail = 10); 28 26 void cylinderModel(float size = 1.0, unsigned int detail = 10);
Note: See TracChangeset
for help on using the changeset viewer.