/
MeshComponent.h
42 lines (33 loc) · 985 Bytes
/
MeshComponent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Copyright (c) 2018 Isetta
*/
#pragma once
#include <string>
#include "Core/Math/Math.h"
#include "Horde3D/Horde3D/Bindings/C++/Horde3D.h"
#include "SID/sid.h"
#include "Scene/Component.h"
namespace Isetta {
DEFINE_COMPONENT(MeshComponent, Component, false)
H3DNode renderNode{0};
H3DRes renderResource{0};
std::unordered_map<StringId, H3DNode> joints;
explicit MeshComponent(std::string_view resourceName);
~MeshComponent();
void UpdateTransform() const;
protected:
static H3DRes LoadResourceFromFile(std::string_view resourceName);
void OnEnable() override;
void OnDisable() override;
void OnDestroy() override;
friend class AnimationComponent;
friend class Entity;
friend class MemoryManager;
friend class FreeListAllocator;
friend class RenderModule;
public:
std::tuple<Math::Vector3, Math::Quaternion> GetJointWorldTransform(
std::string jointName);
static class RenderModule* renderModule;
DEFINE_COMPONENT_END(MeshComponent, Component)
} // namespace Isetta