bevyengine / bevyengine/bevy

MeshRayCast has intersections not on the surface of the mesh

Open
#25,605 3 comments 0 reactions 0 assignees View on GitHub
A-Picking C-Bug S-Needs-Investigation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

0.19.1 with features default and free_camera

## What you did

I cast a ray from camera using MeshRayCast to the meshes I loaded and visualize the first intersection using gizmos.

[A small code base](https://github.com/yh1970/bevy_meshraycast_debug) for reproduction

## What went wrong

- what were you expecting?
All intersections should be just on the surfaces of meshes
- what actually happened?
Some intersections are inside the meshes or just in the air.

correct
Image

inside
Image

in the air
Image

## Additional information
MeshRayCast works on the suzanne model but not on the zombie model.

Contributor guide

Open the contributing guide

Research direction

Start by running the linked bevy_meshraycast_debug reproduction with Bevy 0.19.1 and compare MeshRayCast results for the Suzanne and zombie models. Trace the ray setup, mesh transforms, and gizmo visualization to determine where the reported intersections diverge from the mesh surface. Done means intersections are consistently on the loaded mesh surfaces for both models.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.