forked from godotengine/FBX2glTF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkinData.cpp
More file actions
41 lines (36 loc) · 1.03 KB
/
SkinData.cpp
File metadata and controls
41 lines (36 loc) · 1.03 KB
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
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "SkinData.hpp"
#include "AccessorData.hpp"
#include "NodeData.hpp"
SkinData::SkinData(
const std::vector<uint32_t> joints,
const AccessorData& inverseBindMatricesAccessor,
const NodeData& skeletonRootNode)
: Holdable(),
joints(joints),
inverseBindMatrices(inverseBindMatricesAccessor.ix),
skeletonRootNode(skeletonRootNode.ix),
isExtraSkin(false) {}
SkinData::SkinData(
const std::vector<uint32_t> joints,
bool isExtraSkin)
: Holdable(),
joints(joints),
inverseBindMatrices(0),
skeletonRootNode(0),
isExtraSkin(true) {}
json SkinData::serialize() const {
if (isExtraSkin) {
return {{"joints", joints}};
}
return {
{"joints", joints},
{"inverseBindMatrices", inverseBindMatrices},
{"skeleton", skeletonRootNode}};
}