dimforge / dimforge/bevy_rapier

Bug with scaling Transform with RigitBody::Dynamic with collider::ball

Open
#336 2 comments 0 reactions 0 assignees View on GitHub
A-Integration C-Bug D-Easy P-Low S-not-started
Dominant language
Rust
Stars
1.6k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

![anim](https://user-images.githubusercontent.com/120749144/222989328-6a7380af-73ef-4f1e-bfc8-94395e21e442.gif)

### **Same issue**
#329
### **Error**
`
2023-03-05T22:13:44.771773Z ERROR bevy_rapier2d::geometry::shape_views::collider_view: Failed to apply scale [NaN, NaN] to Ball shape.
`
### **Dependencies**

- bevy = "0.9.0"
- bevy_rapier2d = "0.20.0"

# To Reproduce
`
use bevy::prelude::*;
use bevy_rapier2d::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(RapierPhysicsPlugin::::pixels_per_meter(100.0))
.add_plugin(RapierDebugRenderPlugin::default())
.add_startup_system(setup)
.run();
}

fn setup(
mut commands: Commands,
) {
commands.spawn(RigidBody::Dynamic)
.insert(Collider::ball(50.0))
.insert(
SpriteBundle {
transform: Transform::default().with_scale(Vec3::new(0.3, 0.3, 0.0)),
..default()}
);
}
`
### **Description**
Ran into this error while developing my game and made a minimal example to reproduce the same error.
With adding a texture to the Sprite Bundle, still have the same error (i removed texture to shorten an example)
With replacing Transform::default().with_scale(Vec3::new(0.3, 0.3, 0.0)) with
Transform::default()
error goes away.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.