mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-13 15:16:28 +00:00
Added support for loading uncompressed animations and playing them back
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "CCharacterNode.h"
|
||||
#include <Core/Render/CRenderer.h>
|
||||
#include "Core/Render/CRenderer.h"
|
||||
#include <Common/CTimer.h>
|
||||
|
||||
CCharacterNode::CCharacterNode(CScene *pScene, u32 NodeID, CAnimSet *pChar /*= 0*/, CSceneNode *pParent /*= 0*/)
|
||||
: CSceneNode(pScene, NodeID, pParent)
|
||||
@@ -34,6 +35,8 @@ void CCharacterNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& /*rkVi
|
||||
void CCharacterNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, const SViewInfo& /*rkViewInfo*/)
|
||||
{
|
||||
CSkeleton *pSkel = mpCharacter->NodeSkeleton(mActiveCharSet);
|
||||
CAnimation *pAnim = mpCharacter->Animation(mActiveAnim);
|
||||
pSkel->UpdateTransform(pAnim, (float) CTimer::GlobalTime(), false);
|
||||
pSkel->Draw(Options);
|
||||
}
|
||||
|
||||
@@ -62,3 +65,8 @@ void CCharacterNode::SetActiveCharSet(u32 CharIndex)
|
||||
MarkTransformChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void CCharacterNode::SetActiveAnim(u32 AnimIndex)
|
||||
{
|
||||
mActiveAnim = AnimIndex;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ class CCharacterNode : public CSceneNode
|
||||
{
|
||||
TResPtr<CAnimSet> mpCharacter;
|
||||
u32 mActiveCharSet;
|
||||
u32 mActiveAnim;
|
||||
|
||||
public:
|
||||
explicit CCharacterNode(CScene *pScene, u32 NodeID, CAnimSet *pChar = 0, CSceneNode *pParent = 0);
|
||||
@@ -19,9 +20,11 @@ public:
|
||||
virtual SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
inline CAnimSet* Character() const { return mpCharacter; }
|
||||
inline u32 ActiveCharSet() const { return mActiveCharSet; }
|
||||
inline u32 ActiveAnim() const { return mActiveAnim; }
|
||||
|
||||
void SetCharacter(CAnimSet *pChar);
|
||||
void SetActiveCharSet(u32 CharIndex);
|
||||
void SetActiveAnim(u32 AnimIndex);
|
||||
};
|
||||
|
||||
#endif // CCHARACTERNODE_H
|
||||
|
||||
Reference in New Issue
Block a user