2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/IOStreams.hpp"
|
|
|
|
#include "Runtime/Character/CPASAnimInfo.hpp"
|
|
|
|
#include "Runtime/Character/CPASParmInfo.hpp"
|
2016-04-10 04:49:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-04-27 19:59:38 +00:00
|
|
|
class CRandom16;
|
|
|
|
class CPASAnimParmData;
|
2018-12-08 05:30:43 +00:00
|
|
|
class CPASAnimState {
|
|
|
|
s32 x0_id;
|
|
|
|
std::vector<CPASParmInfo> x4_parms;
|
|
|
|
std::vector<CPASAnimInfo> x14_anims;
|
2020-02-28 09:33:39 +00:00
|
|
|
mutable std::vector<s32> x24_selectionCache;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2016-04-10 04:49:02 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CPASAnimState(CInputStream& in);
|
|
|
|
CPASAnimState(int stateId);
|
|
|
|
s32 GetStateId() const { return x0_id; }
|
|
|
|
s32 GetNumAnims() const { return x14_anims.size(); }
|
|
|
|
CPASAnimParm GetAnimParmData(s32, u32) const;
|
|
|
|
s32 PickRandomAnimation(CRandom16& rand) const;
|
|
|
|
std::pair<float, s32> FindBestAnimation(const rstl::reserved_vector<CPASAnimParm, 8>&, CRandom16&, s32) const;
|
|
|
|
float ComputeExactMatchWeight(u32, const CPASAnimParm&, CPASAnimParm::UParmValue) const;
|
|
|
|
float ComputePercentErrorWeight(u32, const CPASAnimParm&, CPASAnimParm::UParmValue) const;
|
|
|
|
float ComputeAngularPercentErrorWeight(u32, const CPASAnimParm&, CPASAnimParm::UParmValue) const;
|
2016-04-10 04:49:02 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|