Changeset 8369 in orxonox.OLD for trunk/src/lib/graphics/importer/objModel.cc
- Timestamp:
- Jun 14, 2006, 11:04:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/objModel.cc
r7677 r8369 28 28 29 29 /** 30 * Crates a 3D-Model, loads in a File and scales it.30 * @brief Crates a 3D-Model, loads in a File and scales it. 31 31 * @param fileName file to parse and load (must be a .obj file) 32 32 * @param scaling The factor that the model will be scaled with. … … 47 47 48 48 /** 49 * deletes an OBJModel. 50 51 Looks if any from model allocated space is still in use, and if so deleted it. 52 */ 49 * @brief deletes an OBJModel. 50 */ 53 51 OBJModel::~OBJModel() 54 52 { } … … 86 84 87 85 /** 88 * Reads in the .obj File and sets all the Values. 89 This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks 90 */ 86 * @brief Reads in the .obj File and sets all the Values. 87 * @param fileName the FileName of the Model. 88 * 89 * This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks 90 */ 91 91 bool OBJModel::readFromObjFile(const std::string& fileName) 92 92 { … … 153 153 154 154 /** 155 * Function to read in a mtl File.155 * @brief Function to read in a mtl File. 156 156 * @param mtlFile The .mtl file to read 157 157 * … … 191 191 { 192 192 if (likely(tmpMat != NULL)) 193 tmpMat->setIllum(buffer+6);193 setIllum(tmpMat, buffer+6); 194 194 195 195 } … … 198 198 { 199 199 if (likely(tmpMat != NULL)) 200 tmpMat->setDiffuse(buffer+3);200 setDiffuse(tmpMat, buffer+3); 201 201 } 202 202 // setting Ambient Color … … 204 204 { 205 205 if (likely(tmpMat != NULL)) 206 tmpMat->setAmbient(buffer+3);206 setAmbient(tmpMat, buffer+3); 207 207 } 208 208 // setting Specular Color … … 210 210 { 211 211 if (likely(tmpMat != NULL)) 212 tmpMat->setSpecular(buffer+3);212 setSpecular(tmpMat, buffer+3); 213 213 } 214 214 // setting The Specular Shininess … … 216 216 { 217 217 if (likely(tmpMat != NULL)) 218 tmpMat->setShininess(buffer+3);218 setShininess(tmpMat, buffer+3); 219 219 } 220 220 // setting up transparency … … 222 222 { 223 223 if (likely(tmpMat != NULL)) 224 tmpMat->setTransparency(buffer+2);224 setTransparency(tmpMat, buffer+2); 225 225 } 226 226 else if (!strncmp(buffer, "Tf ", 3)) 227 227 { 228 228 if (likely(tmpMat != NULL)) 229 tmpMat->setTransparency(buffer+3);229 setTransparency(tmpMat, buffer+3); 230 230 } 231 231 … … 256 256 return true; 257 257 } 258 259 260 /** 261 * @brief Sets the Material Illumination Model. 262 * @param material: the Material to apply the change to. 263 * @param illu: illumination Model in char* form 264 */ 265 void OBJModel::setIllum (Material* material, const char* illum) 266 { 267 material->setIllum (atoi(illum)); 268 } 269 270 /** 271 * @brief Sets the Material Diffuse Color. 272 * @param material: the Material to apply the change to. 273 * @param rgb The red, green, blue channel in char format (with spaces between them) 274 */ 275 void OBJModel::setDiffuse (Material* material, const char* rgb) 276 { 277 float r,g,b; 278 sscanf (rgb, "%f %f %f", &r, &g, &b); 279 material->setDiffuse (r, g, b); 280 } 281 282 /** 283 * @brief Sets the Material Ambient Color. 284 * @param material: the Material to apply the change to. 285 * @param rgb The red, green, blue channel in char format (with spaces between them) 286 */ 287 void OBJModel::setAmbient (Material* material, const char* rgb) 288 { 289 float r,g,b; 290 sscanf (rgb, "%f %f %f", &r, &g, &b); 291 material->setAmbient (r, g, b); 292 } 293 294 /** 295 * @brief Sets the Material Specular Color. 296 * @param material: the Material to apply the change to. 297 * @param rgb The red, green, blue channel in char format (with spaces between them) 298 */ 299 void OBJModel::setSpecular (Material* material, const char* rgb) 300 { 301 float r,g,b; 302 sscanf (rgb, "%f %f %f", &r, &g, &b); 303 material->setSpecular (r, g, b); 304 } 305 306 /** 307 * @brief Sets the Material Shininess. 308 * @param material: the Material to apply the change to. 309 * @param shini stes the Shininess from char*. 310 */ 311 void OBJModel::setShininess (Material* material, const char* shini) 312 { 313 material->setShininess (atof(shini)); 314 } 315 316 /** 317 * @brief Sets the Material Transparency. 318 * @param material: the Material to apply the change to. 319 * @param trans stes the Transparency from char*. 320 */ 321 void OBJModel::setTransparency (Material* material, const char* trans) 322 { 323 material->setTransparency (atof(trans)); 324 }
Note: See TracChangeset
for help on using the changeset viewer.