Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2010, 2:29:27 PM (14 years ago)
Author:
kolibri7
Message:

implemented the XMLPort for additional lod information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lod/src/orxonox/graphics/Model.cc

    r6828 r6838  
    2929#include "Model.h"
    3030
    31 #include <OGRE/OgreEntity.h>
     31// What's this? With the directory in front the filename, my compiler can't find the file...
     32//#include <OGRE/OgreEntity.h>
     33#include <OgreEntity.h>
    3234
    3335#include "core/CoreIncludes.h"
     
    3537#include "core/XMLPort.h"
    3638#include "Scene.h"
     39#include "graphics/MeshLodInformation.h"
     40#include "Level.h"
    3741
    3842namespace orxonox
     
    5862    {
    5963        SUPER(Model, XMLPort, xmlelement, mode);
    60                
    61                 //LoD
     64       
     65        //LoD
    6266        XMLPortParam(Model, "lodLevel", setLodLevel, getLodLevel, xmlelement, mode).defaultValues(5);
    63                
     67       
    6468        XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    6569        XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     
    98102                    if(scale3d.z>scaleFactor)
    99103                        scaleFactor = scale3d.z;
    100 
     104                   
     105                    Level* level_ = this->getLevel();
     106                   
     107                    MeshLodInformation* lodInfo = level_->getLodInfo(this->meshSrc_);
     108                    if(lodInfo!=0)
     109                        setLodLevel(lodInfo->getLodLevel());
     110                   
    101111                    COUT(0) << this->meshSrc_<< " lodLevel_: " << this->lodLevel_ <<" scale: "<< scaleFactor << std::endl;
    102112                    //Fuer Asteroiden perfekt
Note: See TracChangeset for help on using the changeset viewer.