Giter VIP home page Giter VIP logo

aframe-controller-cursor-component's People

Contributors

bryik avatar kfarr avatar ngokevin avatar rxl881 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aframe-controller-cursor-component's Issues

Another Uncaught TypeError: Cannot read property 'array' of undefined issue

Aframe 0.5.0
Vive controllers
When trying to use the component I get a "Cannot read property 'array' of undefined" and the scene doesn't load.

The errors are :

three.js:14957 Uncaught TypeError: Cannot read property 'array' of undefined at At.Object.assign.raycast (https://aframe.io/releases/0.5.0/aframe.min.js:113:14953) at Dn (https://aframe.io/releases/0.5.0/aframe.min.js:109:9054) at Dn (https://aframe.io/releases/0.5.0/aframe.min.js:109:9119) at Un.intersectObjects (https://aframe.io/releases/0.5.0/aframe.min.js:117:689) at i.tick (https://aframe.io/releases/0.5.0/aframe.min.js:181:1401) at https://aframe.io/releases/0.5.0/aframe.min.js:250:6254 at Array.forEach (native) at HTMLElement.value (https://aframe.io/releases/0.5.0/aframe.min.js:250:6216) at HTMLElement.value (https://aframe.io/releases/0.5.0/aframe.min.js:250:6410) at HTMLElement.render (https://aframe.io/releases/0.5.0/aframe.min.js:369:132) Object.assign.raycast @ three.js:14957 Dn @ three.js:39156 Dn @ three.js:39164 intersectObjects @ three.js:39233 tick @ raycaster.js:106 (anonymous) @ a-scene.js:450 value @ a-scene.js:448 value @ a-scene.js:472 (anonymous) @ bind.js:12 e @ a-scene.js:392 (anonymous) @ a-scene.js:377 module.exports.fireEvent @ index.js:96 (anonymous) @ a-node.js:222 value @ a-node.js:221 (anonymous) @ a-node.js:118

and

three.js:14957 Uncaught TypeError: Cannot read property 'array' of undefined at At.Object.assign.raycast (https://aframe.io/releases/0.5.0/aframe.min.js:113:14953) at Dn (https://aframe.io/releases/0.5.0/aframe.min.js:109:9054) at Dn (https://aframe.io/releases/0.5.0/aframe.min.js:109:9119) at Un.intersectObjects (https://aframe.io/releases/0.5.0/aframe.min.js:117:689) at i.tick (https://aframe.io/releases/0.5.0/aframe.min.js:181:1401) at https://aframe.io/releases/0.5.0/aframe.min.js:250:6254 at Array.forEach (native) at HTMLElement.value (https://aframe.io/releases/0.5.0/aframe.min.js:250:6216) at HTMLElement.value (https://aframe.io/releases/0.5.0/aframe.min.js:250:6410) at HTMLElement.render (https://aframe.io/releases/0.5.0/aframe.min.js:369:132)

I noticed this has been reported before but was apparently resolved, however for me it is crashing on load. Code attached as <a-entity vive-controls="hand: right" controller-cursor position="0 .5 -0.5" ></a-entity>

crashes scene

Hi there,

I'm trying to use this component in a scene but each time I add the vive-cursor attribute, it crashes the scene.

I'm using the latest master aframe and the latest of this component as well. Here's a codepen to see what's happening: http://codepen.io/sirkitree/pen/aBqQab?editors=1000 - if you modify that scene by just adding the vive-cursor attribute to the vive-control entity, you'll see it crash.

You can't see the error on codepen's console, but here is what I get locally:
tugboat vr - chromium 2016-12-04 08 47 49

Any thoughts on what I might try to get to the bottom of this?

some issues with hand-controls and oculus-touch-controls

I'm not sure if it's an issue with your component or with aframe 0.5.0 in general but I'm adding this issue here since it affects your component:

  • both hand-controls and oculus-touch-controls require the raycaster to be set.
    to get the basic example to work I had to add
    raycaster="objects: #sphere" to the entity

  • hand-controls: when I click the sphere the "click" event gets called twice instead of once. this does not happen with the oculus-touch-controls.

expose intersection object as readable property

It is very useful to have access to the intersection object in the specified events (mouseenter etc). However I'd like to be able to get the intersection position while hovering, so I can draw a 3d-cursor at the exact intersection position.

I therefore propose exposing the intersection object to make it easier accessible from the outside.

Alternatively: it would be useful to tell controller-cursor the id of acursor element (eg. a <a-sphere>), which would get its position and rotation updated according to the intersection.

rename the component a more generic way

This is just a suggestion, but since the component works also with other types of controllers (I tested it with Oculus Touch) it would make more sense to rename it to something more generic.

"Cannot read property 'array' of undefined" error when using component without specifying an selector object

Aframe 0.4.0
Oculus Touch controllers
when using the component without specifying a selector object, I get a "Cannot read property 'array' of undefined" and the scene doesn't load.
After specifying a selector (i.e vive-cursor="objects: .classname") the error goes away and everything works correctly.

full error:

Error: TypeError {stack: "TypeError: Cannot read property 'array' of undefin…(http://localhost:3000/js/aframe.min.js:151:5886)", message: "Cannot read property 'array' of undefined"}
-  Object.assign.raycast @/js/aframe.min.js:36
-  Fn @/js/aframe.min.js:32
-  Fn @/js/aframe.min.js:32
-  Fn @/js/aframe.min.js:32
-  intersectObjects @/js/aframe.min.js:39
-  tick @/js/aframe.min.js:86
-  (anonymous) @/js/aframe.min.js:150
-  value @/js/aframe.min.js:150
-  value @/js/aframe.min.js:150
-  (anonymous) @/js/aframe.min.js:257
-  e @/js/aframe.min.js:150
-  (anonymous) @/js/aframe.min.js:150
-  module.exports.fireEvent @/js/aframe.min.js:272
-  (anonymous) @/js/aframe.min.js:140
-  value @/js/aframe.min.js:140
-  (anonymous) @/js/aframe.min.js:140

cursor events don't match aframe cursor component

As this component basically duplicates aframe's internal cursor component (both in terms of functionality and code), it should emit the same events, and more importantly, the same event-payloads.

aframe's cursor event payload changed in 0.4.0 through this commit, adding the intersection attribute, which contains important data such as the position of intersection.

I adapted this change to the vive-cursor component here and can send a PR. (this introduces no breaking changes).

In the long run, one should think about a way to avoid the code duplication, and somehow inherit the cursor components behaviour.

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.