You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3coop/components/nifosg/nifloader.hpp

54 lines
1.7 KiB
C++

#ifndef OPENMW_COMPONENTS_NIFOSG_LOADER
#define OPENMW_COMPONENTS_NIFOSG_LOADER
#include <components/nif/niffile.hpp>
#include <components/nifcache/nifcache.hpp> // NIFFilePtr
#include <components/vfs/manager.hpp>
#include <osg/ref_ptr>
namespace osg
{
class Node;
}
namespace NifOsg
{
10 years ago
typedef std::multimap<float,std::string> TextKeyMap;
/// The main class responsible for loading NIF files into an OSG-Scenegraph.
class Loader
{
public:
10 years ago
// TODO: add auto-detection for skinning. We will still need a "force skeleton" parameter
// though, when assembling from several files, i.e. equipment parts
/// Create a scene graph for the given NIF. Assumes no skinning is used.
/// @param node The parent of the new root node for the created scene graph.
osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr file, TextKeyMap* textKeys = NULL);
10 years ago
/// Create a scene graph for the given NIF. Assumes skinning will be used.
osg::ref_ptr<osg::Node> loadAsSkeleton(Nif::NIFFilePtr file, TextKeyMap* textKeys = NULL);
10 years ago
/// Load keyframe controllers from the given kf file onto the given scene graph.
/// @param sourceIndex The source index for this animation source, used for identifying
/// which animation source a keyframe controller came from.
void loadKf(Nif::NIFFilePtr kf, osg::Node* rootNode, int sourceIndex, TextKeyMap &textKeys);
/// Set whether or not nodes marked as "MRK" should be shown.
/// These should be hidden ingame, but visible in the editior.
/// Default: false.
static void setShowMarkers(bool show);
const VFS::Manager* resourceManager;
private:
static bool sShowMarkers;
};
}
#endif