Skip to content

Commit 9ce142d

Browse files
Updated boneId to boneIndices, relocated boneMatrices from Mesh to Model, added currentPose
1 parent 2bbd53d commit 9ce142d

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

include/MeshUnmanaged.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ class MeshUnmanaged : public ::Mesh {
3535
indices = nullptr;
3636
animVertices = nullptr;
3737
animNormals = nullptr;
38-
boneIds = nullptr;
38+
boneIndices = nullptr;
3939
boneWeights = nullptr;
40-
boneMatrices = nullptr;
4140
boneCount = 0;
4241
vaoId = 0;
4342
vboId = nullptr;
@@ -130,7 +129,7 @@ class MeshUnmanaged : public ::Mesh {
130129
GETTERSETTER(unsigned short*, Indices, indices) // NOLINT
131130
GETTERSETTER(float*, AnimVertices, animVertices)
132131
GETTERSETTER(float*, AnimNormals, animNormals)
133-
GETTERSETTER(unsigned char*, BoneIds, boneIds)
132+
GETTERSETTER(unsigned char*, BoneIndices, boneIndices)
134133
GETTERSETTER(float*, BoneWeights, boneWeights)
135134
GETTERSETTER(unsigned int, VaoId, vaoId)
136135
GETTERSETTER(unsigned int*, VboId, vboId)
@@ -242,9 +241,8 @@ class MeshUnmanaged : public ::Mesh {
242241
indices = mesh.indices;
243242
animVertices = mesh.animVertices;
244243
animNormals = mesh.animNormals;
245-
boneIds = mesh.boneIds;
244+
boneIndices = mesh.boneIndices;
246245
boneWeights = mesh.boneWeights;
247-
boneMatrices = mesh.boneMatrices;
248246
vaoId = mesh.vaoId;
249247
vboId = mesh.vboId;
250248
}

include/Model.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ class Model : public ::Model {
5959
other.materials = nullptr;
6060
other.meshMaterial = nullptr;
6161

62-
/*
63-
The Animation Data is now stored within a separate struct called
64-
`ModelSkeleton`. The changes below reflect this update.
65-
*/
6662
other.skeleton.boneCount = 0;
6763
other.skeleton.bones = nullptr;
6864
other.skeleton.bindPose = nullptr;
65+
66+
ModelAnimPose currentPose;
67+
Matrix *boneMatrices;
6968
}
7069

7170
GETTERSETTER(::Matrix, Transform, transform)
@@ -77,6 +76,8 @@ class Model : public ::Model {
7776
GETTERSETTER(int, BoneCount, skeleton.boneCount)
7877
GETTERSETTER(::BoneInfo*, Bones, skeleton.bones)
7978
GETTERSETTER(::Transform*, BindPose, skeleton.bindPose)
79+
GETTERSETTER(::ModelAnimPose, CurrentPose, currentPose)
80+
GETTERSETTER(::Matrix*, BoneMatrices, boneMatrices)
8081

8182
Model& operator=(const ::Model& model) {
8283
set(model);
@@ -101,6 +102,8 @@ class Model : public ::Model {
101102
other.skeleton.boneCount = 0;
102103
other.skeleton.bones = nullptr;
103104
other.skeleton.bindPose = nullptr;
105+
other.currentPose = nullptr;
106+
other.boneMatrices = nullptr;
104107

105108
return *this;
106109
}
@@ -248,6 +251,8 @@ class Model : public ::Model {
248251
skeleton.boneCount = model.skeleton.boneCount;
249252
skeleton.bones = model.skeleton.bones;
250253
skeleton.bindPose = model.skeleton.bindPose;
254+
currentPose = model.currentPose;
255+
boneMatrices = model.boneMatrices;
251256
}
252257
};
253258

0 commit comments

Comments
 (0)