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

fix raycast does not follow entity transform without rigidbody #310

Merged
merged 5 commits into from
Feb 12, 2024

Conversation

zwazel
Copy link
Contributor

@zwazel zwazel commented Jan 23, 2024

Objective

Solution

  • If no Rotation and Position is available, fall back to GlobalTransform

Changelog

  • I've added a From<GlobalTransform> and From<&GlobalTransform> to Position as well as a From<&GlobalTransform> to Rotation. as a From<GlobalTransform> already existed.

I tested the updated update_ray_caster_positions system in my personal project, and it fixed the problem for me. I currently can't test the update_shape_caster_positions but as it is basically the same changes, i'd be surprised if it wouldn't work.

as this is my first time contributing to this crate, i'm not sure if the code is what is expected.

@zwazel zwazel changed the title fix raycast does not follow entity trans fix raycast does not follow entity transform without rigidbody Jan 23, 2024
@Jondolf
Copy link
Owner

Jondolf commented Feb 12, 2024

Hi, sorry for leaving this sit here for so long! It seems to work though, thanks :)

I cleaned up the code a bit to remove the temp variables and make things more concise, and fixed some lint warnings that Clippy was giving

@Jondolf Jondolf added bugfix A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests labels Feb 12, 2024
@Jondolf Jondolf added this to the 0.4 milestone Feb 12, 2024
@Jondolf Jondolf merged commit 7a97c56 into Jondolf:main Feb 12, 2024
4 checks passed
brianreavis pushed a commit to naturalatlas/bevy_xpbd that referenced this pull request Feb 17, 2024
…lf#310)

# Objective

- Fixes Jondolf#288 

## Solution

- If no Rotation and Position is available, fall back to GlobalTransform

## Changelog

- I've added a `From<GlobalTransform>` and `From<&GlobalTransform>` to `Position` as well as a `From<&GlobalTransform>` to `Rotation`. as a `From<GlobalTransform>` already existed.

I tested the updated `update_ray_caster_positions` system in my personal project, and it fixed the problem for me. I currently can't test the `update_shape_caster_positions` but as it is basically the same changes, i'd be surprised if it wouldn't work.

as this is my first time contributing to this crate, i'm not sure if the code is what is expected.

---------

Co-authored-by: Joona Aalto <[email protected]>
@zwazel zwazel deleted the 288-raycast-does-not-follow-entity-trans branch March 2, 2024 09:44
@Jondolf Jondolf added C-Bug Something isn't working and removed bugfix labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raycast Does Not Follow Entity Transform Without Rigidbody
2 participants