[Orxonox-commit 6489] r11129 - in code/branches/ogre1.9/src: libraries/util modules/objects modules/overlays modules/overlays/hud modules/overlays/stats orxonox orxonox/controllers orxonox/graphics orxonox/overlays orxonox/worldentities
landauf at orxonox.net
landauf at orxonox.net
Sun Mar 6 15:32:27 CET 2016
Author: landauf
Date: 2016-03-06 15:32:26 +0100 (Sun, 06 Mar 2016)
New Revision: 11129
Modified:
code/branches/ogre1.9/src/libraries/util/DisplayStringConversions.h
code/branches/ogre1.9/src/libraries/util/OgreForwardRefs.h
code/branches/ogre1.9/src/modules/objects/Planet.cc
code/branches/ogre1.9/src/modules/objects/Planet.h
code/branches/ogre1.9/src/modules/overlays/FadeoutText.cc
code/branches/ogre1.9/src/modules/overlays/OverlayText.cc
code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.cc
code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.h
code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.cc
code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.h
code/branches/ogre1.9/src/modules/overlays/hud/HUDNavigation.cc
code/branches/ogre1.9/src/modules/overlays/hud/HUDRadar.cc
code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.cc
code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.h
code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.cc
code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h
code/branches/ogre1.9/src/modules/overlays/stats/Stats.cc
code/branches/ogre1.9/src/orxonox/RenderQueueListener.cc
code/branches/ogre1.9/src/orxonox/controllers/NewHumanController.cc
code/branches/ogre1.9/src/orxonox/graphics/Camera.cc
code/branches/ogre1.9/src/orxonox/graphics/Model.cc
code/branches/ogre1.9/src/orxonox/graphics/Model.h
code/branches/ogre1.9/src/orxonox/overlays/InGameConsole.cc
code/branches/ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc
code/branches/ogre1.9/src/orxonox/worldentities/WorldEntity.cc
Log:
orxonox now compiles with ogre 1.9 (but still needs some other changes)
Modified: code/branches/ogre1.9/src/libraries/util/DisplayStringConversions.h
===================================================================
--- code/branches/ogre1.9/src/libraries/util/DisplayStringConversions.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/libraries/util/DisplayStringConversions.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -36,7 +36,12 @@
#define _DisplayStringConversions_H__
#include "UtilPrereqs.h"
-#include <OgreOverlayElement.h>
+#include <OgrePrerequisites.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayElement.h>
+#else
+# include <OgreOverlayElement.h>
+#endif
#if OGRE_UNICODE_SUPPORT
#include <OgreUTFString.h>
Modified: code/branches/ogre1.9/src/libraries/util/OgreForwardRefs.h
===================================================================
--- code/branches/ogre1.9/src/libraries/util/OgreForwardRefs.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/libraries/util/OgreForwardRefs.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -66,13 +66,11 @@
class ExternalTextureSourceManager;
class Factory;
class Font;
- class FontPtr;
class FontManager;
struct FrameEvent;
class FrameListener;
class Frustum;
class GpuProgram;
- class GpuProgramPtr;
class GpuProgramManager;
class GpuProgramUsage;
class HardwareIndexBuffer;
@@ -81,7 +79,6 @@
class HardwarePixelBuffer;
class HardwarePixelBufferSharedPtr;
class HighLevelGpuProgram;
- class HighLevelGpuProgramPtr;
class HighLevelGpuProgramManager;
class HighLevelGpuProgramFactory;
class IndexData;
@@ -95,7 +92,6 @@
class ManualResourceLoader;
class ManualObject;
class Material;
- class MaterialPtr;
class MaterialManager;
class MaterialScriptCompiler;
class Math;
@@ -103,7 +99,6 @@
class Matrix4;
class MemoryManager;
class Mesh;
- class MeshPtr;
class MeshSerializer;
class MeshSerializerImpl;
class MeshManager;
@@ -178,7 +173,6 @@
class SimpleRenderable;
class SimpleSpline;
class Skeleton;
- class SkeletonPtr;
class SkeletonInstance;
class SkeletonManager;
class Sphere;
@@ -194,7 +188,6 @@
class ExternalTextureSource;
class TextureUnitState;
class Texture;
- class TexturePtr;
class TextureFont;
class TextureManager;
class TransformKeyFrame;
Modified: code/branches/ogre1.9/src/modules/objects/Planet.cc
===================================================================
--- code/branches/ogre1.9/src/modules/objects/Planet.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/objects/Planet.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -30,7 +30,6 @@
#include <OgreEntity.h>
#include <OgreBillboardSet.h>
-#include <OgreProgressiveMesh.h>
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
Modified: code/branches/ogre1.9/src/modules/objects/Planet.h
===================================================================
--- code/branches/ogre1.9/src/modules/objects/Planet.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/objects/Planet.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -39,7 +39,6 @@
#include <string>
#include "tools/BillboardSet.h"
-#include "tools/Mesh.h"
#include "tools/interfaces/Tickable.h"
#include "graphics/Model.h"
Modified: code/branches/ogre1.9/src/modules/overlays/FadeoutText.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/FadeoutText.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/FadeoutText.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -28,7 +28,11 @@
#include "FadeoutText.h"
-#include <OgreTextAreaOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreTextAreaOverlayElement.h>
+#else
+# include <OgreTextAreaOverlayElement.h>
+#endif
#include "util/Math.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
Modified: code/branches/ogre1.9/src/modules/overlays/OverlayText.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/OverlayText.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/OverlayText.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -28,9 +28,15 @@
#include "OverlayText.h"
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
-#include <OgreTextAreaOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+# include <Overlay/OgreTextAreaOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+# include <OgreTextAreaOverlayElement.h>
+#endif
#include "util/StringUtils.h"
#include "core/CoreIncludes.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -29,8 +29,13 @@
#include "ChatOverlay.h"
#include <string>
-#include <OgreTextAreaOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreTextAreaOverlayElement.h>
+#else
+# include <OgreTextAreaOverlayElement.h>
+#endif
+
#include "util/Convert.h"
#include "util/DisplayStringConversions.h"
#include "core/CoreIncludes.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.h
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/ChatOverlay.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -32,8 +32,14 @@
#include "overlays/OverlaysPrereqs.h"
#include <list>
-#include <OgreOverlayElement.h>
+#include <OgrePrerequisites.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayElement.h>
+#else
+# include <OgreOverlayElement.h>
+#endif
+
#include "chat/ChatListener.h"
#include "overlays/OverlayText.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -31,12 +31,18 @@
#include "HUDBar.h"
-#include <OgreOverlayManager.h>
#include <OgreMaterialManager.h>
#include <OgreTechnique.h>
#include <OgrePass.h>
-#include <OgrePanelOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+#endif
+
#include "util/Convert.h"
#include "util/StringUtils.h"
#include "core/CoreIncludes.h"
@@ -247,4 +253,14 @@
{
return this->icon_->getMaterialName();
}
+
+ void HUDBar::setIconPosition(Vector2 position)
+ {
+ this->icon_->setPosition(position.x, position.y);
+ }
+
+ void HUDBar::setIconDimensions(Vector2 dimensions)
+ {
+ this->icon_->setDimensions(dimensions.x, dimensions.y);
+ }
}
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.h
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDBar.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -36,7 +36,6 @@
#include <map>
#include <vector>
-#include <OgrePanelOverlayElement.h>
#include "util/Math.h"
#include "util/OgreForwardRefs.h"
@@ -121,10 +120,8 @@
inline const ColourValue& getCurrentBarColour() const
{ return this->currentColour_; }
- inline void setIconPosition(Vector2 position)
- { this->icon_->setPosition(position.x, position.y); }
- inline void setIconDimensions(Vector2 dimensions)
- { this->icon_->setDimensions(dimensions.x, dimensions.y); }
+ void setIconPosition(Vector2 position);
+ void setIconDimensions(Vector2 dimensions);
protected:
virtual void valueChanged();
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDNavigation.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDNavigation.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -31,11 +31,19 @@
#include "HUDNavigation.h"
#include <OgreCamera.h>
-#include <OgreFontManager.h>
-#include <OgreOverlayManager.h>
-#include <OgreTextAreaOverlayElement.h>
-#include <OgrePanelOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreFontManager.h>
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgreTextAreaOverlayElement.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreFontManager.h>
+# include <OgreOverlayManager.h>
+# include <OgreTextAreaOverlayElement.h>
+# include <OgrePanelOverlayElement.h>
+#endif
+
#include <typeinfo>
#include "util/Math.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDRadar.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDRadar.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -30,8 +30,13 @@
#include "HUDRadar.h"
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+#endif
#include "util/Math.h"
#include "util/StringUtils.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -28,6 +28,14 @@
#include "HUDWeapon.h"
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+#endif
+
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "util/Convert.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.h
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDWeapon.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -35,9 +35,6 @@
#include <vector>
#include <string>
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
-
#include "overlays/OrxonoxOverlay.h"
#include "tools/interfaces/Tickable.h"
#include "worldentities/pawns/Pawn.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -28,6 +28,14 @@
#include "HUDWeaponMode.h"
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+#endif
+
#include "util/Convert.h"
#include "util/StringUtils.h"
#include "core/CoreIncludes.h"
Modified: code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/hud/HUDWeaponMode.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -36,9 +36,6 @@
#include <vector>
#include <string>
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
-
#include "overlays/OrxonoxOverlay.h"
#include "overlays/OverlayText.h"
#include "tools/interfaces/Tickable.h"
Modified: code/branches/ogre1.9/src/modules/overlays/stats/Stats.cc
===================================================================
--- code/branches/ogre1.9/src/modules/overlays/stats/Stats.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/modules/overlays/stats/Stats.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -29,9 +29,15 @@
#include "Stats.h"
#include <string>
-#include <OgreOverlayManager.h>
-#include <OgreBorderPanelOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgreBorderPanelOverlayElement.h>
+#else
+# include <OgreOverlayManager.h>
+# include <OgreBorderPanelOverlayElement.h>
+#endif
+
#include "util/StringUtils.h"
#include "core/CoreIncludes.h"
#include "core/config/ConfigValueIncludes.h"
Modified: code/branches/ogre1.9/src/orxonox/RenderQueueListener.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/RenderQueueListener.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/RenderQueueListener.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -82,6 +82,9 @@
renderSystem->setStencilCheckEnabled(true);
renderSystem->setStencilBufferParams(Ogre::CMPF_ALWAYS_PASS,
STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK,
+#if OGRE_VERSION >= 0x010900
+ STENCIL_FULL_MASK,
+#endif
Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);
}
if (queueGroupId == RENDER_QUEUE_STENCIL_GLOW)
@@ -90,6 +93,9 @@
renderSystem->setStencilCheckEnabled(true);
renderSystem->setStencilBufferParams(Ogre::CMPF_NOT_EQUAL,
STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK,
+#if OGRE_VERSION >= 0x010900
+ STENCIL_FULL_MASK,
+#endif
Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);
}
if (queueGroupId == RENDER_QUEUE_HOQ && this->pixelState_==PixelState::READY_FOR_RENDER)
@@ -120,4 +126,4 @@
this->pixelState_=PixelState::READY_FOR_ACCESS;
}
}
-}
\ No newline at end of file
+}
Modified: code/branches/ogre1.9/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/controllers/NewHumanController.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/controllers/NewHumanController.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -396,7 +396,12 @@
WorldEntity* wePtr;
try
{
- wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
+#if OGRE_VERSION >= 0x010900
+ const Ogre::Any& any = itr->movable->getUserObjectBindings().getUserAny();
+#else
+ const Ogre::Any& any = itr->movable->getUserAny();
+#endif
+ wePtr = orxonox_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(any));
}
catch (...)
{
Modified: code/branches/ogre1.9/src/orxonox/graphics/Camera.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/graphics/Camera.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/graphics/Camera.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -61,7 +61,12 @@
ThrowException(AbortLoading, "Can't create Camera, no root-scene-node given.");
this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
- static_cast<Ogre::MovableObject*>(this->camera_)->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
+ Ogre::MovableObject* movable = static_cast<Ogre::MovableObject*>(this->camera_);
+#if OGRE_VERSION >= 0x010900
+ movable->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
+#else
+ movable->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
+#endif
this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
this->attachNode(this->cameraNode_);
this->cameraNode_->attachObject(this->camera_);
Modified: code/branches/ogre1.9/src/orxonox/graphics/Model.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/graphics/Model.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/graphics/Model.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -29,7 +29,12 @@
#include "Model.h"
#include <OgreEntity.h>
-#include <OgreProgressiveMesh.h>
+#if OGRE_VERSION >= 0x010900
+# include <OgreProgressiveMeshGenerator.h>
+# include <OgreDistanceLodStrategy.h>
+#else
+# include <OgreProgressiveMesh.h>
+#endif
#include "core/CoreIncludes.h"
#include "core/config/ConfigValueIncludes.h"
@@ -195,21 +200,11 @@
if( this->bLodEnabled_ )
{
float volume = this->mesh_.getEntity()->getBoundingBox().volume();
-/*
- float scaleFactor = 1;
-
- BaseObject* creatorPtr = this;
-
- while(creatorPtr!=nullptr&&orxonox_cast<WorldEntity*>(creatorPtr))
- {
- scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D());
- creatorPtr = creatorPtr->getCreator();
- }
- orxout() << "name: " << this->meshSrc_ << "scaleFactor: " << scaleFactor << ", volume: " << volume << endl;
-*/
orxout(verbose, context::lod) << "Setting lodLevel for " << this->meshSrc_<< " with lodLevel_: " << this->lodLevel_ <<" and volume: "<< volume << ":" << endl;
-#if OGRE_VERSION >= 0x010800
+#if OGRE_VERSION >= 0x010900
+ Ogre::LodConfig::LodLevelList distList;
+#elif OGRE_VERSION >= 0x010800
Ogre::ProgressiveMesh::LodValueList distList;
#elif OGRE_VERSION >= 0x010700
Ogre::Mesh::LodValueList distList;
@@ -219,27 +214,34 @@
if( lodLevel_>0 )
{
-// float factor = scaleFactor*5/lodLevel_;
float factor = pow(volume, 2.0f / 3.0f) * 15.0f / lodLevel_;
orxout(verbose, context::lod) << "LodLevel set with factor: " << factor << endl;
- distList.push_back(70.0f*factor);
- distList.push_back(140.0f*factor);
- distList.push_back(170.0f*factor);
- distList.push_back(200.0f*factor);
- distList.push_back(230.0f*factor);
- distList.push_back(250.0f*factor);
- distList.push_back(270.0f*factor);
- distList.push_back(290.0f*factor);
- distList.push_back(310.0f*factor);
- distList.push_back(330.0f*factor);
+ addLodDistanceToList(distList, 70.0f*factor);
+ addLodDistanceToList(distList, 140.0f*factor);
+ addLodDistanceToList(distList, 170.0f*factor);
+ addLodDistanceToList(distList, 200.0f*factor);
+ addLodDistanceToList(distList, 230.0f*factor);
+ addLodDistanceToList(distList, 250.0f*factor);
+ addLodDistanceToList(distList, 270.0f*factor);
+ addLodDistanceToList(distList, 290.0f*factor);
+ addLodDistanceToList(distList, 310.0f*factor);
+ addLodDistanceToList(distList, 330.0f*factor);
while(distList.size()>this->numLodLevels_)
distList.pop_back();
//Generiert LOD-Levels
-#if OGRE_VERSION >= 0x010800
+#if OGRE_VERSION >= 0x010900
+ Ogre::LodConfig config;
+ config.mesh = this->mesh_.getEntity()->getMesh();
+ config.levels = distList;
+ config.strategy = Ogre::DistanceLodSphereStrategy::getSingletonPtr();
+
+ Ogre::ProgressiveMeshGenerator generator;
+ generator.generateLodLevels(config);
+#elif OGRE_VERSION >= 0x010800
Ogre::ProgressiveMesh::generateLodLevels(this->mesh_.getEntity()->getMesh().get(), distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL,
this->lodReductionRate_);
#else
@@ -262,4 +264,14 @@
}
#endif
}
+
+ template <class T>
+ void Model::addLodDistanceToList(T& list, float distance)
+ {
+#if OGRE_VERSION >= 0x010900
+ list.push_back({distance, Ogre::LodLevel::VRM_COLLAPSE_COST, this->lodReductionRate_, 0, false});
+#else
+ list.push_back(distance);
+#endif
+ }
}
Modified: code/branches/ogre1.9/src/orxonox/graphics/Model.h
===================================================================
--- code/branches/ogre1.9/src/orxonox/graphics/Model.h 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/graphics/Model.h 2016-03-06 14:32:26 UTC (rev 11129)
@@ -113,6 +113,9 @@
//LoD
void enableLod();
+ template <class T>
+ void addLodDistanceToList(T& list, float distance);
+
inline void setLodLevel(float lodLevel)
{ this->lodLevel_ = lodLevel; }
inline float getLodLevel() const
Modified: code/branches/ogre1.9/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/overlays/InGameConsole.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/overlays/InGameConsole.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -31,14 +31,26 @@
#include <algorithm>
#include <string>
-#include <OgreOverlay.h>
-#include <OgreOverlayElement.h>
-#include <OgreOverlayManager.h>
-#include <OgreOverlayContainer.h>
-#include <OgreBorderPanelOverlayElement.h>
-#include <OgreTextAreaOverlayElement.h>
-#include <OgreFontManager.h>
-#include <OgreFont.h>
+#include <OgrePrerequisites.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlay.h>
+# include <Overlay/OgreOverlayElement.h>
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgreOverlayContainer.h>
+# include <Overlay/OgreBorderPanelOverlayElement.h>
+# include <Overlay/OgreTextAreaOverlayElement.h>
+# include <Overlay/OgreFontManager.h>
+# include <Overlay/OgreFont.h>
+#else
+# include <OgreOverlay.h>
+# include <OgreOverlayElement.h>
+# include <OgreOverlayManager.h>
+# include <OgreOverlayContainer.h>
+# include <OgreBorderPanelOverlayElement.h>
+# include <OgreTextAreaOverlayElement.h>
+# include <OgreFontManager.h>
+# include <OgreFont.h>
+#endif
#include "util/Clock.h"
#include "util/Convert.h"
Modified: code/branches/ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/overlays/OrxonoxOverlay.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -34,9 +34,15 @@
#include "OrxonoxOverlay.h"
#include <cmath>
-#include <OgreOverlay.h>
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
+#if OGRE_VERSION >= 0x010900
+# include <Overlay/OgreOverlay.h>
+# include <Overlay/OgreOverlayManager.h>
+# include <Overlay/OgrePanelOverlayElement.h>
+#else
+# include <OgreOverlay.h>
+# include <OgreOverlayManager.h>
+# include <OgrePanelOverlayElement.h>
+#endif
#include <OgreRenderWindow.h>
#include <OgreMaterialManager.h>
#include <OgreTechnique.h>
Modified: code/branches/ogre1.9/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/ogre1.9/src/orxonox/worldentities/WorldEntity.cc 2016-03-06 12:56:26 UTC (rev 11128)
+++ code/branches/ogre1.9/src/orxonox/worldentities/WorldEntity.cc 2016-03-06 14:32:26 UTC (rev 11129)
@@ -547,7 +547,11 @@
void WorldEntity::attachOgreObject(Ogre::MovableObject* object)
{
this->node_->attachObject(object);
+#if OGRE_VERSION >= 0x010900
+ object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
+#else
object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(this)));
+#endif
}
void WorldEntity::attachOgreObject(Ogre::BillboardSet* object)
@@ -562,7 +566,11 @@
//! Detaches an Ogre::MovableObject from this WorldEntity.
void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
{
+#if OGRE_VERSION >= 0x010900
+ object->getUserObjectBindings().setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr)));
+#else
object->setUserAny(Ogre::Any(static_cast<OrxonoxClass*>(nullptr)));
+#endif
this->node_->detachObject(object);
}
More information about the Orxonox-commit
mailing list