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

RigidBody causing error with Child's position by parent's scale. Really Critical issue !!!. #549

Open
HyeokSuLee opened this issue Jul 1, 2024 · 0 comments
Labels

Comments

@HyeokSuLee
Copy link

image

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants