1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
openmw-tes3mp/apps/openmw/mwrender/objects.hpp

71 lines
1.8 KiB
C++

#ifndef GAME_RENDER_OBJECTS_H
#define GAME_RENDER_OBJECTS_H
#include <OgreAxisAlignedBox.h>
#include <components/resource/resourcesystem.hpp>
#include <osg/ref_ptr>
namespace osg
{
class Group;
}
namespace MWWorld
{
class Ptr;
class CellStore;
}
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;
void insertBegin(const MWWorld::Ptr& ptr);
Resource::ResourceSystem* mResourceSystem;
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 cleared then frozen.
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);
///< 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);
/// 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&);
};
}
#endif