OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 std::unordered_map<std::string, std::size_t> buffer_ids_; | 60 std::unordered_map<std::string, std::size_t> buffer_ids_; |
61 std::unordered_map<std::string, std::size_t> buffer_view_ids_; | 61 std::unordered_map<std::string, std::size_t> buffer_view_ids_; |
62 std::unordered_map<std::string, std::size_t> accessor_ids_; | 62 std::unordered_map<std::string, std::size_t> accessor_ids_; |
63 std::unordered_map<std::string, std::size_t> node_ids_; | 63 std::unordered_map<std::string, std::size_t> node_ids_; |
64 std::unordered_map<std::string, std::size_t> mesh_ids_; | 64 std::unordered_map<std::string, std::size_t> mesh_ids_; |
65 std::unordered_map<std::string, std::size_t> scene_ids_; | 65 std::unordered_map<std::string, std::size_t> scene_ids_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(GltfParser); | 67 DISALLOW_COPY_AND_ASSIGN(GltfParser); |
68 }; | 68 }; |
69 | 69 |
| 70 class BinaryGltfParser { |
| 71 public: |
| 72 // Note: If your glTF references external files, this function will perform |
| 73 // IO, and a base path must be specified. |
| 74 static std::unique_ptr<gltf::Asset> Parse( |
| 75 base::StringPiece glb_content, |
| 76 std::vector<std::unique_ptr<gltf::Buffer>>* buffers, |
| 77 const base::FilePath& path = base::FilePath()); |
| 78 }; |
| 79 |
70 } // namespace vr_shell | 80 } // namespace vr_shell |
71 | 81 |
72 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 82 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ |
OLD | NEW |