Overte C++ Documentation
PrepareJointsTask.h
1 //
2 // PrepareJointsTask.h
3 // model-baker/src/model-baker
4 //
5 // Created by Sabrina Shanman on 2019/01/25.
6 // Copyright 2019 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_PrepareJointsTask_h
13 #define hifi_PrepareJointsTask_h
14 
15 #include <shared/HifiTypes.h>
16 #include <hfm/HFM.h>
17 
18 #include "Engine.h"
19 #include "BakerTypes.h"
20 
21 // The property "passthrough", when enabled, will let the input joints flow to the output unmodified, unlike the disabled property, which discards the data
22 class PrepareJointsConfig : public baker::JobConfig {
23  Q_OBJECT
24  Q_PROPERTY(bool passthrough MEMBER passthrough)
25 public:
26  bool passthrough { false };
27 };
28 
29 class PrepareJointsTask {
30 public:
31  using Config = PrepareJointsConfig;
32  using Input = baker::VaryingSet2<std::vector<hfm::Joint>, hifi::VariantHash /*mapping*/>;
33  using Output = baker::VaryingSet3<std::vector<hfm::Joint>, QMap<int, glm::quat> /*jointRotationOffsets*/, QHash<QString, int> /*jointIndices*/>;
34  using JobModel = baker::Job::ModelIO<PrepareJointsTask, Input, Output, Config>;
35 
36  void configure(const Config& config);
37  void run(const baker::BakeContextPointer& context, const Input& input, Output& output);
38 
39 protected:
40  bool _passthrough { false };
41 };
42 
43 #endif // hifi_PrepareJointsTask_h