Changeset 10052 in orxonox.OLD for branches/mount_points
- Timestamp:
- Dec 13, 2006, 12:22:11 AM (18 years ago)
- Location:
- branches/mount_points/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/lib/graphics/importer/oif/object_information_file.cc
r10051 r10052 21 21 22 22 23 23 24 /** 24 25 * standard constructor 26 */ 27 ObjectInformationFile::ObjectInformationFile() 28 { 29 } 30 31 /** 32 * constructor 25 33 * @todo this constructor is not jet implemented - do it 26 34 */ 27 ObjectInformationFile::ObjectInformationFile( )35 ObjectInformationFile::ObjectInformationFile(const std::string& fileName) 28 36 { 29 this->data = ResourceOIF("adsf").data; 37 // load the oif file 38 this->data = ResourceOIF(fileName).data; 30 39 31 40 } -
branches/mount_points/src/lib/graphics/importer/oif/object_information_file.h
r10051 r10052 7 7 #define _OBJECT_INFORMATION_FILE_H 8 8 9 #include " vertex_array_model.h"9 #include "base_object.h" 10 10 11 11 #include "count_pointer.h" … … 29 29 30 30 //! A class for object informations 31 class ObjectInformationFile : public VertexArrayModel31 class ObjectInformationFile : BaseObject 32 32 { 33 33 34 34 public: 35 35 ObjectInformationFile(); 36 ObjectInformationFile(const std::string& fileName); 36 37 virtual ~ObjectInformationFile(); 37 38 -
branches/mount_points/src/lib/graphics/importer/oif/resource_oif.cc
r10051 r10052 7 7 8 8 9 ResourceOIF::ResourceOIF(const std::string& modelName, const Resources::KeepLevel& keepLevel)9 ResourceOIF::ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel) 10 10 : Resource(&ResourceOIF::type) 11 11 { 12 Resources::StorePointer* ptr = this->acquireResource( loadString(modelName));12 Resources::StorePointer* ptr = this->acquireResource(fileName); 13 13 14 14 if (ptr) 15 15 { 16 PRINTF(0)("FOUND OIF: %s\n", modelName.c_str());16 PRINTF(0)("FOUND OIF: %s\n", fileName.c_str()); 17 17 //this->acquireData(static_cast<ResourceOIF::OIFResourcePointer*>(ptr)->ptr()); 18 18 } 19 19 else 20 20 { 21 PRINTF(0)("NOT FOUND OIF: %s\n", modelName.c_str());21 PRINTF(0)("NOT FOUND OIF: %s\n", fileName.c_str()); 22 22 // std::string modelFileName = this->Resource::locateFile(modelName); 23 23 // //std::string skinFileName = this->Resource::locateFile(skinName); … … 31 31 { 32 32 SubString loadValues(loadString, ','); 33 std::string modelName; 34 std::string skinName; 35 float scale = 1.0f; 33 std::string fileName; 36 34 if (loadValues.size() > 0) 37 modelName = loadValues[0]; 38 if (loadValues.size() > 1) 39 skinName = loadValues[1]; 40 if (loadValues.size() > 2) 41 scale = MultiType(loadValues[2]).getFloat(); 35 fileName = loadValues[0]; 42 36 43 return ResourceOIF( modelName);37 return ResourceOIF(fileName); 44 38 } 45 39 46 std::string ResourceOIF::loadString(const std::string& modelName)47 {48 return modelName;49 }50 40 51 41 -
branches/mount_points/src/lib/graphics/importer/oif/resource_oif.h
r10051 r10052 15 15 { 16 16 public: 17 ResourceOIF(const std::string& modelName, 18 const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 17 ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 19 18 static ResourceOIF createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); 20 static std::string loadString(const std::string& modelName); 19 21 20 22 21 private: -
branches/mount_points/src/world_entities/world_entity.cc
r10013 r10052 24 24 #include "md2/md2Model.h" 25 25 #include "md3/md3_model.h" 26 #include "oif/object_information_file.h" 26 27 27 28 #include "aabb_tree_node.h" … … 191 192 { 192 193 PRINTF(4)("fetching OBJ file: %s\n", fileName.c_str()); 194 // creating the model and loading it 193 195 StaticModel* model = new StaticModel(); 194 196 *model = ResourceOBJ(fileName, this->scaling); … … 201 203 else 202 204 delete model; 205 206 // now get the object information file for this model, if any 207 std::string oifName = fileName.substr(0, fileName.length() - 3) + ".oif"; 208 this->loadObjectInformationFile( oifName); 203 209 } 204 210 /// LOADING AN MD2-model … … 246 252 247 253 this->models[modelNumber] = model; 254 } 255 256 257 258 /** 259 * loads the object information file for this model 260 * @param fileName the name of the file 261 */ 262 void WorldEntity::loadObjectInformationFile(const std::string& fileName) 263 { 264 PRINTF(0)("loading the oif File: %s", fileName.c_str()); 248 265 } 249 266 -
branches/mount_points/src/world_entities/world_entity.h
r10013 r10052 32 32 class AABBTreeNode; 33 33 class Model; 34 class ObjectInformationFile; 34 35 35 36 … … 49 50 void setModel(Model* model, unsigned int modelNumber = 0); 50 51 Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; }; 52 53 void loadObjectInformationFile(const std::string& fileName); 51 54 52 55 inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; } … … 185 188 186 189 std::vector<Model*> models; //!< The model that should be loaded for this entity. 190 ObjectInformationFile* oiFile; //!< Reference to the object information file discribing the model of this WE 187 191 std::string md2TextureFileName; //!< the file name of the md2 model texture, only if this 188 192 std::string modelLODName; //!< the name of the model lod file
Note: See TracChangeset
for help on using the changeset viewer.