Changeset 10714 in orxonox.OLD for branches/presentation/src/lib
- Timestamp:
- Jun 18, 2007, 3:19:15 PM (18 years ago)
- Location:
- branches/presentation/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/importer/static_model.cc
r10551 r10714 82 82 void StaticModel::finalize() 83 83 { 84 this->extractMountPoints(); 84 85 data->finalize(); 85 86 this->updateBase(); … … 100 101 void StaticModel::extractMountPoints() 101 102 { 102 103 printf("extracting MP..."); 103 104 // go through all groups and check if they are mounts 104 std::vector<StaticModelData::Group>:: const_iterator groupIt = this->data->getGroups().begin();105 for( ; groupIt != this->data->getGroups().end(); groupIt++)105 std::vector<StaticModelData::Group>::iterator groupIt = this->data->getGroups().begin(); 106 for( ; groupIt != this->data->getGroups().end();) 106 107 { 107 108 //PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str()); … … 112 113 113 114 // check if the name has a "MP" prefix or else it won't work 114 if( groupName.find("MP.", 0) == std::string::npos) 115 if( groupName.find("MP.", 0) == std::string::npos){ 116 groupIt++; 117 // printf("Found MP: "); 115 118 continue; 116 119 } 117 120 118 121 PRINTF(5)("Found a MountPoint: %s\n", groupName.c_str()); … … 125 128 PRINTF(4)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n", 126 129 groupName.c_str(), (*groupIt)._faces.size()); 130 // printf("wrong number of faces\n\n"); 131 groupIt++; 132 continue; 127 133 } 128 134 … … 137 143 } 138 144 145 // printf("confirmed "); 139 146 140 147 Vector center; … … 143 150 Vector zAxis; 144 151 // now process all points 152 // printf("entering loop: "); 145 153 for( int i = 0; i < 3; i++) 146 154 { 155 // printf("%i ", i); 147 156 // convert the float vertices to vectors 148 157 Vector a( this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3], 149 158 this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 1], 150 159 this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 2]); 160 // printf("a"); 151 161 Vector b( this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3], 152 162 this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 1], 153 163 this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 2]); 164 // printf("b"); 154 165 Vector c( this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3], 155 166 this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 1], 156 167 this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 2]); 168 // printf("c "); 157 169 158 170 Vector ab = a - b; … … 208 220 } 209 221 222 // printf("adding MP\n"); 210 223 // now add the mount point 211 224 this->addMountPoint( zAxis, yAxis, center, groupName); 225 226 // printf("removing item..."); 227 // remove the group from the model list (mount points do not need to be drawn) 228 // std::vector<StaticModelData::Group>::iterator tmpIt = groupIt; 229 groupIt++; 230 // printf(" removing..."); 231 // this->data->getGroups().erase(tmpIt); 232 // printf(" REMOVED\n"); 212 233 } 234 // printf("done\n"); 213 235 } 214 236 -
branches/presentation/src/lib/graphics/importer/static_model_data.h
r10161 r10714 129 129 ///! HACK SOLUTION sTriangleExt should be const in the modelInfo. 130 130 sTriangleExt* getTrianglesExt() { return &this->triangles[0]; }; 131 conststd::vector<Group>& getGroups() { return this->_modelGroups; }131 std::vector<Group>& getGroups() { return this->_modelGroups; } 132 132 133 133 float getScaleFactor() const { return scaleFactor; }
Note: See TracChangeset
for help on using the changeset viewer.