dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.24k stars 260 forks source link

No way to check angle of joint #496

Closed jonathankittel closed 2 months ago

jonathankittel commented 5 months ago

I want to check the angle of a revolute joint. Through impulsejoint.data I can get many details, local_anchor, local_axis, local_basis, etc. But not the actual angle of the joint.

Vrixyz commented 4 months ago

I'm a bit confused, are you using a RevoluteJoint or an ImpulseJoint ?

Do you want to know the current angle of the joint (at the time you're calling the method) ? If yes, The data will not be enough as this contains only the configuration of the joint, you'll want to consolidate this information (local anchor + axis probably ?) with its entity transform.

jonathankittel commented 4 months ago

Revolute joint. I want to call the joint to check it's degree of rotation, and then modify other parameters of the motor that drives it. I'm using rapier for a robotics simulation.

On Tue, May 21, 2024 at 11:36 AM Thierry Berger @.***> wrote:

I'm a bit confused, are you using a RevoluteJoint or an ImpulseJoint ?

Do you want to know the current angle of the joint (at the time you're calling the method) ? If yes, The data will not be enough as this contains only the configuration of the joint, you'll want to consolidate this information (local anchor + axis probably ?) with its entity transform.

— Reply to this email directly, view it on GitHub https://github.com/dimforge/bevy_rapier/issues/496#issuecomment-2122906894, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDY4YZHKV5FLMZODYDMAIHLZDNSX7AVCNFSM6AAAAABGVSLHC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSHEYDMOBZGQ . You are receiving this because you authored the thread.Message ID: @.***>

Vrixyz commented 2 months ago

With rapier 0.20 there are some helper functions ; https://github.com/dimforge/bevy_rapier/issues/530 attempts to bring an easier API around it