Skip to content
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

Does not work with raycasters, under A-Frame 9.0 #60

Open
DougReeder opened this issue Feb 16, 2019 · 1 comment
Open

Does not work with raycasters, under A-Frame 9.0 #60

DougReeder opened this issue Feb 16, 2019 · 1 comment

Comments

@DougReeder
Copy link

A-Frame 0.9 makes a change:
Have raycasters only intersect against objects defined via .setObject3D. raycaster.objects should be specified (e.g., objects: [data-raycastable] or objects: .raycastable) because raycasting is expensive. raycaster.recursive property removed (#3980) but will default to be recursive only under objects defined via .setObject3D (#3652).

If you define an environment component like so:
<a-entity environment="preset: arches;" class="landscape"></a-entity>
and a raycaster component like so:
<a-entity raycaster="objects:.landscape; far:0.5;">

the following error is logged:

components:raycaster:warn [raycaster] For performance, please define raycaster.objects when using raycaster or cursor components to whitelist which entities to intersect with. e.g., raycaster="objects: [data-raycastable]".

and the raycaster does not fire any events when it should intersect the environment.

Full example, where you can fly through the environment (incorrect) but not the house (correct):
https://elfland-beta.surge.sh/arches/

@DougReeder
Copy link
Author

Defining the raycaster as
<a-entity raycaster="objects:.landscape,.environmentGround,.environmentDressing; far:0.5;">
works.

If that's the usual workaround, it should probably be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant