From 8242c3edda9fb1269427cbaa9109e14dfec7c209 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 10 Apr 2016 17:59:54 -1000 Subject: [PATCH] Various character imps --- Editor/ProjectManager.cpp | 4 +- Editor/ProjectManager.hpp | 4 +- Runtime/CCallStack.hpp | 2 +- Runtime/CSimplePool.cpp | 4 +- Runtime/CSimplePool.hpp | 4 +- Runtime/Character/CAnimTreeDoubleChild.hpp | 19 +- Runtime/Character/CAnimTreeNode.hpp | 4 + Runtime/Character/CAnimTreeSingleChild.cpp | 97 ++++++ Runtime/Character/CAnimTreeSingleChild.hpp | 26 +- Runtime/Character/CAnimTreeTransition.hpp | 7 +- Runtime/Character/CAnimTreeTweenBase.hpp | 4 +- Runtime/Character/CCharAnimTime.cpp | 328 +++++++++++++++++++++ Runtime/Character/CCharAnimTime.hpp | 216 ++------------ Runtime/Character/CMakeLists.txt | 1 + Runtime/Character/CMetaAnimBlend.cpp | 5 + Runtime/Character/CMetaAnimBlend.hpp | 4 + Runtime/Character/CMetaAnimPhaseBlend.cpp | 5 + Runtime/Character/CMetaAnimPhaseBlend.hpp | 4 + Runtime/Character/CMetaAnimPlay.cpp | 3 +- Runtime/Character/CMetaAnimPlay.hpp | 4 + Runtime/Character/CMetaAnimRandom.cpp | 17 +- Runtime/Character/CMetaAnimRandom.hpp | 3 + Runtime/Character/CMetaAnimSequence.cpp | 14 +- Runtime/Character/CMetaAnimSequence.hpp | 2 + Runtime/Character/CMetaTransFactory.cpp | 2 +- Runtime/Character/CMetaTransMetaAnim.cpp | 4 +- Runtime/Character/CMetaTransMetaAnim.hpp | 2 + Runtime/Character/CMetaTransPhaseTrans.cpp | 5 + Runtime/Character/CMetaTransPhaseTrans.hpp | 5 + Runtime/Character/CMetaTransSnap.cpp | 5 +- Runtime/Character/CMetaTransSnap.hpp | 1 - Runtime/Character/CMetaTransTrans.cpp | 7 + Runtime/Character/CMetaTransTrans.hpp | 5 + Runtime/Character/CPrimitive.cpp | 13 + Runtime/Character/CPrimitive.hpp | 7 + Runtime/Character/CTimeScaleFunctions.cpp | 80 +++++ Runtime/Character/CTimeScaleFunctions.hpp | 59 ++++ Runtime/Character/IAnimReader.cpp | 14 + Runtime/Character/IAnimReader.hpp | 45 +++ Runtime/Character/IMetaTrans.hpp | 2 +- Runtime/IObjectStore.hpp | 4 +- 41 files changed, 826 insertions(+), 215 deletions(-) create mode 100644 Runtime/Character/CTimeScaleFunctions.cpp create mode 100644 Runtime/Character/CTimeScaleFunctions.hpp diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index 6e57805a9..8a1f8b832 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -6,7 +6,7 @@ namespace urde { static logvisor::Module Log("URDE::ProjectManager"); -CToken ProjectResourcePool::GetObj(char const* name) +CToken ProjectResourcePool::GetObj(const char* name) { CToken ret = CSimplePool::GetObj(name); if (ret) @@ -21,7 +21,7 @@ CToken ProjectResourcePool::GetObj(char const* name) return {}; } -CToken ProjectResourcePool::GetObj(char const* name, const CVParamTransfer& pvxfer) +CToken ProjectResourcePool::GetObj(const char* name, const CVParamTransfer& pvxfer) { CToken ret = CSimplePool::GetObj(name, pvxfer); if (ret) diff --git a/Editor/ProjectManager.hpp b/Editor/ProjectManager.hpp index 21ccc9965..241e3747b 100644 --- a/Editor/ProjectManager.hpp +++ b/Editor/ProjectManager.hpp @@ -20,8 +20,8 @@ class ProjectResourcePool : public CSimplePool public: ProjectResourcePool(IFactory& factory, ProjectManager& parent) : CSimplePool(factory), m_parent(parent) {} - CToken GetObj(char const*); - CToken GetObj(char const*, const CVParamTransfer&); + CToken GetObj(const char*); + CToken GetObj(const char*, const CVParamTransfer&); }; class ProjectManager diff --git a/Runtime/CCallStack.hpp b/Runtime/CCallStack.hpp index a7447ad57..9b7e05aa8 100644 --- a/Runtime/CCallStack.hpp +++ b/Runtime/CCallStack.hpp @@ -9,7 +9,7 @@ class CCallStack const char* x0_fileAndLineStr; const char* x4_typeStr; public: - CCallStack(char const* fileAndLineStr, char const* typeStr) + CCallStack(const char* fileAndLineStr, const char* typeStr) : x0_fileAndLineStr(fileAndLineStr), x4_typeStr(typeStr) {} const char* GetFileAndLineText() const {return x0_fileAndLineStr;} const char* GetTypeText() const {return x4_typeStr;} diff --git a/Runtime/CSimplePool.cpp b/Runtime/CSimplePool.cpp index 7b1c9bec8..07fb49293 100644 --- a/Runtime/CSimplePool.cpp +++ b/Runtime/CSimplePool.cpp @@ -30,12 +30,12 @@ CToken CSimplePool::GetObj(const SObjectTag& tag) return GetObj(tag, x34_paramXfer); } -CToken CSimplePool::GetObj(char const* resourceName) +CToken CSimplePool::GetObj(const char* resourceName) { return GetObj(resourceName, x34_paramXfer); } -CToken CSimplePool::GetObj(char const* resourceName, const CVParamTransfer& paramXfer) +CToken CSimplePool::GetObj(const char* resourceName, const CVParamTransfer& paramXfer) { const SObjectTag* tag = x30_factory.GetResourceIdByName(resourceName); if (!tag) diff --git a/Runtime/CSimplePool.hpp b/Runtime/CSimplePool.hpp index b08cdfb66..55b581c3a 100644 --- a/Runtime/CSimplePool.hpp +++ b/Runtime/CSimplePool.hpp @@ -22,8 +22,8 @@ public: CSimplePool(IFactory& factory); CToken GetObj(const SObjectTag&, const CVParamTransfer&); CToken GetObj(const SObjectTag&); - CToken GetObj(char const*); - CToken GetObj(char const*, const CVParamTransfer&); + CToken GetObj(const char*); + CToken GetObj(const char*, const CVParamTransfer&); bool HasObject(const SObjectTag&) const; bool ObjectIsLive(const SObjectTag&) const; IFactory& GetFactory() const {return x30_factory;} diff --git a/Runtime/Character/CAnimTreeDoubleChild.hpp b/Runtime/Character/CAnimTreeDoubleChild.hpp index 031ae6bba..f8390adb7 100644 --- a/Runtime/Character/CAnimTreeDoubleChild.hpp +++ b/Runtime/Character/CAnimTreeDoubleChild.hpp @@ -1,11 +1,28 @@ #ifndef __PSHAG_CANIMTREEDOUBLECHILD_HPP__ #define __PSHAG_CANIMTREEDOUBLECHILD_HPP__ +#include "CAnimTreeNode.hpp" + namespace urde { -class CAnimTreeDoubleChild +class CAnimTreeDoubleChild : public CAnimTreeNode { +public: + void VAdvanceView(const CCharAnimTime& a); + void VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32, u32, u32) const; + void VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut, u32, u32, u32) const; + void VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut, u32, u32, u32) const; + void VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut, u32, u32, u32) const; + void VGetBoolPOIState(const char*) const; + void VGetInt32POIState(const char*) const; + void VGetParticlePOIState(const char*) const; + void VSetPhase(float); + SAdvancementResults VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const; + void Depth() const; + void VGetContributionOfHighestInfluence() const; + void VGetNumChildren() const; + void VGetBestUnblendedChild() const; }; } diff --git a/Runtime/Character/CAnimTreeNode.hpp b/Runtime/Character/CAnimTreeNode.hpp index 76240d5c9..69b9f79da 100644 --- a/Runtime/Character/CAnimTreeNode.hpp +++ b/Runtime/Character/CAnimTreeNode.hpp @@ -8,6 +8,10 @@ namespace urde class CAnimTreeNode : public IAnimReader { + std::string x4_name; +public: + CAnimTreeNode(const std::string& name) : x4_name(name) {} + bool IsCAnimTreeNode() const {return true;} }; } diff --git a/Runtime/Character/CAnimTreeSingleChild.cpp b/Runtime/Character/CAnimTreeSingleChild.cpp index e69de29bb..dda6bfe61 100644 --- a/Runtime/Character/CAnimTreeSingleChild.cpp +++ b/Runtime/Character/CAnimTreeSingleChild.cpp @@ -0,0 +1,97 @@ +#include "CAnimTreeSingleChild.hpp" + +namespace urde +{ + +CAnimTreeSingleChild::CAnimTreeSingleChild(const std::weak_ptr& node, const std::string& name) +: CAnimTreeNode(name) +{ + +} + +void CAnimTreeSingleChild::VAdvanceView(const CCharAnimTime& a) +{ +} + +void CAnimTreeSingleChild::VGetTimeRemaining() const +{ +} + +bool CAnimTreeSingleChild::VHasOffset(const CSegId& seg) const +{ +} + +void CAnimTreeSingleChild::VGetOffset(const CSegId& seg) const +{ +} + +void CAnimTreeSingleChild::VGetRotation(const CSegId& seg) const +{ +} + +void CAnimTreeSingleChild::VGetBoolPOIList(const CCharAnimTime& time, + CBoolPOINode* listOut, + u32, u32, u32) const +{ +} + +void CAnimTreeSingleChild::VGetInt32POIList(const CCharAnimTime& time, + CInt32POINode* listOut, + u32, u32, u32) const +{ +} + +void CAnimTreeSingleChild::VGetParticlePOIList(const CCharAnimTime& time, + CParticlePOINode* listOut, + u32, u32, u32) const +{ +} + +void CAnimTreeSingleChild::VGetSoundPOIList(const CCharAnimTime& time, + CSoundPOINode* listOut, + u32, u32, u32) const +{ +} + +void CAnimTreeSingleChild::VGetBoolPOIState(const char*) const +{ +} + +void CAnimTreeSingleChild::VGetInt32POIState(const char*) const +{ +} + +void CAnimTreeSingleChild::VGetParticlePOIState(const char*) const +{ +} + +void CAnimTreeSingleChild::VGetSegStatementSet(const CSegIdList& list, + CSegStatementSet& setOut) const +{ +} + +void CAnimTreeSingleChild::VGetSegStatementSet(const CSegIdList& list, + CSegStatementSet& setOut, + const CCharAnimTime& time) const +{ +} + +void CAnimTreeSingleChild::VSetPhase(float) +{ +} + +SAdvancementResults +CAnimTreeSingleChild::VGetAdvancementResults(const CCharAnimTime& a, + const CCharAnimTime& b) const +{ +} + +void CAnimTreeSingleChild::Depth() const +{ +} + +void CAnimTreeSingleChild::VGetNumChildren() const +{ +} + +} diff --git a/Runtime/Character/CAnimTreeSingleChild.hpp b/Runtime/Character/CAnimTreeSingleChild.hpp index e848b29c2..ac32bf25b 100644 --- a/Runtime/Character/CAnimTreeSingleChild.hpp +++ b/Runtime/Character/CAnimTreeSingleChild.hpp @@ -1,11 +1,35 @@ #ifndef __PSHAG_CANIMTREESINGLECHILD_HPP__ #define __PSHAG_CANIMTREESINGLECHILD_HPP__ +#include "CAnimTreeNode.hpp" + namespace urde { -class CAnimTreeSingleChild +class CAnimTreeSingleChild : public CAnimTreeNode { + std::shared_ptr x14_child; +public: + CAnimTreeSingleChild(const std::weak_ptr& node, const std::string& name); + + void VAdvanceView(const CCharAnimTime& a); + void VGetTimeRemaining() const; + bool VHasOffset(const CSegId& seg) const; + void VGetOffset(const CSegId& seg) const; + void VGetRotation(const CSegId& seg) const; + void VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32, u32, u32) const; + void VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut, u32, u32, u32) const; + void VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut, u32, u32, u32) const; + void VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut, u32, u32, u32) const; + void VGetBoolPOIState(const char*) const; + void VGetInt32POIState(const char*) const; + void VGetParticlePOIState(const char*) const; + void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const; + void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut, const CCharAnimTime& time) const; + void VSetPhase(float); + SAdvancementResults VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const; + void Depth() const; + void VGetNumChildren() const; }; } diff --git a/Runtime/Character/CAnimTreeTransition.hpp b/Runtime/Character/CAnimTreeTransition.hpp index 92d857f9b..2c2fb7c7c 100644 --- a/Runtime/Character/CAnimTreeTransition.hpp +++ b/Runtime/Character/CAnimTreeTransition.hpp @@ -1,11 +1,16 @@ #ifndef __PSHAG_CANIMTREETRANSITION_HPP__ #define __PSHAG_CANIMTREETRANSITION_HPP__ +#include "RetroTypes.hpp" +#include "CAnimTreeTweenBase.hpp" + namespace urde { -class CAnimTreeTransition +class CAnimTreeTransition : public CAnimTreeTweenBase { +public: + static std::string CreatePrimitiveName(); }; } diff --git a/Runtime/Character/CAnimTreeTweenBase.hpp b/Runtime/Character/CAnimTreeTweenBase.hpp index 41c6ba24f..769ae5f77 100644 --- a/Runtime/Character/CAnimTreeTweenBase.hpp +++ b/Runtime/Character/CAnimTreeTweenBase.hpp @@ -1,10 +1,12 @@ #ifndef __PSHAG_CANIMTREETWEENBASE_HPP__ #define __PSHAG_CANIMTREETWEENBASE_HPP__ +#include "CAnimTreeDoubleChild.hpp" + namespace urde { -class CAnimTreeTweenBase +class CAnimTreeTweenBase : public CAnimTreeDoubleChild { }; diff --git a/Runtime/Character/CCharAnimTime.cpp b/Runtime/Character/CCharAnimTime.cpp index ea6fdb34a..046bb1886 100644 --- a/Runtime/Character/CCharAnimTime.cpp +++ b/Runtime/Character/CCharAnimTime.cpp @@ -3,4 +3,332 @@ namespace urde { +CCharAnimTime CCharAnimTime::Infinity() +{ + CCharAnimTime ret(1.f); + ret.m_type = Type::Infinity; + return ret; +} + +bool CCharAnimTime::EqualsZero() const +{ + if (m_type == Type::ZeroIncreasing || m_type == Type::ZeroSteady || m_type == Type::ZeroDecreasing) + return false; + + return (m_time == 0.f); +} + +bool CCharAnimTime::GreaterThanZero() const +{ + if (EqualsZero()) + return false; + return (m_time > 0.f); +} + +bool CCharAnimTime::operator ==(const CCharAnimTime& other) const +{ + if (m_type == Type::NonZero) + { + if (other.m_type == Type::NonZero) + return m_time == other.m_time; + return !other.EqualsZero(); + } + + if (EqualsZero()) + { + if (other.EqualsZero()) + { + int type = -1; + if (m_type != Type::ZeroDecreasing) + { + if (m_type != Type::ZeroSteady) + type = 1; + else + type = 0; + } + + int otherType = -1; + if (other.m_type != Type::ZeroDecreasing) + { + if (other.m_type != Type::ZeroSteady) + otherType = 1; + else + otherType = 0; + } + + return type == otherType; + } + return false; + } + + if (other.m_type == Type::Infinity) + return m_time * other.m_time < 0.f; + + return false; +} + +bool CCharAnimTime::operator !=(const CCharAnimTime& other) const +{ + return !(*this == other); +} + +bool CCharAnimTime::operator>=(const CCharAnimTime& other) +{ + if (*this == other) + return true; + + return (*this > other); +} + +bool CCharAnimTime::operator<=(const CCharAnimTime& other) +{ + if (*this == other) + return true; + + return (*this < other); +} + +bool CCharAnimTime::operator >(const CCharAnimTime& other) const +{ + return (!(*this == other) && !(*this < other)); +} + +bool CCharAnimTime::operator <(const CCharAnimTime& other) const +{ + if (m_type == Type::NonZero) + { + if (other.m_type == Type::NonZero) + return m_time < other.m_time; + if (other.EqualsZero()) + return m_time < 0.f; + else + return other.m_time > 0.f; + } + + if (EqualsZero()) + { + if (other.EqualsZero()) + { + int type = -1; + if (m_type != Type::ZeroDecreasing) + { + if (m_type != Type::ZeroSteady) + type = 1; + else + type = 0; + } + + int otherType = -1; + if (other.m_type != Type::ZeroDecreasing) + { + if (other.m_type != Type::ZeroSteady) + otherType = 1; + else + otherType = 0; + } + + return type < otherType; + } + + if (other.m_type == Type::NonZero) + return other.m_time > 0.f; + return other.m_time < 0.f; + } + else + { + if (m_type == Type::Infinity) + return m_time < 0.f && other.m_time > 0.f; + return m_time < 0.f; + } +} + +CCharAnimTime& CCharAnimTime::operator*=(const CCharAnimTime& other) +{ + *this = *this * other; + return *this; +} + +CCharAnimTime& CCharAnimTime::operator+=(const CCharAnimTime& other) +{ + *this = *this + other; + return *this; +} + +CCharAnimTime CCharAnimTime::operator+(const CCharAnimTime& other) +{ + if (m_type == Type::Infinity && other.m_type == Type::Infinity) + { + if (other.m_time != m_time) + return CCharAnimTime(); + return *this; + } + else if (m_type == Type::Infinity) + return *this; + else if (other.m_type == Type::Infinity) + return other; + + if (!EqualsZero() || !other.EqualsZero()) + return CCharAnimTime(m_time + other.m_time); + + int type = -1; + if (m_type != Type::ZeroDecreasing) + { + if (m_type != Type::ZeroSteady) + type = 1; + else + type = 0; + } + + int otherType = -1; + if (other.m_type != Type::ZeroDecreasing) + { + if (other.m_type != Type::ZeroSteady) + otherType = 1; + else + otherType = 0; + } + + type += otherType; + otherType = std::max(-1, std::min(type, 1)); + + CCharAnimTime ret; + if (otherType == -1) + ret.m_type = Type::ZeroDecreasing; + else if (otherType == 0) + ret.m_type = Type::ZeroSteady; + else + ret.m_type = Type::ZeroIncreasing; + + return ret; +} + +CCharAnimTime& CCharAnimTime::operator-=(const CCharAnimTime& other) +{ + *this = *this - other; + return *this; +} + +CCharAnimTime CCharAnimTime::operator-(const CCharAnimTime& other) +{ + if (m_type == Type::Infinity && other.m_type == Type::Infinity) + { + if (other.m_time == m_time) + return CCharAnimTime(); + return *this; + } + else if (m_type == Type::Infinity) + return *this; + else if (other.m_type == Type::Infinity) + { + CCharAnimTime ret(-other.m_time); + ret.m_type = Type::Infinity; + return ret; + } + + if (!EqualsZero() || !other.EqualsZero()) + return CCharAnimTime(m_time - other.m_time); + + int type = -1; + if (m_type != Type::ZeroDecreasing) + { + if (m_type != Type::ZeroSteady) + type = 1; + else + type = 0; + } + + int otherType = -1; + if (other.m_type != Type::ZeroDecreasing) + { + if (other.m_type != Type::ZeroSteady) + otherType = 1; + else + otherType = 0; + } + + CCharAnimTime ret; + type -= otherType; + if (type == -1) + ret.m_type = Type::ZeroDecreasing; + else if (type == 0) + ret.m_type = Type::ZeroSteady; + else + ret.m_type = Type::ZeroIncreasing; + + return ret; +} + +CCharAnimTime CCharAnimTime::operator*(const CCharAnimTime& other) +{ + if (m_type == Type::Infinity && other.m_type == Type::Infinity) + { + if (other.m_time != m_time) + return CCharAnimTime(); + return *this; + } + else if (m_type == Type::Infinity) + return *this; + else if (other.m_type == Type::Infinity) + return other; + + if (!EqualsZero() || !other.EqualsZero()) + return CCharAnimTime(m_time * other.m_time); + + int type = -1; + if (m_type != Type::ZeroDecreasing) + { + if (m_type != Type::ZeroSteady) + type = 1; + else + type = 0; + } + + int otherType = -1; + if (other.m_type != Type::ZeroDecreasing) + { + if (other.m_type != Type::ZeroSteady) + otherType = 1; + else + otherType = 0; + } + + type += otherType; + otherType = std::max(-1, std::min(type, 1)); + + CCharAnimTime ret; + if (otherType == -1) + ret.m_type = Type::ZeroDecreasing; + else if (otherType == 0) + ret.m_type = Type::ZeroSteady; + else + ret.m_type = Type::ZeroIncreasing; + return ret; +} + +CCharAnimTime CCharAnimTime::operator*(const float& other) +{ + CCharAnimTime ret; + if (other == 0.f) + return ret; + + if (!EqualsZero()) + return CCharAnimTime(m_time * other); + + if (other > 0.f) + return *this; + else if (other == 0.f) + return ret; + + ret.m_type = m_type; + return ret; +} + +float CCharAnimTime::operator/(const CCharAnimTime& other) +{ + if (other.EqualsZero()) + return 0.f; + + return m_time / other.m_time; +} + } diff --git a/Runtime/Character/CCharAnimTime.hpp b/Runtime/Character/CCharAnimTime.hpp index 0827fd20b..98944efb2 100644 --- a/Runtime/Character/CCharAnimTime.hpp +++ b/Runtime/Character/CCharAnimTime.hpp @@ -1,205 +1,47 @@ #ifndef __PSHAG_CCHARANIMTIME_HPP__ #define __PSHAG_CCHARANIMTIME_HPP__ +#include + namespace urde { class CCharAnimTime { float m_time = 0.f; - int m_unk = 2; // enum? + enum class Type + { + NonZero, + ZeroIncreasing, + ZeroSteady, + ZeroDecreasing, + Infinity + } m_type = Type::ZeroSteady; public: CCharAnimTime() = default; CCharAnimTime(float time) : m_time(time), - m_unk(m_time != 0.f ? 0 : 2) - { - } + m_type(m_time != 0.f ? Type::NonZero : Type::ZeroSteady) {} - bool EqualsZero() const - { - if (m_unk == 1 || m_unk == 2 || m_unk == 3) - return false; + static CCharAnimTime Infinity(); + operator float() const {return m_time;} - return (m_time == 0.f); - } - - bool GreaterThanZero() const - { - if (EqualsZero()) - return false; - return (m_time > 0.f); - } -#if 1 - bool operator ==(const CCharAnimTime& other) const - { - return false; - } - - bool operator !=(const CCharAnimTime& other) const - { - return !(*this == other); - } - - bool operator>=(const CCharAnimTime& other) - { - if (*this == other) - return true; - - return (*this > other); - } - - bool operator<=(const CCharAnimTime& other) - { - if (*this == other) - return true; - - return (*this < other); - } - - bool operator >(const CCharAnimTime& other) const - { - return false; - } - - bool operator <(const CCharAnimTime& other) const - { - return false; - } - - CCharAnimTime& operator*=(const CCharAnimTime& other) - { - *this = *this * other; - return *this; - } - - CCharAnimTime& operator+=(const CCharAnimTime& other) - { - *this = *this + other; - return *this; - } - - CCharAnimTime operator+(const CCharAnimTime& other) - { - if (m_unk == 4 && other.m_unk == 4) - { - if (other.m_time != m_time) - return CCharAnimTime(); - return *this; - } - else if (m_unk == 4) - return *this; - else if (other.m_unk == 4) - return other; - - if (!EqualsZero() || !other.EqualsZero()) - return CCharAnimTime(m_time + other.m_time); - - int type = -1; - if (m_unk != 3) - { - if (m_unk != 2) - type = 1; - else - type = 0; - } - - int otherType = -1; - if (other.m_unk != 3) - { - if (other.m_unk != 2) - otherType = 1; - else - otherType = 0; - } - - type += otherType; - if (type < 1) - otherType = 1; - else - otherType = type; - - if (otherType < -1) - otherType = -1; - - CCharAnimTime ret; - if (otherType == -1) - ret.m_unk = 3; - else if (otherType == 0) - ret.m_unk = 2; - else - ret.m_unk = 1; - - return ret; - } - - CCharAnimTime operator*(const CCharAnimTime& other) - { - if (m_unk == 4 && other.m_unk == 4) - { - if (other.m_time != m_time) - return CCharAnimTime(); - return *this; - } - else if (m_unk == 4) - return *this; - else if (other.m_unk == 4) - return other; - - if (!EqualsZero() || !other.EqualsZero()) - return CCharAnimTime(m_time * other.m_time); - - int type = -1; - if (m_unk != 3) - { - if (m_unk != 2) - type = 1; - else - type = 0; - } - - int otherType = -1; - if (other.m_unk != 3) - { - if (other.m_unk != 2) - otherType = 1; - else - otherType = 0; - } - - type += otherType; - if (type < 1) - otherType = 1; - else - otherType = type; - - if (otherType < -1) - otherType = -1; - - CCharAnimTime ret; - if (otherType == -1) - ret.m_unk = 3; - else if (otherType == 0) - ret.m_unk = 2; - else - ret.m_unk = 1; - return ret; - } - - CCharAnimTime operator*(const float& other) - { - return CCharAnimTime(); - } - - float operator/(const CCharAnimTime& other) - { - if (other.EqualsZero()) - return 0.f; - - return m_time / other.m_time; - } - -#endif + bool EqualsZero() const; + bool GreaterThanZero() const; + bool operator ==(const CCharAnimTime& other) const; + bool operator !=(const CCharAnimTime& other) const; + bool operator>=(const CCharAnimTime& other); + bool operator<=(const CCharAnimTime& other); + bool operator >(const CCharAnimTime& other) const; + bool operator <(const CCharAnimTime& other) const; + CCharAnimTime& operator*=(const CCharAnimTime& other); + CCharAnimTime& operator+=(const CCharAnimTime& other); + CCharAnimTime operator+(const CCharAnimTime& other); + CCharAnimTime& operator-=(const CCharAnimTime& other); + CCharAnimTime operator-(const CCharAnimTime& other); + CCharAnimTime operator*(const CCharAnimTime& other); + CCharAnimTime operator*(const float& other); + float operator/(const CCharAnimTime& other); }; } diff --git a/Runtime/Character/CMakeLists.txt b/Runtime/Character/CMakeLists.txt index a82daa117..8db52cfeb 100644 --- a/Runtime/Character/CMakeLists.txt +++ b/Runtime/Character/CMakeLists.txt @@ -53,4 +53,5 @@ add_library(RuntimeCommonCharacter IAnimReader.hpp IAnimReader.cpp CPrimitive.hpp CPrimitive.cpp CHalfTransition.hpp CHalfTransition.cpp + CTimeScaleFunctions.hpp CTimeScaleFunctions.cpp CBodyState.hpp) diff --git a/Runtime/Character/CMetaAnimBlend.cpp b/Runtime/Character/CMetaAnimBlend.cpp index d39357eb8..9f6901313 100644 --- a/Runtime/Character/CMetaAnimBlend.cpp +++ b/Runtime/Character/CMetaAnimBlend.cpp @@ -1,10 +1,15 @@ #include "CMetaAnimBlend.hpp" +#include "CMetaAnimFactory.hpp" namespace urde { CMetaAnimBlend::CMetaAnimBlend(CInputStream& in) { + x4_animA = CMetaAnimFactory::CreateMetaAnim(in); + x8_animB = CMetaAnimFactory::CreateMetaAnim(in); + xc_blend = in.readFloatBig(); + x10_ = in.readBool(); } std::shared_ptr diff --git a/Runtime/Character/CMetaAnimBlend.hpp b/Runtime/Character/CMetaAnimBlend.hpp index e0c611897..532c1caa1 100644 --- a/Runtime/Character/CMetaAnimBlend.hpp +++ b/Runtime/Character/CMetaAnimBlend.hpp @@ -9,6 +9,10 @@ namespace urde class CMetaAnimBlend : public IMetaAnim { + std::shared_ptr x4_animA; + std::shared_ptr x8_animB; + float xc_blend; + bool x10_; public: CMetaAnimBlend(CInputStream& in); EMetaAnimType GetType() const {return EMetaAnimType::Blend;} diff --git a/Runtime/Character/CMetaAnimPhaseBlend.cpp b/Runtime/Character/CMetaAnimPhaseBlend.cpp index 44cdadb4a..cb0d2b488 100644 --- a/Runtime/Character/CMetaAnimPhaseBlend.cpp +++ b/Runtime/Character/CMetaAnimPhaseBlend.cpp @@ -1,10 +1,15 @@ #include "CMetaAnimPhaseBlend.hpp" +#include "CMetaAnimFactory.hpp" namespace urde { CMetaAnimPhaseBlend::CMetaAnimPhaseBlend(CInputStream& in) { + x4_animA = CMetaAnimFactory::CreateMetaAnim(in); + x8_animB = CMetaAnimFactory::CreateMetaAnim(in); + xc_blend = in.readFloatBig(); + x10_ = in.readBool(); } std::shared_ptr diff --git a/Runtime/Character/CMetaAnimPhaseBlend.hpp b/Runtime/Character/CMetaAnimPhaseBlend.hpp index f83dea123..62b1f9e50 100644 --- a/Runtime/Character/CMetaAnimPhaseBlend.hpp +++ b/Runtime/Character/CMetaAnimPhaseBlend.hpp @@ -9,6 +9,10 @@ namespace urde class CMetaAnimPhaseBlend : public IMetaAnim { + std::shared_ptr x4_animA; + std::shared_ptr x8_animB; + float xc_blend; + bool x10_; public: CMetaAnimPhaseBlend(CInputStream& in); EMetaAnimType GetType() const {return EMetaAnimType::PhaseBlend;} diff --git a/Runtime/Character/CMetaAnimPlay.cpp b/Runtime/Character/CMetaAnimPlay.cpp index 728afea3b..3a484e6ae 100644 --- a/Runtime/Character/CMetaAnimPlay.cpp +++ b/Runtime/Character/CMetaAnimPlay.cpp @@ -4,8 +4,7 @@ namespace urde { CMetaAnimPlay::CMetaAnimPlay(CInputStream& in) -{ -} +: x4_primitive(in), x1c_(in.readFloatBig()), x20_(in.readUint32Big()) {} std::shared_ptr CMetaAnimPlay::GetAnimationTree(const CAnimSysContext& animSys, diff --git a/Runtime/Character/CMetaAnimPlay.hpp b/Runtime/Character/CMetaAnimPlay.hpp index 1b3e8f9eb..c68893090 100644 --- a/Runtime/Character/CMetaAnimPlay.hpp +++ b/Runtime/Character/CMetaAnimPlay.hpp @@ -2,6 +2,7 @@ #define __PSHAG_CMETAANIMPLAY_HPP__ #include "IMetaAnim.hpp" +#include "CPrimitive.hpp" #include "IOStreams.hpp" namespace urde @@ -9,6 +10,9 @@ namespace urde class CMetaAnimPlay : public IMetaAnim { + CPrimitive x4_primitive; + float x1c_; + u32 x20_; public: CMetaAnimPlay(CInputStream& in); EMetaAnimType GetType() const {return EMetaAnimType::Primitive;} diff --git a/Runtime/Character/CMetaAnimRandom.cpp b/Runtime/Character/CMetaAnimRandom.cpp index 6213b8e77..42ada93ee 100644 --- a/Runtime/Character/CMetaAnimRandom.cpp +++ b/Runtime/Character/CMetaAnimRandom.cpp @@ -1,12 +1,27 @@ #include "CMetaAnimRandom.hpp" +#include "CMetaAnimFactory.hpp" namespace urde { -CMetaAnimRandom::CMetaAnimRandom(CInputStream& in) +CMetaAnimRandom::RandomData CMetaAnimRandom::CreateRandomData(CInputStream& in) { + CMetaAnimRandom::RandomData ret; + u32 randCount = in.readUint32Big(); + ret.reserve(randCount); + + for (u32 i=0 ; i metaAnim = CMetaAnimFactory::CreateMetaAnim(in); + ret.emplace_back(std::move(metaAnim), in.readUint32Big()); + } + + return ret; } +CMetaAnimRandom::CMetaAnimRandom(CInputStream& in) +: x4_randomData(CreateRandomData(in)) {} + std::shared_ptr CMetaAnimRandom::GetAnimationTree(const CAnimSysContext& animSys, const CMetaAnimTreeBuildOrders& orders) const diff --git a/Runtime/Character/CMetaAnimRandom.hpp b/Runtime/Character/CMetaAnimRandom.hpp index ce3d4ba43..6b817ea8d 100644 --- a/Runtime/Character/CMetaAnimRandom.hpp +++ b/Runtime/Character/CMetaAnimRandom.hpp @@ -9,6 +9,9 @@ namespace urde class CMetaAnimRandom : public IMetaAnim { + using RandomData = std::vector, u32>>; + RandomData x4_randomData; + static RandomData CreateRandomData(CInputStream& in); public: CMetaAnimRandom(CInputStream& in); EMetaAnimType GetType() const {return EMetaAnimType::Random;} diff --git a/Runtime/Character/CMetaAnimSequence.cpp b/Runtime/Character/CMetaAnimSequence.cpp index ed1ca4d2b..41494f741 100644 --- a/Runtime/Character/CMetaAnimSequence.cpp +++ b/Runtime/Character/CMetaAnimSequence.cpp @@ -1,12 +1,24 @@ #include "CMetaAnimSequence.hpp" +#include "CMetaAnimFactory.hpp" namespace urde { -CMetaAnimSequence::CMetaAnimSequence(CInputStream& in) +std::vector> CMetaAnimSequence::CreateSequence(CInputStream& in) { + std::vector> ret; + u32 seqCount = in.readUint32Big(); + ret.reserve(seqCount); + + for (u32 i=0 ; i CMetaAnimSequence::GetAnimationTree(const CAnimSysContext& animSys, const CMetaAnimTreeBuildOrders& orders) const diff --git a/Runtime/Character/CMetaAnimSequence.hpp b/Runtime/Character/CMetaAnimSequence.hpp index 8e873a759..2c2e9dbda 100644 --- a/Runtime/Character/CMetaAnimSequence.hpp +++ b/Runtime/Character/CMetaAnimSequence.hpp @@ -9,6 +9,8 @@ namespace urde class CMetaAnimSequence : public IMetaAnim { + std::vector> x4_sequence; + std::vector> CreateSequence(CInputStream& in); public: CMetaAnimSequence(CInputStream& in); EMetaAnimType GetType() const {return EMetaAnimType::Sequence;} diff --git a/Runtime/Character/CMetaTransFactory.cpp b/Runtime/Character/CMetaTransFactory.cpp index 515b69ee7..e57e4d11c 100644 --- a/Runtime/Character/CMetaTransFactory.cpp +++ b/Runtime/Character/CMetaTransFactory.cpp @@ -20,7 +20,7 @@ std::shared_ptr CMetaTransFactory::CreateMetaTrans(CInputStream& in) case EMetaTransType::PhaseTrans: return std::make_shared(in); case EMetaTransType::Snap: - return std::make_shared(in); + return std::make_shared(); default: break; } diff --git a/Runtime/Character/CMetaTransMetaAnim.cpp b/Runtime/Character/CMetaTransMetaAnim.cpp index 1310ff42e..4ac0b902e 100644 --- a/Runtime/Character/CMetaTransMetaAnim.cpp +++ b/Runtime/Character/CMetaTransMetaAnim.cpp @@ -1,11 +1,11 @@ #include "CMetaTransMetaAnim.hpp" +#include "CMetaAnimFactory.hpp" namespace urde { CMetaTransMetaAnim::CMetaTransMetaAnim(CInputStream& in) -{ -} +: x4_metaAnim(CMetaAnimFactory::CreateMetaAnim(in)) {} std::shared_ptr CMetaTransMetaAnim::VGetTransitionTree(const std::weak_ptr& a, diff --git a/Runtime/Character/CMetaTransMetaAnim.hpp b/Runtime/Character/CMetaTransMetaAnim.hpp index 0da282d6f..3e12932d6 100644 --- a/Runtime/Character/CMetaTransMetaAnim.hpp +++ b/Runtime/Character/CMetaTransMetaAnim.hpp @@ -2,6 +2,7 @@ #define __PSHAG_CMETATRANSMETAANIM_HPP__ #include "IMetaTrans.hpp" +#include "IMetaAnim.hpp" #include "IOStreams.hpp" namespace urde @@ -9,6 +10,7 @@ namespace urde class CMetaTransMetaAnim : public IMetaTrans { + std::shared_ptr x4_metaAnim; public: CMetaTransMetaAnim(CInputStream& in); EMetaTransType GetType() const {return EMetaTransType::MetaAnim;} diff --git a/Runtime/Character/CMetaTransPhaseTrans.cpp b/Runtime/Character/CMetaTransPhaseTrans.cpp index 13550f997..409a00678 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.cpp +++ b/Runtime/Character/CMetaTransPhaseTrans.cpp @@ -5,6 +5,11 @@ namespace urde CMetaTransPhaseTrans::CMetaTransPhaseTrans(CInputStream& in) { + x4_ = in.readFloatBig(); + x8_ = in.readUint32Big(); + xc_ = in.readBool(); + xd_ = in.readBool(); + x10_ = in.readUint32Big(); } std::shared_ptr diff --git a/Runtime/Character/CMetaTransPhaseTrans.hpp b/Runtime/Character/CMetaTransPhaseTrans.hpp index 472045714..a1f6de1b1 100644 --- a/Runtime/Character/CMetaTransPhaseTrans.hpp +++ b/Runtime/Character/CMetaTransPhaseTrans.hpp @@ -9,6 +9,11 @@ namespace urde class CMetaTransPhaseTrans : public IMetaTrans { + float x4_; + u32 x8_; + bool xc_; + bool xd_; + u32 x10_; public: CMetaTransPhaseTrans(CInputStream& in); EMetaTransType GetType() const {return EMetaTransType::PhaseTrans;} diff --git a/Runtime/Character/CMetaTransSnap.cpp b/Runtime/Character/CMetaTransSnap.cpp index 122ab93f9..5da19c7fa 100644 --- a/Runtime/Character/CMetaTransSnap.cpp +++ b/Runtime/Character/CMetaTransSnap.cpp @@ -3,15 +3,12 @@ namespace urde { -CMetaTransSnap::CMetaTransSnap(CInputStream& in) -{ -} - std::shared_ptr CMetaTransSnap::VGetTransitionTree(const std::weak_ptr& a, const std::weak_ptr& b, const CAnimSysContext& animSys) const { + return b.lock(); } } diff --git a/Runtime/Character/CMetaTransSnap.hpp b/Runtime/Character/CMetaTransSnap.hpp index 57a6a8658..204f22629 100644 --- a/Runtime/Character/CMetaTransSnap.hpp +++ b/Runtime/Character/CMetaTransSnap.hpp @@ -10,7 +10,6 @@ namespace urde class CMetaTransSnap : public IMetaTrans { public: - CMetaTransSnap(CInputStream& in); EMetaTransType GetType() const {return EMetaTransType::Snap;} std::shared_ptr VGetTransitionTree(const std::weak_ptr& a, diff --git a/Runtime/Character/CMetaTransTrans.cpp b/Runtime/Character/CMetaTransTrans.cpp index 3c31ded2e..720c626d8 100644 --- a/Runtime/Character/CMetaTransTrans.cpp +++ b/Runtime/Character/CMetaTransTrans.cpp @@ -1,10 +1,16 @@ #include "CMetaTransTrans.hpp" +#include "CAnimTreeTransition.hpp" namespace urde { CMetaTransTrans::CMetaTransTrans(CInputStream& in) { + x4_ = in.readFloatBig(); + x8_ = in.readUint32Big(); + xc_ = in.readBool(); + xd_ = in.readBool(); + x10_ = in.readUint32Big(); } std::shared_ptr @@ -12,6 +18,7 @@ CMetaTransTrans::VGetTransitionTree(const std::weak_ptr& a, const std::weak_ptr& b, const CAnimSysContext& animSys) const { + } } diff --git a/Runtime/Character/CMetaTransTrans.hpp b/Runtime/Character/CMetaTransTrans.hpp index d87daac99..9ddbdfe30 100644 --- a/Runtime/Character/CMetaTransTrans.hpp +++ b/Runtime/Character/CMetaTransTrans.hpp @@ -9,6 +9,11 @@ namespace urde class CMetaTransTrans : public IMetaTrans { + float x4_; + u32 x8_; + bool xc_; + bool xd_; + u32 x10_; public: CMetaTransTrans(CInputStream& in); EMetaTransType GetType() const {return EMetaTransType::Trans;} diff --git a/Runtime/Character/CPrimitive.cpp b/Runtime/Character/CPrimitive.cpp index e69de29bb..a2635ccdc 100644 --- a/Runtime/Character/CPrimitive.cpp +++ b/Runtime/Character/CPrimitive.cpp @@ -0,0 +1,13 @@ +#include "CPrimitive.hpp" + +namespace urde +{ + +CPrimitive::CPrimitive(CInputStream& in) +{ + x0_animId = in.readUint32Big(); + x4_animIdx = in.readUint32Big(); + x8_animName = in.readString(); +} + +} diff --git a/Runtime/Character/CPrimitive.hpp b/Runtime/Character/CPrimitive.hpp index 56b680e84..81548793e 100644 --- a/Runtime/Character/CPrimitive.hpp +++ b/Runtime/Character/CPrimitive.hpp @@ -1,11 +1,18 @@ #ifndef __PSHAG_CPRIMITIVE_HPP__ #define __PSHAG_CPRIMITIVE_HPP__ +#include "IOStreams.hpp" + namespace urde { class CPrimitive { + TResId x0_animId; + u32 x4_animIdx; + std::string x8_animName; +public: + CPrimitive(CInputStream& in); }; } diff --git a/Runtime/Character/CTimeScaleFunctions.cpp b/Runtime/Character/CTimeScaleFunctions.cpp new file mode 100644 index 000000000..73e876ab8 --- /dev/null +++ b/Runtime/Character/CTimeScaleFunctions.cpp @@ -0,0 +1,80 @@ +#include "CTimeScaleFunctions.hpp" +#include "CCharAnimTime.hpp" + +namespace urde +{ + +std::shared_ptr IVaryingAnimationTimeScale::Clone() const +{ + return VClone(); +} + +void CConstantAnimationTimeScale::VTimeScaleIntegral(const float&, const float&) const +{ +} + +void CConstantAnimationTimeScale::VFindUpperLimit(const float&, const float&) const +{ +} + +std::shared_ptr CConstantAnimationTimeScale::VClone() const +{ +} + +std::shared_ptr +CConstantAnimationTimeScale::VGetFunctionMirrored(const float&) const +{ + +} + +void CLinearAnimationTimeScale::VTimeScaleIntegral(const float&, const float&) const +{ +} + +void CLinearAnimationTimeScale::TimeScaleIntegralWithSortedLimits(const CFunctionDescription& desc, + const float&, const float&) +{ +} + +void CLinearAnimationTimeScale::VFindUpperLimit(const float&, const float&) const +{ +} + +void CLinearAnimationTimeScale::FindUpperLimitFromRoot(const CFunctionDescription& desc, + const float&, const float&) +{ +} + +std::shared_ptr CLinearAnimationTimeScale::VClone() const +{ + CCharAnimTime timeA(x10_); + CCharAnimTime timeB(xc_); + + CLinearAnimationTimeScale* ret = new CLinearAnimationTimeScale(); + float f30 = x4_ * xc_ + x8_; + ret->x4_ = (x4_ * x10_ + x8_ - f30) / timeB; + ret->x8_ = -((x4_ * x10_ + x8_ - f30) / (timeA - timeB) * timeB - f30); + ret->xc_ = timeB; + ret->x10_ = timeA; + + return std::shared_ptr(ret); +} + +std::shared_ptr +CLinearAnimationTimeScale::VGetFunctionMirrored(const float& parm) const +{ + float f27 = -(x4_ * parm * 2.f - x8_); + float f31 = -x4_ * parm * 2.f - x10_ + f27; + CCharAnimTime timeA(2.f * parm - xc_); + CCharAnimTime timeB(2.f * parm - x10_); + + CLinearAnimationTimeScale* ret = new CLinearAnimationTimeScale(); + ret->x4_ = (-x4_ * 2.f * parm - xc_ + f27 - f31) / (timeA - timeB); + ret->x8_ = -(((-x4_ * 2.f * parm - xc_ + f27 - f31) / (timeA - timeB)) * timeB - f31); + ret->xc_ = timeB; + ret->x10_ = timeA; + + return std::shared_ptr(ret); +} + +} diff --git a/Runtime/Character/CTimeScaleFunctions.hpp b/Runtime/Character/CTimeScaleFunctions.hpp new file mode 100644 index 000000000..8d5ec50ea --- /dev/null +++ b/Runtime/Character/CTimeScaleFunctions.hpp @@ -0,0 +1,59 @@ +#ifndef __PSHAG_CTIMESCALEFUNCTIONS_HPP__ +#define __PSHAG_CTIMESCALEFUNCTIONS_HPP__ + +#include "RetroTypes.hpp" + +namespace urde +{ + +enum class EVaryingAnimationTimeScaleType +{ + Constant, + Linear +}; + +class IVaryingAnimationTimeScale +{ +public: + virtual ~IVaryingAnimationTimeScale() = default; + virtual EVaryingAnimationTimeScaleType GetType() const=0; + virtual void VTimeScaleIntegral(const float&, const float&) const=0; + virtual void VFindUpperLimit(const float&, const float&) const=0; + virtual std::shared_ptr VClone() const=0; + virtual std::shared_ptr VGetFunctionMirrored(const float&) const=0; + std::shared_ptr Clone() const; +}; + +class CConstantAnimationTimeScale : public IVaryingAnimationTimeScale +{ +public: + EVaryingAnimationTimeScaleType GetType() const {return EVaryingAnimationTimeScaleType::Constant;} + void VTimeScaleIntegral(const float&, const float&) const; + void VFindUpperLimit(const float&, const float&) const; + std::shared_ptr VClone() const; + std::shared_ptr VGetFunctionMirrored(const float&) const; +}; + +class CLinearAnimationTimeScale : public IVaryingAnimationTimeScale +{ + float x4_; + float x8_; + float xc_; + float x10_; +public: + struct CFunctionDescription + { + }; + + EVaryingAnimationTimeScaleType GetType() const {return EVaryingAnimationTimeScaleType::Linear;} + void VTimeScaleIntegral(const float&, const float&) const; + void TimeScaleIntegralWithSortedLimits(const CFunctionDescription& desc, const float&, const float&); + void VFindUpperLimit(const float&, const float&) const; + void FindUpperLimitFromRoot(const CFunctionDescription& desc, const float&, const float&); + std::shared_ptr VClone() const; + std::shared_ptr VGetFunctionMirrored(const float&) const; +}; + +} + +#endif // __PSHAG_CTIMESCALEFUNCTIONS_HPP__ diff --git a/Runtime/Character/IAnimReader.cpp b/Runtime/Character/IAnimReader.cpp index e69de29bb..247537bf6 100644 --- a/Runtime/Character/IAnimReader.cpp +++ b/Runtime/Character/IAnimReader.cpp @@ -0,0 +1,14 @@ +#include "IAnimReader.hpp" +#include "CCharAnimTime.hpp" + +namespace urde +{ + +SAdvancementResults IAnimReader::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const +{ + SAdvancementResults ret; + ret.x0_animTime = a; + return ret; +} + +} diff --git a/Runtime/Character/IAnimReader.hpp b/Runtime/Character/IAnimReader.hpp index 40d37b747..362b144a6 100644 --- a/Runtime/Character/IAnimReader.hpp +++ b/Runtime/Character/IAnimReader.hpp @@ -1,11 +1,56 @@ #ifndef __PSHAG_IANIMREADER_HPP__ #define __PSHAG_IANIMREADER_HPP__ +#include "RetroTypes.hpp" +#include "CCharAnimTime.hpp" +#include "zeus/CVector3f.hpp" +#include "zeus/CQuaternion.hpp" + namespace urde { +class CSegId; +class CBoolPOINode; +class CInt32POINode; +class CParticlePOINode; +class CSoundPOINode; +class CSegIdList; +class CSegStatementSet; + +struct SAdvancementResults +{ + CCharAnimTime x0_animTime; + zeus::CVector3f x8_posDelta; + zeus::CQuaternion x14_rotDelta; +}; class IAnimReader { +public: + virtual ~IAnimReader() = default; + virtual bool IsCAnimTreeNode() const {return false;} + virtual void VAdvanceView(const CCharAnimTime& a)=0; + virtual void VGetTimeRemaining() const=0; + virtual void VGetSteadyStateAnimInfo() const=0; + virtual bool VHasOffset(const CSegId& seg) const=0; + virtual void VGetOffset(const CSegId& seg) const=0; + virtual void VGetRotation(const CSegId& seg) const=0; + virtual void VGetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, u32, u32, u32) const=0; + virtual void VGetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut, u32, u32, u32) const=0; + virtual void VGetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut, u32, u32, u32) const=0; + virtual void VGetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut, u32, u32, u32) const=0; + virtual void VGetBoolPOIState(const char*) const=0; + virtual void VGetInt32POIState(const char*) const=0; + virtual void VGetParticlePOIState(const char*) const=0; + virtual void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut) const=0; + virtual void VGetSegStatementSet(const CSegIdList& list, CSegStatementSet& setOut, const CCharAnimTime& time) const=0; + virtual void VClone() const=0; + virtual std::unique_ptr VSimplified() {return {};} + virtual void VSetPhase(float)=0; + virtual SAdvancementResults VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const; + virtual void Depth() const=0; + virtual void VGetContributionOfHighestInfluence() const=0; + virtual void VGetNumChildren() const=0; + virtual void VGetBestUnblendedChild() const=0; }; } diff --git a/Runtime/Character/IMetaTrans.hpp b/Runtime/Character/IMetaTrans.hpp index 953347808..0106f2d14 100644 --- a/Runtime/Character/IMetaTrans.hpp +++ b/Runtime/Character/IMetaTrans.hpp @@ -13,7 +13,7 @@ enum class EMetaTransType MetaAnim, Trans, PhaseTrans, - Snap, + Snap }; class IMetaTrans diff --git a/Runtime/IObjectStore.hpp b/Runtime/IObjectStore.hpp index d414a4816..5029deb0d 100644 --- a/Runtime/IObjectStore.hpp +++ b/Runtime/IObjectStore.hpp @@ -13,8 +13,8 @@ class IObjectStore public: virtual CToken GetObj(const SObjectTag&, const CVParamTransfer&)=0; virtual CToken GetObj(const SObjectTag&)=0; - virtual CToken GetObj(char const*)=0; - virtual CToken GetObj(char const*, const CVParamTransfer&)=0; + virtual CToken GetObj(const char*)=0; + virtual CToken GetObj(const char*, const CVParamTransfer&)=0; virtual bool HasObject(const SObjectTag&) const=0; virtual bool ObjectIsLive(const SObjectTag&) const=0; virtual IFactory& GetFactory() const=0;