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

[2d] When Collider is rotated, collisions work incorrectly #407

Closed
hocop opened this issue Jul 8, 2024 · 2 comments · Fixed by #409
Closed

[2d] When Collider is rotated, collisions work incorrectly #407

hocop opened this issue Jul 8, 2024 · 2 comments · Fixed by #409
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Bug Something isn't working C-Regression Behaviour that was working before is now worse or broken

Comments

@hocop
Copy link
Contributor

hocop commented Jul 8, 2024

Hi!

I have this setup: an entity with RigidBody and its child with collider, as described in Multiple colliders.

But in my example the collider entity is rotated 90 degrees.

let car = commands.spawn(
(
    RigidBody::Dynamic,
    TransformBundle::from_transform(*transform),
    ExternalForce::new(Vec2::ZERO).with_persistence(false),
)
).id();

let collider = commands.spawn((
    Collider::capsule(1.0, 2.0),
    TransformBundle::from_transform(Transform::from_rotation(Quat::from_rotation_z(PI / 2.0))),
)).id();
commands.entity(car).add_child(collider);

It leads to this behaviour:
rotated 90

Without rotation it works as expected:
not rotated


avian2d = "0.1.0"
bevy = "0.14.0"

@Jondolf Jondolf added C-Bug Something isn't working A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Regression Behaviour that was working before is now worse or broken labels Jul 8, 2024
@Jondolf Jondolf closed this as completed in 803ec63 Jul 9, 2024
@Jondolf
Copy link
Owner

Jondolf commented Jul 9, 2024

Hi! This should be fixed by #409. I hope to release a 0.1.1 patch soon, and that should have the fix.

@hocop
Copy link
Contributor Author

hocop commented Jul 9, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality C-Bug Something isn't working C-Regression Behaviour that was working before is now worse or broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants