Changeset 9832 in orxonox.OLD for branches/new_class_id/src/lib/graphics/importer/static_model.cc
- Timestamp:
- Sep 26, 2006, 3:44:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/static_model.cc
r9830 r9832 37 37 */ 38 38 StaticModel::StaticModel(const std::string& modelName) 39 : data(new StaticModelData(modelName))39 : data(new StaticModelData(modelName)) 40 40 { 41 41 this->registerObject(this, StaticModel::_objectList); … … 43 43 this->setName(modelName); 44 44 } 45 46 StaticModel::StaticModel(const StaticModel& staticModel) 47 : data(staticModel.data) 48 { 49 this->registerObject(this, StaticModel::_objectList); 50 this->setName(staticModel.getName()); 51 this->updateBase(); 52 } 53 45 54 46 55 /** … … 60 69 } 61 70 71 StaticModel& StaticModel::operator=(const StaticModel& model) 72 { 73 this->data = model.data; 74 this->updateBase(); 75 return *this; 76 }; 77 78 62 79 /** 63 80 * @brief Finalizes an Object. This can be done outside of the Class. … … 66 83 { 67 84 data->finalize(); 85 this->updateBase(); 86 } 68 87 69 // write out the modelInfo data used for the collision detection! 70 this->pModelInfo.pVertices = &this->data->getVertices()[0]; 71 this->pModelInfo.numVertices = this->data->getVertices().size(); 72 this->pModelInfo.pNormals = &this->data->getNormals()[0]; 73 this->pModelInfo.numNormals = this->data->getNormals().size(); 74 this->pModelInfo.pTexCoor = &this->data->getTexCoords()[0]; 75 this->pModelInfo.numTexCoor = this->data->getTexCoords().size(); 76 77 this->pModelInfo.pTriangles = this->data->getTrianglesExt(); 78 this->pModelInfo.numTriangles = this->data->getTriangles().size(); 88 void StaticModel::acquireData(const StaticModelData::Pointer& data) 89 { 90 this->data = data; 91 this->updateBase(); 79 92 } 80 93 … … 92 105 return retVal; 93 106 } 107 108 void StaticModel::updateBase() 109 { 110 // write out the modelInfo data used for the collision detection! 111 this->pModelInfo.pVertices = &this->data->getVertices()[0]; 112 this->pModelInfo.numVertices = this->data->getVertices().size(); 113 this->pModelInfo.pNormals = &this->data->getNormals()[0]; 114 this->pModelInfo.numNormals = this->data->getNormals().size(); 115 this->pModelInfo.pTexCoor = &this->data->getTexCoords()[0]; 116 this->pModelInfo.numTexCoor = this->data->getTexCoords().size(); 117 118 this->pModelInfo.pTriangles = this->data->getTrianglesExt(); 119 this->pModelInfo.numTriangles = this->data->getTriangles().size(); 120 } 121 94 122 95 123 /**
Note: See TracChangeset
for help on using the changeset viewer.