1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 13:19:54 +00:00
openmw-tes3mp/apps/opencs/view/world/physicssystem.hpp

69 lines
1.8 KiB
C++
Raw Normal View History

#ifndef CSV_WORLD_PHYSICSSYSTEM_H
#define CSV_WORLD_PHYSICSSYSTEM_H
2014-10-23 07:51:31 +00:00
#include <string>
#include <map>
#include <vector>
namespace Ogre
{
class Vector3;
class Quaternion;
class SceneManager;
class Camera;
}
namespace OEngine
{
namespace Physic
{
class PhysicEngine;
}
}
namespace CSVWorld
{
class PhysicsSystem
{
2014-10-24 09:14:02 +00:00
static PhysicsSystem *mPhysicsSystemInstance;
std::map<std::string, std::string> mRefToSceneNode;
OEngine::Physic::PhysicEngine* mEngine;
2014-10-26 19:50:51 +00:00
Ogre::SceneManager *mSceneMgr;
2014-10-23 07:51:31 +00:00
std::map<std::string, std::vector<std::string> > mSelectedEntities;
public:
2014-10-24 09:14:02 +00:00
PhysicsSystem(Ogre::SceneManager *sceneMgr = NULL);
~PhysicsSystem();
2014-10-24 09:14:02 +00:00
static PhysicsSystem *instance();
void setSceneManager(Ogre::SceneManager *sceneMgr);
2014-10-26 19:50:51 +00:00
void addObject(const std::string &mesh, const std::string &name,
const std::string &referenceId, float scale,
const Ogre::Vector3 &position, const Ogre::Quaternion &rotation,
bool placeable=false);
2014-10-23 04:35:01 +00:00
void removeObject(const std::string &name);
void addHeightField(float* heights, int x, int y, float yoffset,
2014-10-26 19:50:51 +00:00
float triSize, float sqrtVerts);
void removeHeightField(int x, int y);
void toggleDebugRendering();
std::pair<std::string, Ogre::Vector3> castRay(float mouseX, float mouseY,
Ogre::Vector3* normal, std::string* hit, Ogre::Camera *camera);
2014-10-26 19:50:51 +00:00
private:
void initDebug();
void updateSelectionHighlight(std::string sceneNode, const Ogre::Vector3 &position);
};
}
#endif // CSV_WORLD_PHYSICSSYSTEM_H