1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwworld/physicssystem.hpp

65 lines
2.0 KiB
C++
Raw Normal View History

2011-08-01 13:55:36 +00:00
#ifndef GAME_MWWORLD_PHYSICSSYSTEM_H
#define GAME_MWWORLD_PHYSICSSYSTEM_H
#include <vector>
#include <openengine/ogre/renderer.hpp>
#include <openengine/bullet/physic.hpp>
2011-11-11 19:37:42 +00:00
#include "ptr.hpp"
2011-08-01 13:55:36 +00:00
namespace MWWorld
{
class PhysicsSystem
{
public:
PhysicsSystem (OEngine::Render::OgreRenderer &_rend);
2011-08-01 13:55:36 +00:00
~PhysicsSystem ();
2011-08-22 19:34:51 +00:00
2011-08-02 16:44:10 +00:00
std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration,
2011-08-01 13:55:36 +00:00
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
void addObject (const std::string& handle, const std::string& mesh,
const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
void addActor (const std::string& handle, const std::string& mesh,
const Ogre::Vector3& position);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
void removeObject (const std::string& handle);
2011-08-22 19:34:51 +00:00
2011-09-04 07:48:50 +00:00
void moveObject (const std::string& handle, const Ogre::Vector3& position);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
void rotateObject (const std::string& handle, const Ogre::Quaternion& rotation);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
void scaleObject (const std::string& handle, float scale);
2011-08-22 19:34:51 +00:00
2011-08-01 13:55:36 +00:00
bool toggleCollisionMode();
std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
2012-03-25 18:52:56 +00:00
btVector3 getRayPoint(float extent);
std::vector < std::pair <float, std::string> > getFacedObjects ();
// cast ray, return true if it hit something
bool castRay(const Ogre::Vector3& from, const Ogre::Vector3& to);
2011-08-22 19:34:51 +00:00
2011-11-18 00:38:52 +00:00
void insertObjectPhysics(const MWWorld::Ptr& ptr, std::string model);
void insertActorPhysics(const MWWorld::Ptr&, std::string model);
OEngine::Physic::PhysicEngine* getEngine();
2011-08-01 13:55:36 +00:00
private:
OEngine::Render::OgreRenderer &mRender;
OEngine::Physic::PhysicEngine* mEngine;
bool mFreeFly;
2012-04-03 02:08:46 +00:00
2011-08-22 19:34:51 +00:00
PhysicsSystem (const PhysicsSystem&);
PhysicsSystem& operator= (const PhysicsSystem&);
2011-08-01 13:55:36 +00:00
};
}
#endif