mirror of https://github.com/AxioDL/metaforce.git
CAnimData and CModelData stubs
This commit is contained in:
parent
a2f400274f
commit
f6c35bfc9b
|
@ -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<CINF> 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<CINF>::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<std::string, atInt32>& idMap, std::map<std::string, int>& 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<std::string, atInt32>& idMap)
|
||||
{
|
||||
idMap.reserve(armature.bones.size());
|
||||
bones.reserve(armature.bones.size());
|
||||
|
||||
std::map<std::string, int> 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -37,172 +37,20 @@ struct CINF : BigDNA
|
|||
};
|
||||
Vector<Name, DNA_COUNT(nameCount)> 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<CINF> 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<CINF>::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<std::string, atInt32>& idMap, std::map<std::string, int>& 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<std::string, atInt32>& idMap, std::map<std::string, int>& 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<std::string, atInt32>& idMap)
|
||||
{
|
||||
idMap.reserve(armature.bones.size());
|
||||
bones.reserve(armature.bones.size());
|
||||
|
||||
std::map<std::string, int> 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<std::string, atInt32>& idMap);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ add_library(DNAMP1
|
|||
STRG.hpp STRG.cpp
|
||||
ANCS.cpp
|
||||
ANIM.cpp
|
||||
CINF.cpp
|
||||
EVNT.cpp
|
||||
CMDL.hpp
|
||||
CMDLMaterials.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<CCharLayoutInfo>& layout,
|
||||
const TToken<CSkinnedModel>& 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<CAnimTreeNode> CAnimData::GetAdditiveAnimationTree(u32) const
|
||||
{
|
||||
}
|
||||
|
||||
bool CAnimData::IsAdditiveAnimationActive(u32) const
|
||||
{
|
||||
}
|
||||
|
||||
void CAnimData::DelAdditiveAnimation(u32)
|
||||
{
|
||||
}
|
||||
|
||||
void CAnimData::AddAdditiveAnimation(u32, float, bool, bool)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<CAnimationManager> 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<CAnimTreeNode>& 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<CAnimSysContext> CAnimData::GetAnimSysContext() const
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<CAnimationManager> 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<CVertexMorphEffect>& morphEffect,
|
||||
const float* morphMagnitudes) const
|
||||
{
|
||||
}
|
||||
|
||||
void CAnimData::SetupRender(const CSkinnedModel& model,
|
||||
const std::experimental::optional<CVertexMorphEffect>& morphEffect,
|
||||
const float* morphMagnitudes) const
|
||||
{
|
||||
}
|
||||
|
||||
void CAnimData::PreRender()
|
||||
{
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
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<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,
|
||||
const std::experimental::optional<CVertexMorphEffect>& 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
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
#include "CParticleDatabase.hpp"
|
||||
#include "CPoseAsTransforms.hpp"
|
||||
#include "CHierarchyPoseBuilder.hpp"
|
||||
#include <set>
|
||||
|
||||
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<CAnimationManager>& animMgr,
|
||||
const std::shared_ptr<CTransitionManager>& transMgr,
|
||||
const TLockedToken<CCharacterFactory>& 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<CAnimTreeNode> GetAdditiveAnimationTree(u32) const;
|
||||
bool IsAdditiveAnimationActive(u32) const;
|
||||
void DelAdditiveAnimation(u32);
|
||||
void AddAdditiveAnimation(u32, float, bool, bool);
|
||||
std::shared_ptr<CAnimationManager> 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<CAnimTreeNode>& 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<CAnimSysContext> GetAnimSysContext() const;
|
||||
std::shared_ptr<CAnimationManager> 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<CVertexMorphEffect>& morphEffect,
|
||||
const float* morphMagnitudes) const;
|
||||
void SetupRender(const CSkinnedModel& model,
|
||||
const std::experimental::optional<CVertexMorphEffect>& morphEffect,
|
||||
const float* morphMagnitudes) const;
|
||||
void PreRender();
|
||||
void BuildPose();
|
||||
void PrimitiveSetToTokenVector(const std::set<CPrimitive>& primSet, std::vector<CToken>& tokensOut);
|
||||
void GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set<CPrimitive>& 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<CModel>& model, const TLockedToken<CSkinRules>& skinRules);
|
||||
void SetInfraModel(const TLockedToken<CModel>& model, const TLockedToken<CSkinRules>& skinRules);
|
||||
|
||||
void PoseSkinnedModel(const CSkinnedModel& model, const CPoseAsTransforms& pose,
|
||||
const std::experimental::optional<CVertexMorphEffect>& 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();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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<TResId, TResId>& modelSkin)
|
||||
{
|
||||
}
|
||||
|
||||
void CModelData::SetInfraModel(const std::pair<TResId, TResId>& 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
|
||||
{
|
||||
}
|
||||
|
||||
}
|
|
@ -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<CAnimData> xc_animData;
|
||||
TLockedToken<CModel> x1c_normalModel;
|
||||
TLockedToken<CModel> x2c_xrayModel;
|
||||
TLockedToken<CModel> 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<TResId, TResId>& modelSkin);
|
||||
void SetInfraModel(const std::pair<TResId, TResId>& 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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue