aevyrie / bevy_mod_raycast

A little mesh raycasting plugin for Bevy
https://crates.io/crates/bevy_mod_raycast
MIT License
303 stars 92 forks source link

Error spam when using with `RapierDebugRenderPlugin` #70

Closed LiamGallagher737 closed 11 months ago

LiamGallagher737 commented 1 year ago

I am using the latest commit of the bevy_editor_pls crate. When I add bevy_rapier's RapierDebugRenderPlugin to my app my console gets spammed with the following error.

ERROR raycast: bevy_mod_raycast: Invalid intersection check: `TriangleList` is the only supported `PrimitiveTopology`

I understand the bevy_rapier's debug lines aren't using triangle lists but why does it have to spam the console, can't it just skip it?

aevyrie commented 1 year ago

This is happening because an entity is marked as a raycast target, but it does not have a supported mesh to raycast against. The solution would be to remove the raycast components (RaycastMesh::<MyRaycastSet>) from entities that should not have them. Maybe this is an upstream issue with bevy_editor_pls?

LiamGallagher737 commented 1 year ago

The issue only happens when using bevy_rapier's debug lines which I highly doubt would have that component.

aevyrie commented 11 months ago

The filter here ensures that only entities with that component can be raycasted against: https://github.com/aevyrie/bevy_mod_raycast/blob/193cf2a58f594fa0ec5ff14ed5aa6d3af532967f/src/system_param.rs#L72