2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CSKINNEDMODEL_HPP__
|
|
|
|
#define __URDE_CSKINNEDMODEL_HPP__
|
2016-04-05 01:51:25 +00:00
|
|
|
|
|
|
|
#include "CToken.hpp"
|
|
|
|
#include "CModel.hpp"
|
|
|
|
#include "optional.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CModel;
|
|
|
|
class CSkinRules;
|
|
|
|
class CCharLayoutInfo;
|
|
|
|
class CPoseAsTransforms;
|
|
|
|
class CVertexMorphEffect;
|
|
|
|
class IObjectStore;
|
|
|
|
|
|
|
|
class CSkinnedModel
|
|
|
|
{
|
2016-08-21 20:39:18 +00:00
|
|
|
friend class CBooModel;
|
2016-04-05 01:51:25 +00:00
|
|
|
std::unique_ptr<CBooModel> m_modelInst;
|
2016-04-14 21:42:47 +00:00
|
|
|
TLockedToken<CModel> x4_model;
|
|
|
|
TLockedToken<CSkinRules> x10_skinRules;
|
|
|
|
TLockedToken<CCharLayoutInfo> x1c_layoutInfo;
|
2016-04-05 01:51:25 +00:00
|
|
|
public:
|
2016-04-15 03:02:21 +00:00
|
|
|
enum class EDataOwnership
|
|
|
|
{
|
|
|
|
Zero,
|
|
|
|
One
|
|
|
|
};
|
2016-08-21 20:39:18 +00:00
|
|
|
CSkinnedModel(TLockedToken<CModel> model,
|
|
|
|
TLockedToken<CSkinRules> skinRules,
|
|
|
|
TLockedToken<CCharLayoutInfo> layoutInfo,
|
|
|
|
int shaderIdx);
|
2016-04-15 03:02:21 +00:00
|
|
|
CSkinnedModel(IObjectStore& store, ResId model, ResId skinRules,
|
2016-08-21 20:39:18 +00:00
|
|
|
ResId layoutInfo, int shaderIdx);
|
2016-04-14 21:42:47 +00:00
|
|
|
|
2016-08-21 00:04:50 +00:00
|
|
|
TLockedToken<CModel>& GetModel() {return x4_model;}
|
|
|
|
TLockedToken<CSkinRules>& GetSkinRules() {return x10_skinRules;}
|
|
|
|
TLockedToken<CCharLayoutInfo>& GetLayoutInfo() {return x1c_layoutInfo;}
|
2016-04-05 01:51:25 +00:00
|
|
|
|
2016-08-21 20:39:18 +00:00
|
|
|
void Calculate(const CPoseAsTransforms& pose,
|
|
|
|
const CModelFlags& drawFlags,
|
|
|
|
const std::experimental::optional<CVertexMorphEffect>& morphEffect,
|
|
|
|
const float* morphMagnitudes);
|
|
|
|
void Draw(const CModelFlags& drawFlags) const;
|
2016-04-05 01:51:25 +00:00
|
|
|
};
|
|
|
|
|
2016-04-15 03:02:21 +00:00
|
|
|
class CMorphableSkinnedModel : public CSkinnedModel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMorphableSkinnedModel(IObjectStore& store, ResId model, ResId skinRules,
|
2016-08-21 20:39:18 +00:00
|
|
|
ResId layoutInfo, int shaderIdx);
|
2016-04-15 03:02:21 +00:00
|
|
|
};
|
|
|
|
|
2016-04-05 01:51:25 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CSKINNEDMODEL_HPP__
|