A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
AnmMgr.hh
1#pragma once
2
3#include "game/system/ResourceManager.hh"
4
5#include <abstract/g3d/ResFile.hh>
6
7namespace Render {
8
9class DrawMdl;
10
11enum class AnmType : s32 {
12 Empty = -1,
13 Chr = 0,
14 Clr = 1,
15 Srt = 2,
16 Pat = 3,
17 Shp = 4,
18 Max = 5,
19};
20
22public:
23 AnmNodeChr(Abstract::g3d::AnmObjChrRes anmObjChrRes, AnmType anmType, size_t idx)
24 : m_anmObjChrRes(anmObjChrRes), m_anmType(anmType), m_idx(idx) {}
25
26 [[nodiscard]] f32 frameCount() const {
27 return static_cast<f32>(m_anmObjChrRes.frameCount());
28 }
29
30private:
31 Abstract::g3d::AnmObjChrRes m_anmObjChrRes;
32 AnmType m_anmType;
33 size_t m_idx;
34};
35
36class AnmMgr {
37public:
39 AnmMgr(DrawMdl *drawMdl) : m_parent(drawMdl) {}
40
41 void linkAnims(size_t idx, const Abstract::g3d::ResFile *resFile, const char *name,
42 AnmType anmType);
43 void playAnim(f32 frame, f32 rate, size_t idx);
44
46 [[nodiscard]] const AnmNodeChr *activeAnim(AnmType anmType) const {
47 return m_activeAnims[static_cast<size_t>(anmType)];
48 }
49
50private:
51 DrawMdl *m_parent;
52 std::list<AnmNodeChr> m_anmList;
53 std::array<AnmNodeChr *, static_cast<size_t>(AnmType::Max) - 1> m_activeAnims;
54};
55
56} // namespace Render
Represents a binary resource file which contains object models, textures, and animations.
Definition ResFile.hh:15
Pertains to rendering the kart model.