Changeset 11071 for code/trunk/src/orxonox/graphics
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/graphics/AnimatedModel.h
r9667 r11071 44 44 virtual ~AnimatedModel(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 void registerVariables(); 48 48 … … 51 51 virtual void setAnimEnabled(bool enabled); 52 52 virtual void setAnimLoop(bool loop); 53 virtual void tick(float dt) ;53 virtual void tick(float dt) override; 54 54 virtual void changedMesh(); 55 55 -
code/trunk/src/orxonox/graphics/Backlight.cc
r9667 r11071 51 51 RegisterObject(Backlight); 52 52 53 this->ribbonTrail_ = 0;54 this->ribbonTrailNode_ = 0;53 this->ribbonTrail_ = nullptr; 54 this->ribbonTrailNode_ = nullptr; 55 55 56 56 this->width_ = 0; -
code/trunk/src/orxonox/graphics/Backlight.h
r9667 r11071 44 44 virtual ~Backlight(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 virtual void tick(float dt) ;49 virtual void changedVisibility() ;48 virtual void tick(float dt) override; 49 virtual void changedVisibility() override; 50 50 51 51 inline void setWidth(float width) … … 74 74 { return this->trailmaterial_; } 75 75 76 virtual void changedScale() ;76 virtual void changedScale() override; 77 77 78 78 protected: 79 virtual void changedTimeFactor(float factor_new, float factor_old) ;79 virtual void changedTimeFactor(float factor_new, float factor_old) override; 80 80 81 81 private: 82 82 void registerVariables(); 83 virtual void startturnonoff() ;84 virtual void stopturnonoff() ;85 virtual void poststopturnonoff() ;86 virtual void changedColour() ;83 virtual void startturnonoff() override; 84 virtual void stopturnonoff() override; 85 virtual void poststopturnonoff() override; 86 virtual void changedColour() override; 87 87 void update_width(); 88 88 void update_lifetime(); -
code/trunk/src/orxonox/graphics/Billboard.cc
r9667 r11071 139 139 { 140 140 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 141 if( bSet != NULL)141 if( bSet != nullptr ) 142 142 { 143 143 bSet->setBillboardType(bbt); … … 148 148 { 149 149 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 150 if( bSet != NULL)150 if( bSet != nullptr ) 151 151 { 152 152 bSet->setCommonDirection( vec ); … … 157 157 { 158 158 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 159 if( bSet != NULL)159 if( bSet != nullptr ) 160 160 { 161 161 bSet->setCommonUpVector( vec ); … … 166 166 { 167 167 Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet(); 168 if( bSet != NULL)168 if( bSet != nullptr ) 169 169 { 170 170 bSet->setDefaultDimensions(width, height); -
code/trunk/src/orxonox/graphics/Billboard.h
r9667 r11071 47 47 virtual ~Billboard(); 48 48 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 50 50 51 virtual void changedVisibility() ;51 virtual void changedVisibility() override; 52 52 53 53 inline const BillboardSet& getBillboardSet() const … … 71 71 72 72 73 virtual void setTeamColour(const ColourValue& colour) 73 virtual void setTeamColour(const ColourValue& colour) override 74 74 { this->setColour(colour); } 75 75 -
code/trunk/src/orxonox/graphics/BlinkingBillboard.h
r9667 r11071 44 44 virtual ~BlinkingBillboard(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 virtual void tick(float dt) ;48 virtual void tick(float dt) override; 49 49 50 50 inline void setAmplitude(float amplitude) -
code/trunk/src/orxonox/graphics/Camera.h
r9667 r11071 50 50 51 51 void setConfigValues(); 52 virtual void tick(float dt) ;52 virtual void tick(float dt) override; 53 53 54 54 void requestFocus(); … … 72 72 void configvaluecallback_changedNearClipDistance(); 73 73 74 v oid windowResized(unsigned int newWidth, unsigned int newHeight);74 virtual void windowResized(unsigned int newWidth, unsigned int newHeight) override; 75 75 76 76 Ogre::Camera* camera_; -
code/trunk/src/orxonox/graphics/FadingBillboard.h
r9667 r11071 45 45 virtual ~FadingBillboard(); 46 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 48 49 virtual void tick(float dt) ;50 virtual void changedActivity() ;51 virtual void changedVisibility() ;49 virtual void tick(float dt) override; 50 virtual void changedActivity() override; 51 virtual void changedVisibility() override; 52 52 53 53 inline void setTurnOnTime(float turnontime) … … 69 69 virtual void stopturnonoff(); 70 70 virtual void poststopturnonoff(); 71 virtual void changedColour() ;71 virtual void changedColour() override; 72 72 73 73 float turnontime_; -
code/trunk/src/orxonox/graphics/GlobalShader.h
r9667 r11071 44 44 virtual ~GlobalShader(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 virtual void changedVisibility() ;48 virtual void changedVisibility() override; 49 49 50 50 inline const Shader& getShader() const -
code/trunk/src/orxonox/graphics/Light.cc
r9667 r11071 31 31 #include <OgreSceneManager.h> 32 32 #include <OgreLight.h> 33 #include <boost/static_assert.hpp>34 33 35 34 #include "util/StringUtils.h" … … 45 44 46 45 // Be sure we don't do bad conversions 47 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light::Point);48 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional);49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Spotlight);46 static_assert((int)Ogre::Light::LT_POINT == (int)Light::Type::Point, "check enum"); 47 static_assert((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Type::Directional, "check enum"); 48 static_assert((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Type::Spotlight, "check enum"); 50 49 51 50 Light::Light(Context* context) : StaticEntity(context) … … 53 52 RegisterObject(Light); 54 53 55 this->light_ = 0;54 this->light_ = nullptr; 56 55 this->diffuse_ = ColourValue::White; 57 56 this->specular_ = ColourValue::White; 58 this->type_ = Light::Point;57 this->type_ = Type::Point; 59 58 this->attenuation_ = Vector4(100000, 1, 0, 0); 60 59 this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f); … … 106 105 void Light::registerVariables() 107 106 { 108 registerVariable( (int&)this->type_,VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));107 registerVariable(this->type_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType)); 109 108 registerVariable(this->diffuse_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour)); 110 109 registerVariable(this->specular_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour)); … … 127 126 void Light::updateAttenuation() 128 127 { 129 if (this->light_ && this->type_ != Light::Directional)128 if (this->light_ && this->type_ != Type::Directional) 130 129 this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w); 131 130 } … … 133 132 void Light::updateSpotlightRange() 134 133 { 135 if (this->light_ && this->type_ == Light::Spotlight)134 if (this->light_ && this->type_ == Type::Spotlight) 136 135 this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z); 137 136 } … … 140 139 { 141 140 if (type == "point") 142 this->setType( Light::Point);141 this->setType(Type::Point); 143 142 else if (type == "directional") 144 this->setType( Light::Directional);143 this->setType(Type::Directional); 145 144 else if (type == "spotlight") 146 this->setType( Light::Spotlight);145 this->setType(Type::Spotlight); 147 146 else 148 this->setType( Light::Point);147 this->setType(Type::Point); 149 148 } 150 149 … … 153 152 switch (this->type_) 154 153 { 155 case Light::Directional:154 case Type::Directional: 156 155 return "directional"; 157 case Light::Spotlight:156 case Type::Spotlight: 158 157 return "spotlight"; 159 case Light::Point:158 case Type::Point: 160 159 default: 161 160 return "point"; … … 169 168 this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_)); 170 169 171 if (this->type_ != Light::Directional)170 if (this->type_ != Type::Directional) 172 171 this->updateAttenuation(); 173 if (this->type_ == Light::Spotlight)172 if (this->type_ == Type::Spotlight) 174 173 this->updateSpotlightRange(); 175 174 } -
code/trunk/src/orxonox/graphics/Light.h
r9667 r11071 42 42 { 43 43 public: 44 enum LightTypes// Copy from the Ogre enum44 enum class Type // Copy from the Ogre enum 45 45 { 46 46 /// Point light sources give off light equally in all directions, so require only position not direction … … 56 56 virtual ~Light(); 57 57 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 59 59 60 virtual void changedVisibility() ;60 virtual void changedVisibility() override; 61 61 62 62 inline Ogre::Light* getLight() 63 63 { return this->light_; } 64 64 65 inline void setType(Light:: LightTypestype)65 inline void setType(Light::Type type) 66 66 { this->type_ = type; this->updateType(); } 67 inline Light:: LightTypesgetType() const67 inline Light::Type getType() const 68 68 { return this->type_; } 69 69 … … 78 78 { return this->specular_; } 79 79 80 virtual void setTeamColour(const ColourValue& colour) 80 virtual void setTeamColour(const ColourValue& colour) override 81 81 { this->setDiffuseColour(colour); this->setSpecularColour(colour); } 82 82 … … 144 144 145 145 Ogre::Light* light_; 146 Light Typestype_;146 Light::Type type_; 147 147 ColourValue diffuse_; 148 148 ColourValue specular_; -
code/trunk/src/orxonox/graphics/MeshLodInformation.h
r9667 r11071 50 50 float getReductionRate(){ return this->reductionRate_; } 51 51 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 53 53 54 54 private: -
code/trunk/src/orxonox/graphics/Model.cc
r10728 r11071 134 134 Level* level = this->getLevel(); 135 135 136 assert( level != 0);136 assert( level != nullptr ); 137 137 138 138 MeshLodInformation* lodInfo = level->getLodInfo(this->meshSrc_); … … 157 157 BaseObject* creatorPtr = this; 158 158 159 while(creatorPtr!= NULL&&orxonox_cast<WorldEntity*>(creatorPtr))159 while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr)) 160 160 { 161 161 scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D()); -
code/trunk/src/orxonox/graphics/Model.h
r9667 r11071 46 46 void setConfigValues(); 47 47 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 49 49 50 virtual void changedVisibility() ;50 virtual void changedVisibility() override; 51 51 52 52 inline const Mesh& getMesh() const -
code/trunk/src/orxonox/graphics/ParticleEmitter.cc
r9950 r11071 52 52 ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given."); 53 53 54 this->particles_ = 0;54 this->particles_ = nullptr; 55 55 this->LOD_ = LODParticle::Normal; 56 56 … … 102 102 { 103 103 delete this->particles_; 104 this->particles_ = 0;104 this->particles_ = nullptr; 105 105 } 106 106 -
code/trunk/src/orxonox/graphics/ParticleEmitter.h
r9950 r11071 43 43 virtual ~ParticleEmitter(); 44 44 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 46 46 47 virtual void changedVisibility() ;48 virtual void changedActivity() ;47 virtual void changedVisibility() override; 48 virtual void changedActivity() override; 49 49 50 50 inline ParticleInterface* getParticleInterface() const -
code/trunk/src/orxonox/graphics/ParticleSpawner.h
r9667 r11071 43 43 virtual ~ParticleSpawner(); 44 44 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) ;45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 46 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 48 inline void stop(bool bDestroy)
Note: See TracChangeset
for help on using the changeset viewer.