aframe-environment-component icon indicating copy to clipboard operation
aframe-environment-component copied to clipboard

Does not work with raycasters, under A-Frame 9.0

Open DougReeder opened this issue 6 years ago • 1 comments

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 avatar Feb 16 '19 05:02 DougReeder

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.

DougReeder avatar Feb 16 '19 05:02 DougReeder