Comments (3)
I like the idea of supporting non-VR use cases, that seems very reasonable. But I'd rather not autodetect when HMD mode should be enabled or disabled — this would make debugging harder, for one thing, since my Leap Motion is taped to my headset. 🙂
Let's add an option to the leap-system.js schema so that it can be disabled explicitly. Usage would be:
<a-scene leap="hmd: false">
<a-entity leap-hand="hand: left"></a-entity>
<a-entity leap-hand="hand: right"></a-entity>
</a-scene>
I hope to be able to do that late next week, or feel free to send a PR if you're interested and have time!
from aframe-leap-hands.
I have some code that adds it to the leap-system.js, but my experience with WebPack is incredibly limited. I have just been testing it by altering the disto files directly. I would be happy to work on it directly if I can better understand how you are resolving your external references to 'leapjs' and 'circular-array',
In lieu of that, feel free to copy the relevant lines (28 - 69) from here.
Lines 28-38 cover augmentation of the transform plugin.
The enableDesktopMode method disables HMD and sets the transform to an arbitrary position I found to work for me.
The enableHMDMode method enables HMD and sets the transform to the position that you had originally used.
As for the setting for HMD, perhaps create 3 enumeration: true, false, and toggle.
In regards to the toggle setting, the setAutoToggleHMD method hooks up to the EnterVR and ExitVR events to automatically toggle the switch between desktop mode and HMD mode.
from aframe-leap-hands.
There's no need to worry about WebPack really, PRs don't update dist files. My release script automatically updates dist/*
when I increment the version number, which would be done on my end later.
In terms of testing code, simply:
# Downloads leapjs, circular-array, and dev dependencies from NPM
npm install
# Starts a local development build/refresh server with Browserify and Budo
npm run dev
# (Optional) Build a dist script, which should not be committed
npm run dist
These scripts are defined here.
I had in mind something like this, as a starting point.
/**
* Leap Motion system for A-Frame.
*/
module.exports = {
schema: {
hmd: {default: true}
},
init: function () {
this.controller = Leap.loop()
.setOptimizeHMD(this.data.hmd)
.use('aframeSystem');
},
getFrame: function () {
return this.controller.frame();
}
};
Adding support for position/rotation/scale transforms seems like a good idea, as you've done, but let's get to that separately from this change, because assumptions like scale=.001 seem a bit subjective.
from aframe-leap-hands.
Related Issues (20)
- Publish to NPM HOT 1
- Enhancement: Allow for Update of Transform Plugin
- Fix the screencap!
- Desktop/VR Toggle HOT 5
- Dist is excluded from NPM :/ HOT 1
- Add instruction for using from CDN
- Consider running under openleap org HOT 1
- Add docs on system options
- No hands, no errors in a-frame 7.1 HOT 1
- Hands are rotated on X axis
- Type error for enablePhysics: true HOT 2
- 'ReferenceError: assignment to undeclared variable Leap', when using Webpack
- Issues with CANNON and this.physics
- Grabby UX HOT 1
- Rotation isn't available in physics bodies
- Raycaster is flakey HOT 2
- Rotation is unreliable / off
- Create dist/ files.
- Other resources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aframe-leap-hands.