New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean Component does not register clicks when using Cursor Component Tutorial #105

Closed
JGL opened this Issue Nov 8, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@JGL

JGL commented Nov 8, 2016

Following the Cursor tutorial here:
https://aframe.io/docs/0.3.0/components/cursor.html
I made a pair of components - one to change the ocean material side property to Double instead of Front sided:
https://github.com/JGL/APieceOfArtAsBigAsIndia/blob/master/src/js/material-side-modifier-ocean.js
And the other as a listener to the Cursor component:
https://github.com/JGL/APieceOfArtAsBigAsIndia/blob/master/src/js/cursor-listener.js
A demonstration of the side modifier in action can be seen here:
https://jgl.github.io/APieceOfArtAsBigAsIndia/oceanComponentWithMyComponent.html
A demonstration of the click not being triggered can be seen here:
https://jgl.github.io/APieceOfArtAsBigAsIndia/collidingWithOceanComponent.html
You can see the same Cursor Listening with the Mountain Component here:
https://jgl.github.io/APieceOfArtAsBigAsIndia/collidingWithMountainComponent.html

@donmccurdy

This comment has been minimized.

Show comment
Hide comment
@donmccurdy

donmccurdy Nov 8, 2016

Owner

Looks like the A-Frame raycaster ignores intersections with objects that don't have an entity attached:

// raycaster.js
// Only keep intersections against objects that have a reference to an entity.
intersections = intersections.filter(function hasEl (intersection) {
    return !!intersection.object.el;
});

In my code here, I call el.object3D.add(this.mesh);. Presumably I should be using el.setObject3D('mesh', this.mesh); instead, and that would automatically set mesh.el.

Traveling today, and will get that patched when I'm back. Or would take a PR as well. :)

Owner

donmccurdy commented Nov 8, 2016

Looks like the A-Frame raycaster ignores intersections with objects that don't have an entity attached:

// raycaster.js
// Only keep intersections against objects that have a reference to an entity.
intersections = intersections.filter(function hasEl (intersection) {
    return !!intersection.object.el;
});

In my code here, I call el.object3D.add(this.mesh);. Presumably I should be using el.setObject3D('mesh', this.mesh); instead, and that would automatically set mesh.el.

Traveling today, and will get that patched when I'm back. Or would take a PR as well. :)

@donmccurdy donmccurdy added the bug label Nov 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment