2016-04-12 22:28:08 +00:00
|
|
|
#include "CAnimData.hpp"
|
|
|
|
#include "CCharacterInfo.hpp"
|
|
|
|
#include "CCharLayoutInfo.hpp"
|
|
|
|
#include "Graphics/CSkinnedModel.hpp"
|
|
|
|
#include "CCharacterFactory.hpp"
|
|
|
|
#include "CAnimationManager.hpp"
|
|
|
|
#include "CTransitionManager.hpp"
|
2016-04-16 03:24:25 +00:00
|
|
|
#include "CAdditiveAnimPlayback.hpp"
|
2016-04-16 21:49:47 +00:00
|
|
|
#include "CBoolPOINode.hpp"
|
|
|
|
#include "CInt32POINode.hpp"
|
|
|
|
#include "CParticlePOINode.hpp"
|
|
|
|
#include "CSoundPOINode.hpp"
|
|
|
|
#include "CParticleGenInfo.hpp"
|
2016-04-14 21:42:47 +00:00
|
|
|
#include "IAnimReader.hpp"
|
2016-04-16 21:49:47 +00:00
|
|
|
#include "CAnimTreeNode.hpp"
|
2016-08-21 00:04:50 +00:00
|
|
|
#include "CAnimPerSegmentData.hpp"
|
|
|
|
#include "CSegStatementSet.hpp"
|
2016-04-12 22:28:08 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-04-16 21:49:47 +00:00
|
|
|
rstl::reserved_vector<CBoolPOINode, 8>CAnimData::g_BoolPOINodes;
|
|
|
|
rstl::reserved_vector<CInt32POINode, 16> CAnimData::g_Int32POINodes;
|
|
|
|
rstl::reserved_vector<CParticlePOINode, 20> CAnimData::g_ParticlePOINodes;
|
|
|
|
rstl::reserved_vector<CSoundPOINode, 20> CAnimData::g_SoundPOINodes;
|
2016-04-12 22:28:08 +00:00
|
|
|
|
2016-04-14 03:32:27 +00:00
|
|
|
void CAnimData::FreeCache()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::InitializeCache()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-15 03:02:21 +00:00
|
|
|
CAnimData::CAnimData(ResId id,
|
|
|
|
const CCharacterInfo& character,
|
|
|
|
int defaultAnim, int charIdx, bool loop,
|
2016-04-12 22:28:08 +00:00
|
|
|
const TLockedToken<CCharLayoutInfo>& layout,
|
|
|
|
const TToken<CSkinnedModel>& model,
|
2016-04-29 10:08:46 +00:00
|
|
|
const rstl::optional_object<TToken<CMorphableSkinnedModel>>& iceModel,
|
2016-04-12 22:28:08 +00:00
|
|
|
const std::weak_ptr<CAnimSysContext>& ctx,
|
|
|
|
const std::shared_ptr<CAnimationManager>& animMgr,
|
|
|
|
const std::shared_ptr<CTransitionManager>& transMgr,
|
|
|
|
const TLockedToken<CCharacterFactory>& charFactory)
|
2016-05-21 03:02:09 +00:00
|
|
|
: x0_charFactory(charFactory),
|
|
|
|
xc_charInfo(character),
|
|
|
|
xcc_layoutData(layout),
|
|
|
|
xd8_modelData(model),
|
|
|
|
xfc_animCtx(ctx.lock()),
|
|
|
|
x100_animMgr(animMgr),
|
|
|
|
x1d8_selfId(id),
|
|
|
|
x1fc_transMgr(transMgr),
|
|
|
|
x204_charIdx(charIdx),
|
|
|
|
x208_defaultAnim(defaultAnim),
|
2016-08-21 00:04:50 +00:00
|
|
|
x220_25_loop(loop),
|
|
|
|
x224_pose(layout->GetSegIdList().GetList().size()),
|
|
|
|
x2fc_poseBuilder(layout)
|
2016-04-12 22:28:08 +00:00
|
|
|
{
|
2016-04-15 03:02:21 +00:00
|
|
|
if (iceModel)
|
|
|
|
xe4_iceModelData = *iceModel;
|
2016-04-16 21:49:47 +00:00
|
|
|
|
|
|
|
g_BoolPOINodes.resize(8);
|
|
|
|
g_Int32POINodes.resize(16);
|
|
|
|
g_ParticlePOINodes.resize(20);
|
|
|
|
g_SoundPOINodes.resize(20);
|
|
|
|
|
|
|
|
x108_aabb = xd8_modelData->GetModel()->GetAABB();
|
|
|
|
x120_particleDB.CacheParticleDesc(xc_charInfo.GetParticleResData());
|
2016-04-12 22:28:08 +00:00
|
|
|
}
|
|
|
|
|
2016-04-16 03:24:25 +00:00
|
|
|
ResId CAnimData::GetEventResourceIdForAnimResourceId(ResId id) const
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-04-16 03:24:25 +00:00
|
|
|
return x0_charFactory->GetEventResourceIdForAnimResourceId(id);
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::AddAdditiveSegData(const CSegIdList& list, CSegStatementSet& stSet)
|
2016-04-16 21:49:47 +00:00
|
|
|
{
|
2016-08-21 00:04:50 +00:00
|
|
|
for (std::pair<u32, CAdditiveAnimPlayback>& additive : x1048_additiveAnims)
|
2016-04-16 21:49:47 +00:00
|
|
|
if (additive.second.GetTargetWeight() > 0.00001f)
|
|
|
|
additive.second.AddToSegStatementSet(list, *xcc_layoutData.GetObj(), stSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void AdvanceAnimationTree(std::weak_ptr<CAnimTreeNode>& anim, const CCharAnimTime& dt)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-16 21:49:47 +00:00
|
|
|
void CAnimData::AdvanceAdditiveAnims(float dt)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-04-16 21:49:47 +00:00
|
|
|
CCharAnimTime time(dt);
|
|
|
|
|
2016-08-21 00:04:50 +00:00
|
|
|
for (std::pair<u32, CAdditiveAnimPlayback>& additive : x1048_additiveAnims)
|
2016-04-16 21:49:47 +00:00
|
|
|
{
|
|
|
|
if (additive.second.GetA())
|
|
|
|
{
|
|
|
|
while (time.GreaterThanZero() && std::fabs(time) >= 0.00001f)
|
|
|
|
{
|
|
|
|
//additive.second.GetAnim()->GetInt32POIList(time, );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::UpdateAdditiveAnims(float)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CAnimData::IsAdditiveAnimation(u32) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return false;
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<CAnimTreeNode> CAnimData::GetAdditiveAnimationTree(u32) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CAnimData::IsAdditiveAnimationActive(u32) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return false;
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::DelAdditiveAnimation(u32)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::AddAdditiveAnimation(u32, float, bool, bool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<CAnimationManager> CAnimData::GetAnimationManager()
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetPhase(float)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::Touch(const CSkinnedModel& model, int) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-14 21:42:47 +00:00
|
|
|
SAdvancementDeltas CAnimData::GetAdvancementDeltas(const CCharAnimTime& a,
|
|
|
|
const CCharAnimTime& b) const
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CCharAnimTime CAnimData::GetTimeOfUserEvent(EUserEventType, const CCharAnimTime& time) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::MultiplyPlaybackRate(float)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetPlaybackRate(float)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetRandomPlaybackRate(CRandom16&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
|
2016-05-21 03:02:09 +00:00
|
|
|
const std::weak_ptr<CAnimTreeNode>& node)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CTransform CAnimData::GetLocatorTransform(CSegId id, const CCharAnimTime* time) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CTransform CAnimData::GetLocatorTransform(const std::string& name, const CCharAnimTime* time) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CAnimData::IsAnimTimeRemaining(float, const std::string& name) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return false;
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float CAnimData::GetAnimTimeRemaining(const std::string& name) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return 0.f;
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float CAnimData::GetAnimationDuration(int) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return 0.f;
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<CAnimSysContext> CAnimData::GetAnimSysContext() const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::shared_ptr<CAnimationManager> CAnimData::GetAnimationManager() const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
2016-08-21 00:04:50 +00:00
|
|
|
void CAnimData::RecalcPoseBuilder(const CCharAnimTime* time)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-08-21 00:04:50 +00:00
|
|
|
const CSegIdList& segIdList = GetCharLayoutInfo().GetSegIdList();
|
|
|
|
CSegStatementSet segSet;
|
|
|
|
if (time)
|
|
|
|
x1f8_animRoot->VGetSegStatementSet(segIdList, segSet, *time);
|
|
|
|
else
|
|
|
|
x1f8_animRoot->VGetSegStatementSet(segIdList, segSet);
|
|
|
|
|
|
|
|
AddAdditiveSegData(segIdList, segSet);
|
|
|
|
for (const CSegId& id : segIdList.GetList())
|
|
|
|
{
|
|
|
|
if (id == 3)
|
|
|
|
continue;
|
|
|
|
CAnimPerSegmentData& segData = segSet[id];
|
|
|
|
x2fc_poseBuilder.Insert(id, segData.x0_rotation, segData.x10_offset);
|
|
|
|
}
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::RenderAuxiliary(const CFrustumPlanes& frustum) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::Render(const CSkinnedModel& model, const CModelFlags& drawFlags,
|
2016-04-29 10:08:46 +00:00
|
|
|
const rstl::optional_object<CVertexMorphEffect>& morphEffect,
|
2016-04-14 03:32:27 +00:00
|
|
|
const float* morphMagnitudes) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetupRender(const CSkinnedModel& model,
|
2016-04-29 10:08:46 +00:00
|
|
|
const rstl::optional_object<CVertexMorphEffect>& morphEffect,
|
2016-04-14 03:32:27 +00:00
|
|
|
const float* morphMagnitudes) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::PreRender()
|
|
|
|
{
|
2016-08-21 00:04:50 +00:00
|
|
|
if (!x220_31_poseCached)
|
|
|
|
{
|
|
|
|
RecalcPoseBuilder(nullptr);
|
|
|
|
x220_31_poseCached = true;
|
|
|
|
x220_30_ = false;
|
|
|
|
}
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::BuildPose()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::PrimitiveSetToTokenVector(const std::set<CPrimitive>& primSet, std::vector<CToken>& tokensOut)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set<CPrimitive>& primsOut) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetAnimation(const CAnimPlaybackParms& parms, bool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::DoAdvance(float, bool&, CRandom16&, bool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-04-14 21:42:47 +00:00
|
|
|
SAdvancementDeltas CAnimData::Advance(float, const zeus::CVector3f&, CStateManager& stateMgr, bool)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
2016-04-14 21:42:47 +00:00
|
|
|
SAdvancementDeltas CAnimData::AdvanceIgnoreParticles(float, CRandom16&, bool)
|
2016-04-14 03:32:27 +00:00
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::AdvanceAnim(CCharAnimTime& time, zeus::CVector3f&, zeus::CQuaternion&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetXRayModel(const TLockedToken<CModel>& model, const TLockedToken<CSkinRules>& skinRules)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::SetInfraModel(const TLockedToken<CModel>& model, const TLockedToken<CSkinRules>& skinRules)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CAnimData::PoseSkinnedModel(const CSkinnedModel& model, const CPoseAsTransforms& pose,
|
2016-04-29 10:08:46 +00:00
|
|
|
const rstl::optional_object<CVertexMorphEffect>& morphEffect,
|
2016-04-14 03:32:27 +00:00
|
|
|
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
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CAABox CAnimData::GetBoundingBox(const zeus::CTransform& xf) const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zeus::CAABox CAnimData::GetBoundingBox() const
|
|
|
|
{
|
2016-05-21 03:02:09 +00:00
|
|
|
return {};
|
2016-04-14 03:32:27 +00:00
|
|
|
}
|
|
|
|
|
2016-04-12 22:28:08 +00:00
|
|
|
}
|