Giter VIP home page Giter VIP logo

Comments (3)

donmccurdy avatar donmccurdy commented on May 27, 2024

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.

james-h-stephens avatar james-h-stephens commented on May 27, 2024

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.

donmccurdy avatar donmccurdy commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.