Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
skin.h
1#ifndef OE_SCENE_SKIN_H
2#define OE_SCENE_SKIN_H
3
4#include "../common.h"
5
6#include <vector>
7#include <string>
8#include <glm/mat4x4.hpp>
9
10#include "vertex.h"
11#include "aabb.h"
12
13namespace oe::scene
14{
15 class Node;
16}
17
19{
23 struct Bone
24 {
26 Node* node = nullptr;
27
29 glm::mat4 inverse_bind_matrix = glm::mat4(1.0);
30
33
36 };
37
43 {
46
48 glm::vec3 position;
49
50 // Todo, normals, etc...
51 };
52
53 //class SkinnedMeshNode;
54
56 {
57 public:
61 BlendShapeManager(size_t count, size_t vertices);
62
66 std::vector<uint8_t> getPackedData();
67
71 size_t getIdFromName(const std::string& name);
72
76 void addBlendShape(const std::string& name, const std::vector<BlendShapeData>& blendshape_data/*, const size_t idSubMesh = 0*/);
77
82 void setWeight(const std::string& name, const float weight);
83
87 const std::vector<float>& getAllWeights() const { return _weights; }
88
93
94 inline uint32_t getCount() { return _count; }
95 inline uint32_t getTotalAffectedVerticesCount() { return _vertices_count; }
96
97 private:
98 uint32_t _count = 0;
99 uint32_t _vertices_count = 0;
100 std::vector<float> _blendshape_raw_data;
101
102 std::vector<std::string> _names;
103 std::vector<float> _weights;
104 };
105}
106
107#endif
Axis-aligned bounding box.
Definition aabb.h:13
Definition node.h:31
const std::vector< float > & getAllWeights() const
Definition skin.h:87
std::vector< uint8_t > getPackedData()
size_t getIdFromName(const std::string &name)
BlendShapeManager(size_t count, size_t vertices)
void setWeight(const std::string &name, const float weight)
void addBlendShape(const std::string &name, const std::vector< BlendShapeData > &blendshape_data)
Helpers and classes related to skinned meshes.
Definition skin.h:19
Scene related management (Render-agnostic Geometry, Manger, etc...)
Definition debug.h:19
uint32_t index_t
Definition vertex.h:17
index_t index
Definition skin.h:45
glm::vec3 position
Definition skin.h:48
Skinned mesh bone.
Definition skin.h:24
AABB raw_bounding_box
Definition skin.h:32
Node * node
Definition skin.h:26
glm::mat4 inverse_bind_matrix
Definition skin.h:29
AABB bounding_box
Definition skin.h:35