#ifndef __URDE_CSKINNEDMODEL_HPP__ #define __URDE_CSKINNEDMODEL_HPP__ #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 { friend class CBooModel; std::unique_ptr m_modelInst; TLockedToken x4_model; TLockedToken x10_skinRules; TLockedToken x1c_layoutInfo; public: enum class EDataOwnership { Zero, One }; CSkinnedModel(TLockedToken model, TLockedToken skinRules, TLockedToken layoutInfo, int shaderIdx, int drawInsts); CSkinnedModel(IObjectStore& store, ResId model, ResId skinRules, ResId layoutInfo, int shaderIdx, int drawInsts); const TLockedToken& GetModel() const {return x4_model;} const std::unique_ptr& GetModelInst() const {return m_modelInst;} const TLockedToken& GetSkinRules() const {return x10_skinRules;} const TLockedToken& GetLayoutInfo() const {return x1c_layoutInfo;} void Calculate(const CPoseAsTransforms& pose, const CModelFlags& drawFlags, const std::experimental::optional& morphEffect, const float* morphMagnitudes); void Draw(const CModelFlags& drawFlags) const; typedef void(*FPointGenerator)(void* item, const zeus::CVector3f* v1, const zeus::CVector3f* v2, int w1); static void SetPointGeneratorFunc(void* ctx, FPointGenerator func) { g_PointGenFunc = func; g_PointGenCtx = ctx; } static FPointGenerator g_PointGenFunc; static void* g_PointGenCtx; }; class CMorphableSkinnedModel : public CSkinnedModel { public: CMorphableSkinnedModel(IObjectStore& store, ResId model, ResId skinRules, ResId layoutInfo, int shaderIdx, int drawInsts); }; } #endif // __URDE_CSKINNEDMODEL_HPP__