Index: chrome/browser/android/vr_shell/gltf_asset.cc |
diff --git a/chrome/browser/android/vr_shell/gltf_asset.cc b/chrome/browser/android/vr_shell/gltf_asset.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..91b5071cce78c39378a067a6b07d9b3ad643d796 |
--- /dev/null |
+++ b/chrome/browser/android/vr_shell/gltf_asset.cc |
@@ -0,0 +1,48 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/android/vr_shell/gltf_asset.h" |
+ |
+#include <unordered_map> |
+ |
+#include "base/logging.h" |
+ |
+namespace vr_shell { |
+ |
+namespace gltf { |
+ |
+const std::unordered_map<std::string, Type> kTypeMap = { |
+ {"SCALAR", SCALAR}, {"VEC2", VEC2}, {"VEC3", VEC3}, {"VEC4", VEC4}, |
+ {"MAT2", MAT2}, {"MAT3", MAT3}, {"MAT4", MAT4}, |
+}; |
+ |
+Type GetType(const std::string& type) { |
+ auto it = kTypeMap.find(type); |
+ CHECK(it != kTypeMap.end()); |
+ return it->second; |
+} |
+ |
+Mesh::Primitive::Primitive() : indices(nullptr), mode(4) {} |
+ |
+Mesh::Primitive::~Primitive() = default; |
+ |
+Mesh::Mesh() {} |
+ |
+Mesh::~Mesh() = default; |
+ |
+Node::Node() {} |
+ |
+Node::~Node() = default; |
+ |
+Scene::Scene() {} |
+ |
+Scene::~Scene() = default; |
+ |
+Asset::Asset() : scene_(nullptr) {} |
+ |
+Asset::~Asset() = default; |
+ |
+} // namespace gltf |
+ |
+} // namespace vr_shell |