Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2833)

Unified Diff: chrome/browser/android/vr_shell/gltf_asset.cc

Issue 2757213003: Implementing glTF 1.0 parser (Closed)
Patch Set: Moving glTF structs to their own file Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698