immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
386 stars 86 forks source link

Convert polyfill to use gl-matrix directly #15

Closed toji closed 6 years ago

toji commented 6 years ago

Verified that this ends up having effectively zero impact on size due to tree shaking. Using the library directly rather than porting individual functions over piecemeal will make it easier to add more mathematically challenging features in the future, such as arm modeling for 3DoF controllers (which I have almost completed porting from Boris' RayInput library.)

jsantell commented 6 years ago

Oops, double review comments above -- I attempted this before but couldn't remember what issues I ran into -- checking the tests there's a failure at: (function (exports, require, module, __filename, __dirname) { import * as glMatrix from "./common.js";

Looks like we'll need to manually transform the dependency unfortunately -- I hope that not excluding gl-matrix here -- and suspect the module build may have an issue as well. If this works I'll be very exciting :)

jsantell commented 6 years ago

With #18's build changes, this should now work

toji commented 6 years ago

Rebased this patch onto #18 and fixed the tests. Thank for updating the build system!

jsantell commented 6 years ago

I think the commits need a squash (due to different ordering from master), but other than that, should be good to land!

toji commented 6 years ago

Squashed and merged!