Overte C++ Documentation
CauterizedMeshPartPayload.h
1 //
2 // Created by AndrewMeadows 2017.01.17
3 // Copyright 2013-2017 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #ifndef hifi_CauterizedMeshPartPayload_h
10 #define hifi_CauterizedMeshPartPayload_h
11 
12 #include "MeshPartPayload.h"
13 
14 class CauterizedMeshPartPayload : public ModelMeshPartPayload {
15 public:
16  CauterizedMeshPartPayload(ModelPointer model, int meshIndex, int partIndex, int shapeIndex, const Transform& transform, const uint64_t& created);
17 
18  // matrix palette skinning
19  void updateClusterBuffer(const std::vector<glm::mat4>& clusterMatrices,
20  const std::vector<glm::mat4>& cauterizedClusterMatrices);
21 
22  // dual quaternion skinning
23  void updateClusterBuffer(const std::vector<Model::TransformDualQuaternion>& clusterDualQuaternions,
24  const std::vector<Model::TransformDualQuaternion>& cauterizedClusterQuaternions);
25 
26  void updateTransformForCauterizedMesh(const Transform& modelTransform, const Model::MeshState& meshState, bool useDualQuaternionSkinning);
27 
28  void bindTransform(gpu::Batch& batch, const Transform& transform, RenderArgs::RenderMode renderMode) const override;
29 
30  void setEnableCauterization(bool enableCauterization) { _enableCauterization = enableCauterization; }
31 
32 private:
33  gpu::BufferPointer _cauterizedClusterBuffer;
34  Transform _cauterizedTransform;
35  bool _enableCauterization { false };
36 };
37 
38 #endif // hifi_CauterizedMeshPartPayload_h