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

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

Issue 2852533004: Implementing Binary glTF reader for the VR controller model (Closed)
Patch Set: Avoiding auto Created 3 years, 8 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
« no previous file with comments | « chrome/browser/android/vr_shell/test/data/sample.glb ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_controller_model.cc
diff --git a/chrome/browser/android/vr_shell/vr_controller_model.cc b/chrome/browser/android/vr_shell/vr_controller_model.cc
index 4321905cfd2c86bcc0f3f128a8a8d440126e7612..ab8d41555d762919f3196bdba90bf4f4c946209c 100644
--- a/chrome/browser/android/vr_shell/vr_controller_model.cc
+++ b/chrome/browser/android/vr_shell/vr_controller_model.cc
@@ -20,8 +20,8 @@ namespace vr_shell {
namespace {
enum {
- ELEMENTS_BUFFER_ID = 0,
- INDICES_BUFFER_ID = 1,
+ ELEMENTS_BUFFER_ID = 2,
+ INDICES_BUFFER_ID = 3,
};
constexpr char kPosition[] = "POSITION";
@@ -33,7 +33,7 @@ constexpr char const kComponentName[] = "VrShell";
constexpr char const kDefaultVersion[] = "0";
constexpr char const kModelsDirectory[] = "models";
-constexpr char const kModelFilename[] = "controller.gltf";
+constexpr char const kModelFilename[] = "ddcontroller.glb";
constexpr char const kTexturesDirectory[] = "tex";
constexpr char const kBaseTextureFilename[] = "ddcontroller_idle.png";
constexpr char const* kTexturePatchesFilenames[] = {
@@ -167,9 +167,11 @@ std::unique_ptr<VrControllerModel> VrControllerModel::LoadFromComponent() {
return nullptr;
}
- GltfParser gltf_parser;
std::vector<std::unique_ptr<gltf::Buffer>> buffers;
- auto asset = gltf_parser.Parse(model_path, &buffers);
+
+ std::string model_data;
+ base::ReadFileToString(model_path, &model_data);
+ auto asset = BinaryGltfParser::Parse(base::StringPiece(model_data), &buffers);
if (!asset) {
LOG(ERROR) << "Failed to read controller model";
return nullptr;
« no previous file with comments | « chrome/browser/android/vr_shell/test/data/sample.glb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698