1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwrender/objects.hpp

71 lines
1.7 KiB
C++
Raw Normal View History

#ifndef GAME_RENDER_OBJECTS_H
#define GAME_RENDER_OBJECTS_H
2011-11-12 20:58:22 +00:00
#include <OgreColourValue.h>
2013-02-07 05:47:09 +00:00
#include <OgreAxisAlignedBox.h>
#include <openengine/ogre/renderer.hpp>
namespace MWWorld
{
class Ptr;
class CellStore;
}
2011-11-01 03:59:16 +00:00
namespace MWRender{
class ObjectAnimation;
2011-11-01 03:59:16 +00:00
class Objects{
typedef std::map<MWWorld::Ptr,ObjectAnimation*> PtrAnimationMap;
2012-02-06 09:41:13 +00:00
OEngine::Render::OgreRenderer &mRenderer;
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 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);
ObjectAnimation* getAnimation(const MWWorld::Ptr &ptr);
2012-04-02 17:37:24 +00:00
void enableLights();
void disableLights();
void update (float dt, Ogre::Camera* camera);
2012-04-19 18:59:57 +00:00
///< per-frame update
Ogre::AxisAlignedBox getDimensions(MWWorld::CellStore*);
///< get a bounding box that encloses all objects in the specified cell
bool deleteObject (const MWWorld::Ptr& ptr);
///< \return found?
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
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
}
#endif