Overte C++ Documentation
AnimDebugDraw.h
1 //
2 // AnimDebugDraw.h
3 //
4 // Copyright 2015 High Fidelity, Inc.
5 //
6 // Distributed under the Apache License, Version 2.0.
7 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
8 //
9 
10 #ifndef hifi_AnimDebugDraw_h
11 #define hifi_AnimDebugDraw_h
12 
13 #include <tuple>
14 
15 #include <gpu/Pipeline.h>
16 #include <render/Scene.h>
17 
18 #include "AnimNode.h"
19 #include "AnimSkeleton.h"
20 
21 class AnimDebugDrawData;
22 typedef render::Payload<AnimDebugDrawData> AnimDebugDrawPayload;
23 
24 class AnimDebugDraw {
25 public:
26  static AnimDebugDraw& getInstance();
27 
28  AnimDebugDraw();
29  ~AnimDebugDraw();
30 
31  void shutdown();
32 
33  void addAbsolutePoses(const std::string& key, AnimSkeleton::ConstPointer skeleton, const AnimPoseVec& poses, const AnimPose& rootPose, const glm::vec4& color);
34  void removeAbsolutePoses(const std::string& key);
35 
36  void update();
37 
38 protected:
39  std::shared_ptr<AnimDebugDrawData> _animDebugDrawData;
40  std::shared_ptr<AnimDebugDrawPayload> _animDebugDrawPayload;
41  render::ItemID _itemID{ render::Item::INVALID_ITEM_ID };
42 
43  static gpu::PipelinePointer _pipeline;
44 
45  typedef std::tuple<AnimSkeleton::ConstPointer, AnimPoseVec, AnimPose, glm::vec4> PosesInfo;
46 
47  typedef std::unordered_map<std::string, PosesInfo> PosesInfoMap;
48  PosesInfoMap _posesInfoMap;
49 
50  // no copies
51  AnimDebugDraw(const AnimDebugDraw&) = delete;
52  AnimDebugDraw& operator=(const AnimDebugDraw&) = delete;
53 };
54 
55 #endif // hifi_AnimDebugDraw