1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-04 02:41:19 +00:00
OpenMW/apps/opencs/view/render/actor.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.6 KiB
C++
Raw Normal View History

2018-07-14 02:48:59 +00:00
#ifndef OPENCS_VIEW_RENDER_ACTOR_H
#define OPENCS_VIEW_RENDER_ACTOR_H
#include <string>
#include <string_view>
2018-07-14 02:48:59 +00:00
2022-10-19 17:02:00 +00:00
#include <osg/Group>
#include <osg/PositionAttitudeTransform>
2018-07-14 02:48:59 +00:00
#include <osg/ref_ptr>
#include <QObject>
#include <components/esm3/loadarmo.hpp>
#include <components/sceneutil/visitor.hpp>
#include "../../model/world/actoradapter.hpp"
2018-07-14 02:48:59 +00:00
namespace CSMWorld
{
class Data;
}
namespace SceneUtil
{
class Skeleton;
}
namespace CSVRender
{
/// Handles loading an npc or creature
class Actor : public QObject
2018-07-14 02:48:59 +00:00
{
Q_OBJECT
2018-07-14 02:48:59 +00:00
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);
2018-07-14 02:48:59 +00:00
/// 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);
2018-07-14 02:48:59 +00:00
private:
void loadSkeleton(const std::string& model);
2018-09-08 06:06:48 +00:00
void loadBodyParts();
void attachBodyPart(ESM::PartReferenceType, const std::string& mesh);
std::string getBodyPartMesh(const ESM::RefId& bodyPartId);
2018-07-22 20:38:30 +00:00
static const std::string MeshPrefix;
ESM::RefId mId;
2018-07-14 02:48:59 +00:00
CSMWorld::Data& mData;
CSMWorld::ActorAdapter::ActorDataPtr mActorData;
2018-07-14 02:48:59 +00:00
osg::ref_ptr<osg::PositionAttitudeTransform> mBaseNode;
SceneUtil::Skeleton* mSkeleton;
2024-04-11 02:01:00 +00:00
SceneUtil::NodeMap mNodeMap;
2018-07-14 02:48:59 +00:00
};
}
#endif