From ca9224ed7f8813b2eb9bd4cd70e641308c2d4685 Mon Sep 17 00:00:00 2001 From: gugus Date: Mon, 21 May 2012 10:58:04 +0200 Subject: [PATCH] starting scale function --- apps/openmw/mwworld/class.cpp | 5 +++++ apps/openmw/mwworld/class.hpp | 2 ++ apps/openmw/mwworld/world.cpp | 5 +++++ apps/openmw/mwworld/world.hpp | 2 ++ 4 files changed, 14 insertions(+) diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 5fb503847..f1c50c29a 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -196,4 +196,9 @@ namespace MWWorld { return ""; } + + void adjustScale(float& x, float& y, float& z) + { + } + } diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 513dc942b..0fc12bfe2 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -193,6 +193,8 @@ namespace MWWorld virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; ///< @return the enchantment ID if the object is enchanted, otherwise an empty string /// (default implementation: return empty string) + + virtual void adjustScale(float& x, float& y, float& z); }; } diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index eeda92277..fbbeef154 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -611,6 +611,11 @@ namespace MWWorld mPhysics->moveObject (ptr.getRefData().getHandle(), Ogre::Vector3 (x, y, z)); } + void World::scaleObject (Ptr ptr, float x, float y, float z) + { + MWWorld::Class::get(ptr).adjustScale(x,y,z); + } + void World::indexToPosition (int cellX, int cellY, float &x, float &y, bool centre) const { const int cellSize = 8192; diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp index 49a3cf029..cb849cc1b 100644 --- a/apps/openmw/mwworld/world.hpp +++ b/apps/openmw/mwworld/world.hpp @@ -222,6 +222,8 @@ namespace MWWorld void moveObject (Ptr ptr, float x, float y, float z); + void scaleObject (Ptr ptr, float x, float y, float z); + void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false) const; ///< Convert cell numbers to position.