2015-05-12 01:02:15 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_BULLETSHAPEMANAGER_H
|
|
|
|
#define OPENMW_COMPONENTS_BULLETSHAPEMANAGER_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
2015-11-16 22:30:10 +00:00
|
|
|
#include "bulletshape.hpp"
|
2016-02-06 15:57:54 +00:00
|
|
|
#include "resourcemanager.hpp"
|
2016-02-05 22:59:37 +00:00
|
|
|
|
2015-05-12 14:24:53 +00:00
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
class SceneManager;
|
2015-12-01 22:04:02 +00:00
|
|
|
class NifFileManager;
|
2015-05-12 01:02:15 +00:00
|
|
|
|
|
|
|
class BulletShape;
|
|
|
|
class BulletShapeInstance;
|
|
|
|
|
2016-02-05 23:15:12 +00:00
|
|
|
/// Handles loading, caching and "instancing" of bullet shapes.
|
|
|
|
/// A shape 'instance' is a clone of another shape, with the goal of setting a different scale on this instance.
|
|
|
|
/// @note May be used from any thread.
|
2016-02-06 15:57:54 +00:00
|
|
|
class BulletShapeManager : public ResourceManager
|
2015-05-12 01:02:15 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-12-01 22:04:02 +00:00
|
|
|
BulletShapeManager(const VFS::Manager* vfs, SceneManager* sceneMgr, NifFileManager* nifFileManager);
|
2015-05-12 01:02:15 +00:00
|
|
|
~BulletShapeManager();
|
|
|
|
|
2016-02-06 22:30:41 +00:00
|
|
|
osg::ref_ptr<const BulletShape> getShape(const std::string& name);
|
|
|
|
|
|
|
|
/// Shorthand for getShape(name)->makeInstance();
|
2015-05-12 01:02:15 +00:00
|
|
|
osg::ref_ptr<BulletShapeInstance> createInstance(const std::string& name);
|
|
|
|
|
|
|
|
private:
|
2015-11-16 23:18:27 +00:00
|
|
|
SceneManager* mSceneManager;
|
2015-12-01 22:04:02 +00:00
|
|
|
NifFileManager* mNifFileManager;
|
2015-05-12 01:02:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|