From f6c35bfc9b8fbf1e417c655e9a21425f2adadbee Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 13 Apr 2016 17:32:27 -1000 Subject: [PATCH] CAnimData and CModelData stubs --- DataSpec/DNAMP1/CINF.cpp | 173 ++++++++++++++++++++++++++ DataSpec/DNAMP1/CINF.hpp | 168 ++----------------------- DataSpec/DNAMP1/CMakeLists.txt | 1 + Runtime/Character/CAnimData.cpp | 204 +++++++++++++++++++++++++++++++ Runtime/Character/CAnimData.hpp | 81 +++++++++++- Runtime/Character/CModelData.cpp | 138 +++++++++++++++++++++ Runtime/Character/CModelData.hpp | 63 +++++++++- 7 files changed, 662 insertions(+), 166 deletions(-) create mode 100644 DataSpec/DNAMP1/CINF.cpp diff --git a/DataSpec/DNAMP1/CINF.cpp b/DataSpec/DNAMP1/CINF.cpp new file mode 100644 index 000000000..20ea78754 --- /dev/null +++ b/DataSpec/DNAMP1/CINF.cpp @@ -0,0 +1,173 @@ +#include "CINF.hpp" + +namespace DataSpec +{ +namespace DNAMP1 +{ + +atUint32 CINF::getInternalBoneIdxFromId(atUint32 id) const +{ + atUint32 idx = 0; + for (const Bone& b : bones) + { + if (b.id == id) + return idx; + ++idx; + } + return -1; +} + +atUint32 CINF::getBoneIdxFromId(atUint32 id) const +{ + atUint32 idx = 0; + for (atUint32 bid : boneIds) + { + if (bid == id) + return idx; + ++idx; + } + return 0; +} + +const std::string* CINF::getBoneNameFromId(atUint32 id) const +{ + for (const Name& name : names) + if (id == name.boneId) + return &name.name; + return nullptr; +} + +void CINF::sendVertexGroupsToBlender(hecl::BlenderConnection::PyOutStream& os) const +{ + for (atUint32 bid : boneIds) + { + for (const Name& name : names) + { + if (name.boneId == bid) + { + os.format("obj.vertex_groups.new('%s')\n", name.name.c_str()); + break; + } + } + } +} + +void CINF::sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const +{ + DNAANIM::RigInverter inverter(*this); + + os.format("arm = bpy.data.armatures.new('CINF_%08X')\n" + "arm_obj = bpy.data.objects.new(arm.name, arm)\n" + "bpy.context.scene.objects.link(arm_obj)\n" + "bpy.context.scene.objects.active = arm_obj\n" + "bpy.ops.object.mode_set(mode='EDIT')\n" + "arm_bone_table = {}\n", + cinfId.toUint32()); + + for (const DNAANIM::RigInverter::Bone& bone : inverter.getBones()) + os.format("bone = arm.edit_bones.new('%s')\n" + "bone.head = (%f,%f,%f)\n" + "bone.tail = (%f,%f,%f)\n" + "bone.use_inherit_scale = False\n" + "arm_bone_table[%u] = bone\n", getBoneNameFromId(bone.m_origBone.id)->c_str(), + bone.m_origBone.origin.vec[0], bone.m_origBone.origin.vec[1], bone.m_origBone.origin.vec[2], + bone.m_tail[0], bone.m_tail[1], bone.m_tail[2], + bone.m_origBone.id); + + for (const Bone& bone : bones) + if (bone.parentId != 2) + os.format("arm_bone_table[%u].parent = arm_bone_table[%u]\n", bone.id, bone.parentId); + + os << "bpy.ops.object.mode_set(mode='OBJECT')\n"; +} + +std::string CINF::GetCINFArmatureName(const UniqueID32& cinfId) +{ + return hecl::Format("CINF_%08X", cinfId.toUint32()); +} + +int CINF::RecursiveAddArmatureBone(const Armature& armature, const Armature::Bone* bone, int parent, int& curId, + std::unordered_map& idMap, std::map& nameMap) +{ + int selId; + auto search = idMap.find(bone->name); + if (search == idMap.end()) + { + selId = curId++; + idMap.emplace(std::make_pair(bone->name, selId)); + } + else + selId = search->second; + + bones.emplace_back(); + Bone& boneOut = bones.back(); + nameMap[bone->name] = selId; + boneOut.id = selId; + boneOut.parentId = parent; + boneOut.origin = bone->origin; + boneOut.linkedCount = bone->children.size() + 1; + boneOut.linked.reserve(boneOut.linkedCount); + + const Armature::Bone* child; + boneOut.linked.push_back(parent); + for (size_t i=0 ; (child = armature.getChild(bone, i)) ; ++i) + boneOut.linked.push_back(RecursiveAddArmatureBone(armature, child, boneOut.id, selId, idMap, nameMap)); + + return boneOut.id; +} + +CINF::CINF(const Armature& armature, std::unordered_map& idMap) +{ + idMap.reserve(armature.bones.size()); + bones.reserve(armature.bones.size()); + + std::map nameMap; + + const Armature::Bone* bone = armature.getRoot(); + if (bone) + { + if (bone->children.size()) + { + int curId = 4; + RecursiveAddArmatureBone(armature, armature.getChild(bone, 0), 3, curId, idMap, nameMap); + } + + bones.emplace_back(); + Bone& boneOut = bones.back(); + nameMap[bone->name] = 3; + boneOut.id = 3; + boneOut.parentId = 2; + boneOut.origin = bone->origin; + + if (bone->children.size()) + { + boneOut.linkedCount = 2; + boneOut.linked = {2, 4}; + } + else + { + boneOut.linkedCount = 1; + boneOut.linked = {2}; + } + } + + boneCount = bones.size(); + + names.reserve(nameMap.size()); + nameCount = nameMap.size(); + for (const auto& name : nameMap) + { + names.emplace_back(); + Name& nameOut = names.back(); + nameOut.name = name.first; + nameOut.boneId = name.second; + } + + boneIdCount = boneCount; + boneIds.reserve(boneIdCount); + for (auto it=bones.crbegin() ; it != bones.crend() ; ++it) + boneIds.push_back(it->id); +} + +} +} diff --git a/DataSpec/DNAMP1/CINF.hpp b/DataSpec/DNAMP1/CINF.hpp index b66947062..67529d85b 100644 --- a/DataSpec/DNAMP1/CINF.hpp +++ b/DataSpec/DNAMP1/CINF.hpp @@ -37,172 +37,20 @@ struct CINF : BigDNA }; Vector names; - atUint32 getInternalBoneIdxFromId(atUint32 id) const - { - atUint32 idx = 0; - for (const Bone& b : bones) - { - if (b.id == id) - return idx; - ++idx; - } - return -1; - } - - atUint32 getBoneIdxFromId(atUint32 id) const - { - atUint32 idx = 0; - for (atUint32 bid : boneIds) - { - if (bid == id) - return idx; - ++idx; - } - return 0; - } - - const std::string* getBoneNameFromId(atUint32 id) const - { - for (const Name& name : names) - if (id == name.boneId) - return &name.name; - return nullptr; - } - - void sendVertexGroupsToBlender(hecl::BlenderConnection::PyOutStream& os) const - { - for (atUint32 bid : boneIds) - { - for (const Name& name : names) - { - if (name.boneId == bid) - { - os.format("obj.vertex_groups.new('%s')\n", name.name.c_str()); - break; - } - } - } - } - - void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const - { - DNAANIM::RigInverter inverter(*this); - - os.format("arm = bpy.data.armatures.new('CINF_%08X')\n" - "arm_obj = bpy.data.objects.new(arm.name, arm)\n" - "bpy.context.scene.objects.link(arm_obj)\n" - "bpy.context.scene.objects.active = arm_obj\n" - "bpy.ops.object.mode_set(mode='EDIT')\n" - "arm_bone_table = {}\n", - cinfId.toUint32()); - - for (const DNAANIM::RigInverter::Bone& bone : inverter.getBones()) - os.format("bone = arm.edit_bones.new('%s')\n" - "bone.head = (%f,%f,%f)\n" - "bone.tail = (%f,%f,%f)\n" - "bone.use_inherit_scale = False\n" - "arm_bone_table[%u] = bone\n", getBoneNameFromId(bone.m_origBone.id)->c_str(), - bone.m_origBone.origin.vec[0], bone.m_origBone.origin.vec[1], bone.m_origBone.origin.vec[2], - bone.m_tail[0], bone.m_tail[1], bone.m_tail[2], - bone.m_origBone.id); - - for (const Bone& bone : bones) - if (bone.parentId != 2) - os.format("arm_bone_table[%u].parent = arm_bone_table[%u]\n", bone.id, bone.parentId); - - os << "bpy.ops.object.mode_set(mode='OBJECT')\n"; - } - - static std::string GetCINFArmatureName(const UniqueID32& cinfId) - { - return hecl::Format("CINF_%08X", cinfId.toUint32()); - } + atUint32 getInternalBoneIdxFromId(atUint32 id) const; + atUint32 getBoneIdxFromId(atUint32 id) const; + const std::string* getBoneNameFromId(atUint32 id) const; + void sendVertexGroupsToBlender(hecl::BlenderConnection::PyOutStream& os) const; + void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID32& cinfId) const; + static std::string GetCINFArmatureName(const UniqueID32& cinfId); CINF() = default; using Armature = hecl::BlenderConnection::DataStream::Actor::Armature; int RecursiveAddArmatureBone(const Armature& armature, const Armature::Bone* bone, int parent, int& curId, - std::unordered_map& idMap, std::map& nameMap) - { - int selId; - auto search = idMap.find(bone->name); - if (search == idMap.end()) - { - selId = curId++; - idMap.emplace(std::make_pair(bone->name, selId)); - } - else - selId = search->second; + std::unordered_map& idMap, std::map& nameMap); - bones.emplace_back(); - Bone& boneOut = bones.back(); - nameMap[bone->name] = selId; - boneOut.id = selId; - boneOut.parentId = parent; - boneOut.origin = bone->origin; - boneOut.linkedCount = bone->children.size() + 1; - boneOut.linked.reserve(boneOut.linkedCount); - - const Armature::Bone* child; - boneOut.linked.push_back(parent); - for (size_t i=0 ; (child = armature.getChild(bone, i)) ; ++i) - boneOut.linked.push_back(RecursiveAddArmatureBone(armature, child, boneOut.id, selId, idMap, nameMap)); - - return boneOut.id; - } - - CINF(const Armature& armature, std::unordered_map& idMap) - { - idMap.reserve(armature.bones.size()); - bones.reserve(armature.bones.size()); - - std::map nameMap; - - const Armature::Bone* bone = armature.getRoot(); - if (bone) - { - if (bone->children.size()) - { - int curId = 4; - RecursiveAddArmatureBone(armature, armature.getChild(bone, 0), 3, curId, idMap, nameMap); - } - - bones.emplace_back(); - Bone& boneOut = bones.back(); - nameMap[bone->name] = 3; - boneOut.id = 3; - boneOut.parentId = 2; - boneOut.origin = bone->origin; - - if (bone->children.size()) - { - boneOut.linkedCount = 2; - boneOut.linked = {2, 4}; - } - else - { - boneOut.linkedCount = 1; - boneOut.linked = {2}; - } - } - - boneCount = bones.size(); - - names.reserve(nameMap.size()); - nameCount = nameMap.size(); - for (const auto& name : nameMap) - { - names.emplace_back(); - Name& nameOut = names.back(); - nameOut.name = name.first; - nameOut.boneId = name.second; - } - - boneIdCount = boneCount; - boneIds.reserve(boneIdCount); - for (auto it=bones.crbegin() ; it != bones.crend() ; ++it) - boneIds.push_back(it->id); - } + CINF(const Armature& armature, std::unordered_map& idMap); }; } diff --git a/DataSpec/DNAMP1/CMakeLists.txt b/DataSpec/DNAMP1/CMakeLists.txt index ea89c972c..81b0c47fc 100644 --- a/DataSpec/DNAMP1/CMakeLists.txt +++ b/DataSpec/DNAMP1/CMakeLists.txt @@ -26,6 +26,7 @@ add_library(DNAMP1 STRG.hpp STRG.cpp ANCS.cpp ANIM.cpp + CINF.cpp EVNT.cpp CMDL.hpp CMDLMaterials.cpp diff --git a/Runtime/Character/CAnimData.cpp b/Runtime/Character/CAnimData.cpp index f547665bf..397dd6714 100644 --- a/Runtime/Character/CAnimData.cpp +++ b/Runtime/Character/CAnimData.cpp @@ -9,6 +9,14 @@ namespace urde { +void CAnimData::FreeCache() +{ +} + +void CAnimData::InitializeCache() +{ +} + CAnimData::CAnimData(TResId id, const CCharacterInfo& character, int a, int b, bool c, const TLockedToken& layout, const TToken& model, @@ -32,4 +40,200 @@ CAnimData::CAnimData(TResId id, const CCharacterInfo& character, int a, int b, b { } +TResId CAnimData::GetEventResourceIdForAnimResourceId(TResId) const +{ +} + +void CAnimData::AddAdditiveSegData(const CSegIdList& list, CSegStatementSet& stSet) +{ +} + +void CAnimData::AdvanceAdditiveAnims(float) +{ +} + +void CAnimData::UpdateAdditiveAnims(float) +{ +} + +bool CAnimData::IsAdditiveAnimation(u32) const +{ +} + +std::shared_ptr CAnimData::GetAdditiveAnimationTree(u32) const +{ +} + +bool CAnimData::IsAdditiveAnimationActive(u32) const +{ +} + +void CAnimData::DelAdditiveAnimation(u32) +{ +} + +void CAnimData::AddAdditiveAnimation(u32, float, bool, bool) +{ +} + +std::shared_ptr CAnimData::GetAnimationManager() +{ +} + +void CAnimData::SetPhase(float) +{ +} + +void CAnimData::Touch(const CSkinnedModel& model, int) const +{ +} + +zeus::CVector3f CAnimData::GetAdvancementDeltas(const CCharAnimTime& a, const CCharAnimTime& b) const +{ +} + +CCharAnimTime CAnimData::GetTimeOfUserEvent(EUserEventType, const CCharAnimTime& time) const +{ +} + +void CAnimData::MultiplyPlaybackRate(float) +{ +} + +void CAnimData::SetPlaybackRate(float) +{ +} + +void CAnimData::SetRandomPlaybackRate(CRandom16&) +{ +} + +void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms, + const std::weak_ptr& node) +{ +} + +zeus::CTransform CAnimData::GetLocatorTransform(CSegId id, const CCharAnimTime* time) const +{ +} + +zeus::CTransform CAnimData::GetLocatorTransform(const std::string& name, const CCharAnimTime* time) const +{ +} + +bool CAnimData::IsAnimTimeRemaining(float, const std::string& name) const +{ +} + +float CAnimData::GetAnimTimeRemaining(const std::string& name) const +{ +} + +float CAnimData::GetAnimationDuration(int) const +{ +} + +std::shared_ptr CAnimData::GetAnimSysContext() const +{ +} + +std::shared_ptr CAnimData::GetAnimationManager() const +{ +} + +void CAnimData::RecalcPoseBuilder(const CCharAnimTime*) const +{ +} + +void CAnimData::RenderAuxiliary(const CFrustumPlanes& frustum) const +{ +} + +void CAnimData::Render(const CSkinnedModel& model, const CModelFlags& drawFlags, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const +{ +} + +void CAnimData::SetupRender(const CSkinnedModel& model, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const +{ +} + +void CAnimData::PreRender() +{ +} + +void CAnimData::BuildPose() +{ +} + +void CAnimData::PrimitiveSetToTokenVector(const std::set& primSet, std::vector& tokensOut) +{ +} + +void CAnimData::GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set& primsOut) const +{ +} + +void CAnimData::SetAnimation(const CAnimPlaybackParms& parms, bool) +{ +} + +void CAnimData::DoAdvance(float, bool&, CRandom16&, bool) +{ +} + +void CAnimData::Advance(float, const zeus::CVector3f&, CStateManager& stateMgr, bool) +{ +} + +void CAnimData::AdvanceIgnoreParticles(float, CRandom16&, bool) +{ +} + +void CAnimData::AdvanceAnim(CCharAnimTime& time, zeus::CVector3f&, zeus::CQuaternion&) +{ +} + +void CAnimData::SetXRayModel(const TLockedToken& model, const TLockedToken& skinRules) +{ +} + +void CAnimData::SetInfraModel(const TLockedToken& model, const TLockedToken& skinRules) +{ +} + +void CAnimData::PoseSkinnedModel(const CSkinnedModel& model, const CPoseAsTransforms& pose, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const +{ +} + +void CAnimData::AdvanceParticles(const zeus::CTransform& xf, float, + const zeus::CVector3f&, CStateManager& stateMgr) +{ +} + +void CAnimData::GetAverageVelocity(int) const +{ +} + +void CAnimData::ResetPOILists() +{ +} + +CSegId CAnimData::GetLocatorSegId(const std::string& name) const +{ +} + +zeus::CAABox CAnimData::GetBoundingBox(const zeus::CTransform& xf) const +{ +} + +zeus::CAABox CAnimData::GetBoundingBox() const +{ +} + } diff --git a/Runtime/Character/CAnimData.hpp b/Runtime/Character/CAnimData.hpp index 87cecb4dc..8d4e7dc38 100644 --- a/Runtime/Character/CAnimData.hpp +++ b/Runtime/Character/CAnimData.hpp @@ -7,6 +7,11 @@ #include "CParticleDatabase.hpp" #include "CPoseAsTransforms.hpp" #include "CHierarchyPoseBuilder.hpp" +#include + +enum class EUserEventType +{ +}; namespace urde { @@ -17,6 +22,19 @@ class CAnimationManager; class CTransitionManager; class CCharacterFactory; class IMetaAnim; +class CModelFlags; +class CVertexMorphEffect; +class CFrustumPlanes; +class CPrimitive; +class CAnimPlaybackParms; +class CRandom16; +class CStateManager; +class CCharAnimTime; +class CModel; +class CSkinRules; +class CAnimTreeNode; +class CSegIdList; +class CSegStatementSet; class CAnimData { @@ -85,9 +103,66 @@ public: const std::shared_ptr& animMgr, const std::shared_ptr& transMgr, const TLockedToken& charFactory); - static void InitializeCache() - { - } + + TResId GetEventResourceIdForAnimResourceId(TResId) const; + void AddAdditiveSegData(const CSegIdList& list, CSegStatementSet& stSet); + void AdvanceAdditiveAnims(float); + void UpdateAdditiveAnims(float); + bool IsAdditiveAnimation(u32) const; + std::shared_ptr GetAdditiveAnimationTree(u32) const; + bool IsAdditiveAnimationActive(u32) const; + void DelAdditiveAnimation(u32); + void AddAdditiveAnimation(u32, float, bool, bool); + std::shared_ptr GetAnimationManager(); + void SetPhase(float); + void Touch(const CSkinnedModel& model, int) const; + zeus::CVector3f GetAdvancementDeltas(const CCharAnimTime& a, const CCharAnimTime& b) const; + CCharAnimTime GetTimeOfUserEvent(EUserEventType, const CCharAnimTime& time) const; + void MultiplyPlaybackRate(float); + void SetPlaybackRate(float); + void SetRandomPlaybackRate(CRandom16&); + void CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms, + const std::weak_ptr& node); + zeus::CTransform GetLocatorTransform(CSegId id, const CCharAnimTime* time) const; + zeus::CTransform GetLocatorTransform(const std::string& name, const CCharAnimTime* time) const; + bool IsAnimTimeRemaining(float, const std::string& name) const; + float GetAnimTimeRemaining(const std::string& name) const; + float GetAnimationDuration(int) const; + std::shared_ptr GetAnimSysContext() const; + std::shared_ptr GetAnimationManager() const; + void RecalcPoseBuilder(const CCharAnimTime*) const; + void RenderAuxiliary(const CFrustumPlanes& frustum) const; + void Render(const CSkinnedModel& model, const CModelFlags& drawFlags, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const; + void SetupRender(const CSkinnedModel& model, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const; + void PreRender(); + void BuildPose(); + void PrimitiveSetToTokenVector(const std::set& primSet, std::vector& tokensOut); + void GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set& primsOut) const; + void SetAnimation(const CAnimPlaybackParms& parms, bool); + void DoAdvance(float, bool&, CRandom16&, bool); + void Advance(float, const zeus::CVector3f&, CStateManager& stateMgr, bool); + void AdvanceIgnoreParticles(float, CRandom16&, bool); + void AdvanceAnim(CCharAnimTime& time, zeus::CVector3f&, zeus::CQuaternion&); + void SetXRayModel(const TLockedToken& model, const TLockedToken& skinRules); + void SetInfraModel(const TLockedToken& model, const TLockedToken& skinRules); + + void PoseSkinnedModel(const CSkinnedModel& model, const CPoseAsTransforms& pose, + const std::experimental::optional& morphEffect, + const float* morphMagnitudes) const; + void AdvanceParticles(const zeus::CTransform& xf, float, + const zeus::CVector3f&, CStateManager& stateMgr); + void GetAverageVelocity(int) const; + void ResetPOILists(); + CSegId GetLocatorSegId(const std::string& name) const; + zeus::CAABox GetBoundingBox(const zeus::CTransform& xf) const; + zeus::CAABox GetBoundingBox() const; + + static void FreeCache(); + static void InitializeCache(); }; } diff --git a/Runtime/Character/CModelData.cpp b/Runtime/Character/CModelData.cpp index e69de29bb..70550bbe7 100644 --- a/Runtime/Character/CModelData.cpp +++ b/Runtime/Character/CModelData.cpp @@ -0,0 +1,138 @@ +#include "CModelData.hpp" +#include "CAnimData.hpp" + +namespace urde +{ + +CModelData::CModelData() {} + +CModelData::CModelData(const CStaticRes& res) +{ +} + +CModelData::CModelData(const CAnimRes& res) +{ +} + +zeus::CVector3f CModelData::GetAdvancementDeltas(const CCharAnimTime& a, + const CCharAnimTime& b) const +{ +} + +void CModelData::Render(const CStateManager& stateMgr, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const +{ +} + +void CModelData::GetRenderingModel(const CStateManager& stateMgr) +{ +} + +void CModelData::PickAnimatedModel(EWhichModel) const +{ +} + +void CModelData::PickStaticModel(EWhichModel) const +{ +} + +void CModelData::SetXRayModel(const std::pair& modelSkin) +{ +} + +void CModelData::SetInfraModel(const std::pair& modelSkin) +{ +} + +bool CModelData::IsDefinitelyOpaque(EWhichModel) const +{ +} + +bool CModelData::GetIsLoop() const +{ +} + +float CModelData::GetAnimationDuration(int) const +{ +} + +void CModelData::EnableLooping(bool) +{ +} + +void CModelData::AdvanceParticles(const zeus::CTransform& xf, float, + CStateManager& stateMgr) +{ +} + +zeus::CAABox CModelData::GetBounds() const +{ +} + +zeus::CAABox CModelData::GetBounds(const zeus::CTransform& xf) const +{ +} + +zeus::CTransform CModelData::GetScaledLocatorTransformDynamic(const std::string& name, + const CCharAnimTime* time) const +{ +} + +zeus::CTransform CModelData::GetScaledLocatorTransform(const std::string& name) const +{ +} + +zeus::CTransform CModelData::GetLocatorTransformDynamic(const std::string& name, + const CCharAnimTime* time) const +{ +} + +zeus::CTransform CModelData::GetLocatorTransform(const std::string& name) const +{ +} + +void CModelData::AdvanceAnimationIgnoreParticles(float dt, CRandom16&, bool) +{ +} + +void CModelData::AdvanceAnimation(float dt, CStateManager& stateMgr, bool) +{ +} + +bool CModelData::IsAnimating() const +{ +} + +bool CModelData::IsInFrustum(const zeus::CTransform& xf, + const CFrustumPlanes& frustum) const +{ +} + +void CModelData::RenderParticles(const CFrustumPlanes& frustum) const +{ +} + +void CModelData::Touch(EWhichModel, int) const +{ +} + +void CModelData::Touch(const CStateManager& stateMgr, int) const +{ +} + +void CModelData::RenderThermal(const zeus::CTransform& xf, + const zeus::CColor& a, const zeus::CColor& b) const +{ +} + +void CModelData::RenderUnsortedParts(EWhichModel, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const +{ +} + +void CModelData::Render(EWhichModel, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const +{ +} + +} diff --git a/Runtime/Character/CModelData.hpp b/Runtime/Character/CModelData.hpp index 4f5e51658..5be583b10 100644 --- a/Runtime/Character/CModelData.hpp +++ b/Runtime/Character/CModelData.hpp @@ -2,21 +2,78 @@ #define __URDE_CMODELDATA_HPP__ #include "zeus/CVector3f.hpp" +#include "zeus/CAABox.hpp" +#include "RetroTypes.hpp" +#include "CToken.hpp" namespace urde { +class CCharAnimTime; +class CStateManager; +class CActorLights; +class CModelFlags; +class CRandom16; +class CFrustumPlanes; +class CAnimData; +class CModel; -class CAnimRes +struct CStaticRes +{ +}; + +struct CAnimRes { zeus::CVector3f x8_scale; -public: - CAnimRes(); }; class CModelData { + zeus::CVector3f x0_particleScale; + std::unique_ptr xc_animData; + TLockedToken x1c_normalModel; + TLockedToken x2c_xrayModel; + TLockedToken x3c_infraModel; public: + enum class EWhichModel + { + }; + + CModelData(); + CModelData(const CStaticRes& res); CModelData(const CAnimRes& res); + CModelData CModelDataNull() {return CModelData();} + + zeus::CVector3f GetAdvancementDeltas(const CCharAnimTime& a, const CCharAnimTime& b) const; + void Render(const CStateManager& stateMgr, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const; + void GetRenderingModel(const CStateManager& stateMgr); + void PickAnimatedModel(EWhichModel) const; + void PickStaticModel(EWhichModel) const; + void SetXRayModel(const std::pair& modelSkin); + void SetInfraModel(const std::pair& modelSkin); + bool IsDefinitelyOpaque(EWhichModel) const; + bool GetIsLoop() const; + float GetAnimationDuration(int) const; + void EnableLooping(bool); + void AdvanceParticles(const zeus::CTransform& xf, float, CStateManager& stateMgr); + zeus::CAABox GetBounds() const; + zeus::CAABox GetBounds(const zeus::CTransform& xf) const; + zeus::CTransform GetScaledLocatorTransformDynamic(const std::string& name, const CCharAnimTime* time) const; + zeus::CTransform GetScaledLocatorTransform(const std::string& name) const; + zeus::CTransform GetLocatorTransformDynamic(const std::string& name, const CCharAnimTime* time) const; + zeus::CTransform GetLocatorTransform(const std::string& name) const; + void AdvanceAnimationIgnoreParticles(float dt, CRandom16&, bool); + void AdvanceAnimation(float dt, CStateManager& stateMgr, bool); + bool IsAnimating() const; + bool IsInFrustum(const zeus::CTransform& xf, const CFrustumPlanes& frustum) const; + void RenderParticles(const CFrustumPlanes& frustum) const; + void Touch(EWhichModel, int) const; + void Touch(const CStateManager& stateMgr, int) const; + void RenderThermal(const zeus::CTransform& xf, const zeus::CColor& a, const zeus::CColor& b) const; + void RenderUnsortedParts(EWhichModel, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const; + void Render(EWhichModel, const zeus::CTransform& xf, + const CActorLights* lights, const CModelFlags& drawFlags) const; }; }