Changeset 6828
- Timestamp:
- May 3, 2010, 11:34:44 AM (15 years ago)
- Location:
- code/branches/lod/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lod/src/libraries/core/BaseObject.cc
r6524 r6828 75 75 this->setScene(this->creator_->getScene(), this->creator_->getSceneID()); 76 76 this->setGametype(this->creator_->getGametype()); 77 this->setLevel(this->creator_->getLevel()); 77 78 } 78 79 else … … 83 84 this->sceneID_ = OBJECTID_UNKNOWN; 84 85 this->gametype_ = 0; 86 this->level_ = 0; 85 87 } 86 88 } -
code/branches/lod/src/libraries/core/BaseObject.h
r6524 r6828 51 51 class Scene; 52 52 class Gametype; 53 class Level; 53 54 54 55 //! The BaseObject is the parent of all classes representing an instance in the game. … … 153 154 inline Gametype* getOldGametype() const { return this->oldGametype_; } 154 155 virtual void changedGametype() {} 156 157 inline void setLevel(const SmartPtr<Level>& level) 158 { 159 if (level != this->level_) 160 { 161 this->level_ = level; 162 this->changedLevel(); 163 } 164 } 165 inline const SmartPtr<Level>& getLevel() const { return this->level_; } 166 virtual void changedLevel() {} 155 167 156 168 void addEventSource(BaseObject* source, const std::string& state); … … 210 222 SmartPtr<Gametype> gametype_; 211 223 Gametype* oldGametype_; 224 SmartPtr<Level> level_; 212 225 std::set<Template*> templates_; 213 226 -
code/branches/lod/src/orxonox/Level.cc
r6786 r6828 32 32 #include "core/CoreIncludes.h" 33 33 #include "core/Loader.h" 34 #include "core/ template.h"34 #include "core/Template.h" 35 35 #include "core/XMLFile.h" 36 36 #include "core/XMLPort.h" … … 126 126 this->objects_.push_back(object); 127 127 object->setGametype(this->getGametype()); 128 object->setLevel(this); 128 129 } 129 130 -
code/branches/lod/src/orxonox/graphics/Model.cc
r6794 r6828 29 29 #include "Model.h" 30 30 31 #include <O greEntity.h>31 #include <OGRE/OgreEntity.h> 32 32 33 33 #include "core/CoreIncludes.h" … … 92 92 &&this->lodLevel_!=0) 93 93 { 94 94 Vector3 scale3d = this->getScale3D(); 95 95 float scaleFactor = scale3d.x; 96 97 98 99 100 96 if(scale3d.y>scaleFactor) 97 scaleFactor = scale3d.y; 98 if(scale3d.z>scaleFactor) 99 scaleFactor = scale3d.z; 100 101 101 COUT(0) << this->meshSrc_<< " lodLevel_: " << this->lodLevel_ <<" scale: "<< scaleFactor << std::endl; 102 //F ür Asteroiden perfekt102 //Fuer Asteroiden perfekt 103 103 104 104 #if OGRE_VERSION >= 0x010700 … … 108 108 #endif 109 109 110 111 110 float factor = scaleFactor; 111 COUT(0)<<"scaleFactor:"<<scaleFactor<<std::endl; 112 112 113 113 distList.push_back(70.0f*factor);
Note: See TracChangeset
for help on using the changeset viewer.