leapjs-plugins
leapjs-plugins copied to clipboard
Hand plugin requires additional and incompatible three.js version
I am trying to get the hand working in a npm and Babel based environment.
In my package.json, I have this dependency on Three.js:
I have the following npm dependency on Three.js in my project:
"three": "^0.85.2"
and the following code in my file:
const THREE = require('three');
console.dir(THREE.REVISION);
const Leap = require('leapjs');
require('leapjs-plugins');
The dir()
prints out revision number 85 correcly.
But the hand won't initialize due to the following error:
Uncaught TypeError: Cannot set property 'enabled' of undefined
If I debug this, the culprit is this line: https://github.com/leapmotion/leapjs-plugins/blob/master/main/bone-hand/leap.bone-hand.js#L22
It tries to set renderer.shadowMap.enabled = true;
In revision 85, this would work, as shadowMap is a property of the renderer. However, in the revision 69 that the plugin defines as a dependency, the property is called shadowMapEnabled
instead.
This means two things:
- The plugin loads an additional revision 69 of Three.js on startup. This is also visible in the console, as it prints two status messages for the renderer, with two different revisions.
- The hand is not compatible with this revision 69, although it defines in its
package.json