-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Panic when using a bevy mesh as a collider, ccd enabled and scaled transform #234
Comments
I think there's a regression in rapier 0.21. Getting this error for the first time now in an otherwise unchanged codebase (other than upgrading to Bevy 0.10) |
Just tried this again to see if anything has changed with the new versions and the example I provided still consistently panics, hitting this Here's an updated example: [dependencies]
bevy = "0.10.0"
bevy_rapier3d = "0.21.0" use bevy::prelude::*;
use bevy_rapier3d::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(RapierPhysicsPlugin::<NoUserData>::default())
.add_startup_system(setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
TransformBundle::from_transform(
Transform::from_xyz(0.0, 0.0, 20.0)
// Commenting out this line it no longer panics
.with_scale(Vec3::splat(2.0)),
),
// If you use a different collider that isn't a bevy mesh here it no longer panics
Collider::from_bevy_mesh(
&Mesh::from(shape::Cube { size: 3.0 }),
&ComputedColliderShape::TriMesh,
)
.unwrap(),
RigidBody::Fixed,
));
commands.spawn((
Collider::ball(1.0),
RigidBody::Dynamic,
// Commenting out this line it no longer panics
// Ccd::enabled(),
Velocity::linear(Vec3::Z * 10000.0),
));
} |
As for me, my code magically works now. Strange 🤷♂️ |
Also ran into this same issue. |
It only happens when i use ComputedColliderShape::TriMesh, if i switch to ComputedColliderShape::ConvexDecomposition(VHACDParameters::default()), it stops |
Have the same issue with CCD and TriMesh (and WASM): bevy = "0.13.0"
|
Recent duplicate here: #386 |
Updated example for bevy 0.13 and bevy_rapier3d 0.26 no longer panics but returns the error:
main.rsuse bevy::{math::vec3, prelude::*};
use bevy_rapier3d::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(RapierPhysicsPlugin::<NoUserData>::default())
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
TransformBundle::from_transform(
Transform::from_xyz(0.0, 0.0, 20.0)
// Commenting out this line it no longer panics
.with_scale(Vec3::splat(2.0)),
),
// If you use a different collider that isn't a bevy mesh here it no longer panics
Collider::from_bevy_mesh(
&Mesh::from(Cuboid {
half_size: vec3(1.5, 1.5, 1.5),
}),
&ComputedColliderShape::TriMesh,
)
.unwrap(),
RigidBody::Fixed,
));
commands.spawn((
Collider::ball(1.0),
RigidBody::Dynamic,
// Commenting out this line it no longer panics
Ccd::enabled(),
Velocity::linear(Vec3::Z * 10000.0),
));
} Cargo.toml[package]
name = "bevy_rapier_bug_test"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = { version = "0.13.2", features=["wayland"] }
bevy_rapier3d = "0.26.0"
full log including updated system specs``` 2024-05-24T15:35:14.760568Z INFO bevy_winit::system: Creating new window "App" (0v1) 2024-05-24T15:35:15.052064Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8726, device_type: Discre teGpu, driver: "NVIDIA", driver_info: "555.42.02", backend: Vulkan } 2024-05-24T15:35:15.300280Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling EndeavourOS", kerne l: "6.9.1-arch1-1", cpu: "AMD Ryzen 9 7950X 16-Core Processor", core_count: "16", memory: "62.0 GiB" } 2024-05-24T15:35:15.305132Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305139Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305141Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305170Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305172Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305173Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305178Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305180Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305182Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305186Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305188Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305190Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305198Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305199Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305204Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305205Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305207Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305211Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:15.305213Z ERROR log: Closest points not found despite setting the max distance to infinity. 2024-05-24T15:35:26.825476Z INFO bevy_window::system: No windows are open, exiting 2024-05-24T15:35:26.825743Z INFO bevy_winit::system: Closing window 0v1 ``` |
Description
I'm getting a panic when two objects collide if one has a collider created using
from_bevy_mesh
and the entity has a scaled transform and the other object has ccd enabled.Click for full traceback
My use case is I have an asteroid field that has randomly placed asteroids with random scales. I have a custom collider mesh for the asteroids and I want my bullets that shoot the asteroids to use ccd so they don't go through the asteroids.
System
Windows 11
Bevy 0.8
bevy_rapier3d 0.16 (also main branch)
Minimal reproduction
This code demonstrates the error, it creates a fixed rigid body using a bevy mesh as a collider and a transform scaled to 2X, then creates a dynamic rigid body with ccd enabled and sends it at it with a high velocity.
The text was updated successfully, but these errors were encountered: