2014-01-05 17:22:29 +00:00
|
|
|
#ifndef GAME_RENDER_OBJECTS_H
|
|
|
|
#define GAME_RENDER_OBJECTS_H
|
2011-11-12 20:58:22 +00:00
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
#include <OgreColourValue.h>
|
2013-02-07 05:47:09 +00:00
|
|
|
#include <OgreAxisAlignedBox.h>
|
2012-07-03 11:55:53 +00:00
|
|
|
|
2012-02-06 09:29:18 +00:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
class CellStore;
|
|
|
|
}
|
2011-11-01 03:59:16 +00:00
|
|
|
|
|
|
|
namespace MWRender{
|
2011-11-08 04:35:39 +00:00
|
|
|
|
2013-08-07 02:45:07 +00:00
|
|
|
class ObjectAnimation;
|
|
|
|
|
2011-11-01 03:59:16 +00:00
|
|
|
class Objects{
|
2013-08-07 02:45:07 +00:00
|
|
|
typedef std::map<MWWorld::Ptr,ObjectAnimation*> PtrAnimationMap;
|
|
|
|
|
2012-02-06 09:41:13 +00:00
|
|
|
OEngine::Render::OgreRenderer &mRenderer;
|
2013-08-07 02:45:07 +00:00
|
|
|
|
|
|
|
std::map<MWWorld::CellStore*,Ogre::SceneNode*> mCellSceneNodes;
|
|
|
|
std::map<MWWorld::CellStore*,Ogre::StaticGeometry*> mStaticGeometry;
|
|
|
|
std::map<MWWorld::CellStore*,Ogre::StaticGeometry*> mStaticGeometrySmall;
|
|
|
|
std::map<MWWorld::CellStore*,Ogre::AxisAlignedBox> mBounds;
|
|
|
|
PtrAnimationMap mObjects;
|
|
|
|
|
2013-02-26 13:01:10 +00:00
|
|
|
Ogre::SceneNode* mRootNode;
|
2013-08-07 10:02:27 +00:00
|
|
|
|
2011-11-05 01:57:39 +00:00
|
|
|
static int uniqueID;
|
2013-08-07 02:45:07 +00:00
|
|
|
|
2013-08-07 10:51:57 +00:00
|
|
|
void insertBegin(const MWWorld::Ptr& ptr);
|
|
|
|
|
2013-11-19 23:07:26 +00:00
|
|
|
|
|
|
|
|
2011-11-01 03:59:16 +00:00
|
|
|
public:
|
2013-08-07 08:31:01 +00:00
|
|
|
Objects(OEngine::Render::OgreRenderer &renderer)
|
|
|
|
: mRenderer(renderer)
|
2013-07-31 16:46:32 +00:00
|
|
|
, mRootNode(NULL)
|
|
|
|
{}
|
2011-11-01 03:59:16 +00:00
|
|
|
~Objects(){}
|
2013-08-07 10:51:57 +00:00
|
|
|
void insertModel(const MWWorld::Ptr& ptr, const std::string &model);
|
2011-11-21 11:52:28 +00:00
|
|
|
|
2013-11-17 22:15:57 +00:00
|
|
|
ObjectAnimation* getAnimation(const MWWorld::Ptr &ptr);
|
|
|
|
|
2012-04-02 17:37:24 +00:00
|
|
|
void enableLights();
|
|
|
|
void disableLights();
|
|
|
|
|
2013-12-26 17:16:28 +00:00
|
|
|
void update (float dt, Ogre::Camera* camera);
|
2012-04-19 18:59:57 +00:00
|
|
|
///< per-frame update
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
Ogre::AxisAlignedBox getDimensions(MWWorld::CellStore*);
|
2012-03-10 14:28:18 +00:00
|
|
|
///< get a bounding box that encloses all objects in the specified cell
|
|
|
|
|
2011-11-21 11:52:28 +00:00
|
|
|
bool deleteObject (const MWWorld::Ptr& ptr);
|
|
|
|
///< \return found?
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
void removeCell(MWWorld::CellStore* store);
|
|
|
|
void buildStaticGeometry(MWWorld::CellStore &cell);
|
2013-02-26 13:01:10 +00:00
|
|
|
void setRootNode(Ogre::SceneNode* root);
|
2012-07-11 00:31:03 +00:00
|
|
|
|
|
|
|
void rebuildStaticGeometry();
|
2012-07-30 19:28:14 +00:00
|
|
|
|
2012-07-31 12:52:21 +00:00
|
|
|
/// Updates containing cell for object rendering data
|
2013-02-24 10:59:21 +00:00
|
|
|
void updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur);
|
2011-11-01 03:59:16 +00:00
|
|
|
};
|
2011-11-12 20:58:22 +00:00
|
|
|
}
|
2011-11-21 11:52:28 +00:00
|
|
|
#endif
|