2015-05-12 03:02:15 +02:00
|
|
|
#ifndef OPENMW_COMPONENTS_BULLETSHAPEMANAGER_H
|
|
|
|
#define OPENMW_COMPONENTS_BULLETSHAPEMANAGER_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
2015-11-16 23:30:10 +01:00
|
|
|
#include "bulletshape.hpp"
|
2016-02-06 16:57:54 +01:00
|
|
|
#include "resourcemanager.hpp"
|
2016-02-05 23:59:37 +01:00
|
|
|
|
2015-05-12 16:24:53 +02:00
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
class SceneManager;
|
2015-12-01 23:04:02 +01:00
|
|
|
class NifFileManager;
|
2015-05-12 03:02:15 +02:00
|
|
|
|
|
|
|
class BulletShape;
|
|
|
|
class BulletShapeInstance;
|
|
|
|
|
2016-02-06 00:15:12 +01: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 16:57:54 +01:00
|
|
|
class BulletShapeManager : public ResourceManager
|
2015-05-12 03:02:15 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-12-01 23:04:02 +01:00
|
|
|
BulletShapeManager(const VFS::Manager* vfs, SceneManager* sceneMgr, NifFileManager* nifFileManager);
|
2015-05-12 03:02:15 +02:00
|
|
|
~BulletShapeManager();
|
|
|
|
|
2016-02-06 23:30:41 +01:00
|
|
|
osg::ref_ptr<const BulletShape> getShape(const std::string& name);
|
|
|
|
|
|
|
|
/// Shorthand for getShape(name)->makeInstance();
|
2015-05-12 03:02:15 +02:00
|
|
|
osg::ref_ptr<BulletShapeInstance> createInstance(const std::string& name);
|
|
|
|
|
|
|
|
private:
|
2015-11-17 00:18:27 +01:00
|
|
|
SceneManager* mSceneManager;
|
2015-12-01 23:04:02 +01:00
|
|
|
NifFileManager* mNifFileManager;
|
2015-05-12 03:02:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|