1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00
OpenMW/apps/openmw/mwrender/objects.hpp

72 lines
1.8 KiB
C++
Raw Normal View History

#ifndef GAME_RENDER_OBJECTS_H
#define GAME_RENDER_OBJECTS_H
2011-11-12 15:58:22 -05:00
2013-02-06 21:47:09 -08:00
#include <OgreAxisAlignedBox.h>
#include <components/resource/resourcesystem.hpp>
#include <osg/ref_ptr>
namespace osg
{
class Group;
}
namespace MWWorld
{
class Ptr;
class CellStore;
}
2011-10-31 23:59:16 -04:00
namespace MWRender{
class Animation;
class Objects{
typedef std::map<MWWorld::Ptr,Animation*> PtrAnimationMap;
typedef std::map<const MWWorld::CellStore*, osg::ref_ptr<osg::Group> > CellMap;
CellMap mCellSceneNodes;
PtrAnimationMap mObjects;
osg::ref_ptr<osg::Group> mRootNode;
2013-08-07 03:51:57 -07:00
void insertBegin(const MWWorld::Ptr& ptr);
Resource::ResourceSystem* mResourceSystem;
2013-11-20 00:07:26 +01:00
2011-10-31 23:59:16 -04:00
public:
Objects(Resource::ResourceSystem* resourceSystem, osg::ref_ptr<osg::Group> rootNode);
~Objects();
/// @param animated Attempt to load separate keyframes from a .kf file matching the model file?
/// @param allowLight If false, no lights will be created, and particles systems will be removed.
void insertModel(const MWWorld::Ptr& ptr, const std::string &model, bool animated=false, bool allowLight=true);
void insertNPC(const MWWorld::Ptr& ptr);
void insertCreature (const MWWorld::Ptr& ptr, const std::string& model, bool weaponsShields);
Animation* getAnimation(const MWWorld::Ptr &ptr);
void update (float dt, Ogre::Camera* camera);
2012-04-19 20:59:57 +02: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(const MWWorld::CellStore* store);
2012-07-30 23:28:14 +04:00
2012-07-31 16:52:21 +04:00
/// Updates containing cell for object rendering data
void updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur);
private:
void operator = (const Objects&);
Objects(const Objects&);
2011-10-31 23:59:16 -04:00
};
2011-11-12 15:58:22 -05:00
}
#endif