From 843a0288c3464ed9359a4e255c6b64112af0179a Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 25 Jan 2011 17:56:49 +0100 Subject: [PATCH 1/2] added more physics interface to MWScene --- apps/openmw/mwrender/mwscene.cpp | 32 ++++++++++++++++++++++++++++++++ apps/openmw/mwrender/mwscene.hpp | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index aacda6be5..b8022b6c2 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -107,3 +107,35 @@ void MWScene::setMovement (const std::vector& actors { } + +void MWScene::addObject (const std::string& handle, const std::string& mesh, + const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position) +{ + +} + +void MWScene::addActor (const std::string& handle, const std::string& mesh, + const Ogre::Vector3& position) +{ + +} + +void MWScene::removeObject (const std::string& handle) +{ + +} + +void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& position) +{ + +} + +void MWScene::rotateObject (const std::string& handle, const Ogre::Quaternion& rotation) +{ + +} + +void MWScene::scaleObject (const std::string& handle, float scale) +{ + +} diff --git a/apps/openmw/mwrender/mwscene.hpp b/apps/openmw/mwrender/mwscene.hpp index 9c698c95b..77d3a4641 100644 --- a/apps/openmw/mwrender/mwscene.hpp +++ b/apps/openmw/mwrender/mwscene.hpp @@ -4,6 +4,8 @@ #include #include +#include + namespace Ogre { class Camera; @@ -11,6 +13,8 @@ namespace Ogre class SceneManager; class SceneNode; class RaySceneQuery; + class Quaternion; + class Vector3; } namespace MWWorld @@ -61,6 +65,26 @@ namespace MWRender /// Inform phyiscs system about desired velocity vectors for actors /// (in Morrowind coordinates). void setMovement (const std::vector& actors); + + /// Add object to physics system. + void addObject (const std::string& handle, const std::string& mesh, + const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position); + + /// Add actor to physics system. + void addActor (const std::string& handle, const std::string& mesh, + const Ogre::Vector3& position); + + /// Remove object from physic systems. + void removeObject (const std::string& handle); + + /// Move object. + void moveObject (const std::string& handle, const Ogre::Vector3& position); + + /// Change object's orientation. + void rotateObject (const std::string& handle, const Ogre::Quaternion& rotation); + + // Change object's scale. + void scaleObject (const std::string& handle, float scale); }; } From ec88aee5812294cf53633cef16472c44ce9a0ac7 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 25 Jan 2011 18:12:13 +0100 Subject: [PATCH 2/2] added a missing function --- apps/openmw/mwrender/mwscene.cpp | 5 +++++ apps/openmw/mwrender/mwscene.hpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index b8022b6c2..92d0fbac5 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -139,3 +139,8 @@ void MWScene::scaleObject (const std::string& handle, float scale) { } + +void MWScene::setCollsionMode (bool enabled) +{ + +} diff --git a/apps/openmw/mwrender/mwscene.hpp b/apps/openmw/mwrender/mwscene.hpp index 77d3a4641..e408738af 100644 --- a/apps/openmw/mwrender/mwscene.hpp +++ b/apps/openmw/mwrender/mwscene.hpp @@ -83,8 +83,12 @@ namespace MWRender /// Change object's orientation. void rotateObject (const std::string& handle, const Ogre::Quaternion& rotation); - // Change object's scale. + /// Change object's scale. void scaleObject (const std::string& handle, float scale); + + /// Set collision mode for player. If disabled player object should ignore + /// collisions and gravity. + void setCollsionMode (bool enabled); }; }