| // Copyright 2013 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef FLUTTER_IMPELLER_SCENE_SKIN_H_ |
| #define FLUTTER_IMPELLER_SCENE_SKIN_H_ |
| |
| #include <memory> |
| |
| #include "impeller/core/allocator.h" |
| #include "impeller/core/texture.h" |
| #include "impeller/scene/importer/scene_flatbuffers.h" |
| #include "impeller/scene/node.h" |
| |
| namespace impeller { |
| namespace scene { |
| |
| class Skin final { |
| public: |
| static std::unique_ptr<Skin> MakeFromFlatbuffer( |
| const fb::Skin& skin, |
| const std::vector<std::shared_ptr<Node>>& scene_nodes); |
| ~Skin(); |
| |
| Skin(Skin&&); |
| Skin& operator=(Skin&&); |
| |
| std::shared_ptr<Texture> GetJointsTexture(Allocator& allocator); |
| |
| private: |
| Skin(); |
| |
| std::vector<std::shared_ptr<Node>> joints_; |
| std::vector<Matrix> inverse_bind_matrices_; |
| |
| Skin(const Skin&) = delete; |
| |
| Skin& operator=(const Skin&) = delete; |
| }; |
| |
| } // namespace scene |
| } // namespace impeller |
| |
| #endif // FLUTTER_IMPELLER_SCENE_SKIN_H_ |