bryik / aframe-controller-cursor-component Goto Github PK
View Code? Open in Web Editor NEWA cursor for tracked controllers.
Home Page: https://bryik.github.io/aframe-controller-cursor-component/
License: MIT License
A cursor for tracked controllers.
Home Page: https://bryik.github.io/aframe-controller-cursor-component/
License: MIT License
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>
Just noticed that the GitHub Pages branch which powered the example of this component has disappeared. Can we get it back please? :)
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:
Any thoughts on what I might try to get to the bottom of this?
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.
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.
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.
When using:
<script src="https://unpkg.com/aframe-controller-cursor-component/dist/aframe-controller-component.min.js"></script>
I get:
Not found: file "/dist/aframe-controller-component.min.js" in package [email protected]
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
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.
Problem: Controller cursor is broken, not sure what changed. Reported by samvr on Slack.
System: Desktop/Vive/Firefox Nightly
Example: https://bryik.github.io/aframe-controller-cursor-component/basic/
Console dump:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.