dimforge / dimforge/bevy_rapier
RigidBody causing error with Child's position by parent's scale. Really Critical issue !!!.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 282
- PR merge metrics
- No merged PRs in 30d
Description

```rust
// setting
Parent -> insert(TransformBundle::default())
Child -> insert(TransformBundle::default(), Collider::cuboid(1,1,1), **RigidBody::Fixed**) // **problem
Parent = Transform [ scale(1,1,1), position(0,0,0) ]
Child = Transform [ scale(1,1,1), position(-100, 100, 0) ]
// if parent's scale set to (1.1, 1.5, 0.0)
// without rigidbody
Parent = Transform [ scale(1.1, 1.5, 1.0), position(0,0,0) ], GlobalTransform [ scale(1.1, 1.5, 1.0), position(0,0,0) ]
Child = Transform [ scale(1, 1, 1), position(-100, 100, 0) ], GlobalTransform [ scale(1.1, 1.5, 1.0), position(-110, 150, 0) ]
// with rigidbody
Parent = Transform [ scale(1.1, 1.5, 1.0), position(0,0,0) ], GlobalTransform [ scale(1.1, 1.5, 1.0), position(0,0,0) ]
Child = Transform [ scale(1, 1, 1), position(-110, 150, 0) ], GlobalTransform [ scale(1.1, 1.5, 1.0), position(-121, 225, 0) ]
```
Without rigidbody, child's position is perfect which moves by parent's scale.
But with rigidbody, child's position is wierd. I read that rigidbody is calculated based on globaltransform.
So I think when after parent's scale changed, Rapier calculate the child's local position based on child's global scale before bevy's Transform system.
I think that is why child's local position is not (-100, 100, 0) when with rigidbody. It seems rigidbody's Transform calculation need to be fixed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.