2015-02-23 20:06:10 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_NIFOSG_LOADER
|
|
|
|
#define OPENMW_COMPONENTS_NIFOSG_LOADER
|
|
|
|
|
|
|
|
#include <components/nif/niffile.hpp>
|
|
|
|
|
2015-03-23 15:17:40 +00:00
|
|
|
#include <osg/ref_ptr>
|
2015-04-02 15:34:44 +00:00
|
|
|
|
2022-10-09 10:39:43 +00:00
|
|
|
namespace SceneUtil
|
|
|
|
{
|
|
|
|
class KeyframeHolder;
|
|
|
|
}
|
|
|
|
|
2015-02-23 20:06:10 +00:00
|
|
|
namespace osg
|
|
|
|
{
|
2015-03-23 00:57:03 +00:00
|
|
|
class Node;
|
2015-02-23 20:06:10 +00:00
|
|
|
}
|
|
|
|
|
2015-03-28 01:20:20 +00:00
|
|
|
namespace Resource
|
|
|
|
{
|
2016-02-05 22:03:53 +00:00
|
|
|
class ImageManager;
|
2015-03-28 01:20:20 +00:00
|
|
|
}
|
|
|
|
|
2015-02-23 20:06:10 +00:00
|
|
|
namespace NifOsg
|
|
|
|
{
|
|
|
|
/// The main class responsible for loading NIF files into an OSG-Scenegraph.
|
2015-03-23 16:49:06 +00:00
|
|
|
/// @par This scene graph is self-contained and can be cloned using osg::clone if desired. Particle emitters
|
|
|
|
/// and programs hold a pointer to their ParticleSystem, which would need to be manually updated when cloning.
|
2015-02-23 20:06:10 +00:00
|
|
|
class Loader
|
|
|
|
{
|
|
|
|
public:
|
2015-04-22 17:16:49 +00:00
|
|
|
/// Create a scene graph for the given NIF. Auto-detects when skinning is used and wraps the graph in a Skeleton
|
|
|
|
/// if so.
|
2022-09-18 12:12:49 +00:00
|
|
|
static osg::ref_ptr<osg::Node> load(Nif::FileView file, Resource::ImageManager* imageManager);
|
2015-03-23 00:31:16 +00:00
|
|
|
|
2015-04-02 15:34:44 +00:00
|
|
|
/// Load keyframe controllers from the given kf file.
|
2022-09-18 12:12:49 +00:00
|
|
|
static void loadKf(Nif::FileView kf, SceneUtil::KeyframeHolder& target);
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2015-03-23 00:57:03 +00:00
|
|
|
/// Set whether or not nodes marked as "MRK" should be shown.
|
2015-06-05 00:06:13 +00:00
|
|
|
/// These should be hidden ingame, but visible in the editor.
|
2015-03-23 00:57:03 +00:00
|
|
|
/// Default: false.
|
|
|
|
static void setShowMarkers(bool show);
|
|
|
|
|
2015-04-02 15:34:44 +00:00
|
|
|
static bool getShowMarkers();
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2020-04-22 11:34:19 +00:00
|
|
|
/// Set the mask to use for hidden nodes. The default is 0, i.e. updates to those nodes can no longer happen.
|
|
|
|
/// If you need to run animations or physics for hidden nodes, you may want to set this to a non-zero mask and
|
|
|
|
/// remove exactly that mask from the camera's cull mask.
|
|
|
|
static void setHiddenNodeMask(unsigned int mask);
|
|
|
|
static unsigned int getHiddenNodeMask();
|
2015-02-23 20:06:10 +00:00
|
|
|
|
2020-04-29 13:20:03 +00:00
|
|
|
// Set the mask to use for nodes that ignore the crosshair intersection. The default is the default node mask.
|
|
|
|
// This is used for NiCollisionSwitch nodes with NiCollisionSwitch state set to disabled.
|
|
|
|
static void setIntersectionDisabledNodeMask(unsigned int mask);
|
|
|
|
static unsigned int getIntersectionDisabledNodeMask();
|
|
|
|
|
2020-04-22 11:34:19 +00:00
|
|
|
private:
|
|
|
|
static unsigned int sHiddenNodeMask;
|
2020-04-29 13:20:03 +00:00
|
|
|
static unsigned int sIntersectionDisabledNodeMask;
|
2015-03-23 00:57:03 +00:00
|
|
|
static bool sShowMarkers;
|
2015-02-23 20:06:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|