mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-28 14:53:58 +00:00
20da0892ef
Slowly moving through the open-cs errors Good progress in openCS Very good progress on openCS Getting closer with openCS OpenCS compiles and runs! Didn't have time to test it all though ix openMW everything compiles on windows?? Fix gcc Fix Clang
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
#ifndef OPENCS_VIEW_RENDER_ACTOR_H
|
|
#define OPENCS_VIEW_RENDER_ACTOR_H
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
#include <osg/Group>
|
|
#include <osg/ref_ptr>
|
|
|
|
#include <QObject>
|
|
|
|
#include <components/esm3/loadarmo.hpp>
|
|
#include <components/sceneutil/visitor.hpp>
|
|
|
|
#include "../../model/world/actoradapter.hpp"
|
|
|
|
namespace CSMWorld
|
|
{
|
|
class Data;
|
|
}
|
|
|
|
namespace SceneUtil
|
|
{
|
|
class Skeleton;
|
|
}
|
|
|
|
namespace CSVRender
|
|
{
|
|
/// Handles loading an npc or creature
|
|
class Actor : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/// Creates an actor.
|
|
/// \param id The referenceable id
|
|
/// \param type The record type
|
|
/// \param data The data store
|
|
Actor(const ESM::RefId& id, CSMWorld::Data& data);
|
|
|
|
/// Retrieves the base node that meshes are attached to
|
|
osg::Group* getBaseNode();
|
|
|
|
/// (Re)creates the npc or creature renderable
|
|
void update();
|
|
|
|
private slots:
|
|
void handleActorChanged(const ESM::RefId& refId);
|
|
|
|
private:
|
|
void loadSkeleton(const std::string& model);
|
|
void loadBodyParts();
|
|
void attachBodyPart(ESM::PartReferenceType, const std::string& mesh);
|
|
|
|
std::string getBodyPartMesh(std::string_view bodyPartId);
|
|
|
|
static const std::string MeshPrefix;
|
|
|
|
ESM::RefId mId;
|
|
CSMWorld::Data& mData;
|
|
CSMWorld::ActorAdapter::ActorDataPtr mActorData;
|
|
|
|
osg::ref_ptr<osg::Group> mBaseNode;
|
|
SceneUtil::Skeleton* mSkeleton;
|
|
SceneUtil::NodeMapVisitor::NodeMap mNodeMap;
|
|
};
|
|
}
|
|
|
|
#endif
|