2014-10-17 19:16:48 +00:00
|
|
|
#ifndef CSV_WORLD_PHYSICSSYSTEM_H
|
|
|
|
#define CSV_WORLD_PHYSICSSYSTEM_H
|
|
|
|
|
|
|
|
#include <map>
|
2014-10-22 19:59:14 +00:00
|
|
|
#include <vector>
|
2014-10-17 19:16:48 +00:00
|
|
|
|
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector3;
|
|
|
|
class Quaternion;
|
|
|
|
class SceneManager;
|
2014-10-21 20:11:04 +00:00
|
|
|
class Camera;
|
2014-10-17 19:16:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace OEngine
|
|
|
|
{
|
|
|
|
namespace Physic
|
|
|
|
{
|
|
|
|
class PhysicEngine;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSVWorld
|
|
|
|
{
|
|
|
|
class PhysicsSystem
|
|
|
|
{
|
|
|
|
std::map<std::string, std::string> handleToMesh;
|
|
|
|
OEngine::Physic::PhysicEngine* mEngine;
|
2014-10-22 19:59:14 +00:00
|
|
|
Ogre::SceneManager *mSceneMgr;
|
|
|
|
std::map<std::string, std::vector<std::string>> mSelectedEntities;
|
2014-10-17 19:16:48 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PhysicsSystem(Ogre::SceneManager *sceneMgr);
|
|
|
|
~PhysicsSystem();
|
|
|
|
|
|
|
|
void addObject(const std::string &mesh,
|
|
|
|
const std::string &name,
|
|
|
|
float scale,
|
|
|
|
const Ogre::Vector3 &position,
|
|
|
|
const Ogre::Quaternion &rotation,
|
2014-10-21 20:11:04 +00:00
|
|
|
//Ogre::Vector3* scaledBoxTranslation = 0,
|
|
|
|
//Ogre::Quaternion* boxRotation = 0,
|
|
|
|
//bool raycasting=false,
|
2014-10-17 19:16:48 +00:00
|
|
|
bool placeable=false);
|
|
|
|
|
|
|
|
void toggleDebugRendering();
|
2014-10-21 20:11:04 +00:00
|
|
|
|
|
|
|
/*std::pair<bool, Ogre::Vector3>*/ void castRay(float mouseX, float mouseY,
|
|
|
|
Ogre::Vector3* normal, std::string* hit, Ogre::Camera *camera);
|
2014-10-17 19:16:48 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CSV_WORLD_PHYSICSSYSTEM_H
|