Sign in to follow this  

Bullet and handedness (or handedness of physics SDKs in general)

This topic is 2665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
I use a left-handed coordinate system, while Bullet's documentation says it uses right-handed. Back when first integrating Bullet I had some trouble with objects not rotating like they should, so I thought "it must be the handedness" and started reversing Z coordinates of vectors, and Z & W of quaternions whenever they were passed between Bullet & my code. Also, for triangle mesh data, I inverted the winding.

I didn't like this extra conversion step, so I started thinking: how would I have to modify Bullet to accept left-handed coordinates directly? What math operations inside it actually depend on handedness?

However, before I got that far, I just tried to carefully remove all the sign-negations I had inserted, as well as the triangle winding. And it just worked :) Naturally, I was very pleased.

Now, the questions are: Did I actually do wrong when I got rid of the left-right-left conversion? Is there some hidden gotcha waiting for me that my (simple) test programs just don't show me yet?

(I would be tempted to guess no on both counts)

Share this post


Link to post
Share on other sites
It's not immediately clear to me how a physics engine can be (spatially) left-handed or right-handed. Spatial handedness only comes into play when something is visualized, and a physics engine can (and usually does) operate independently of any particular mode of visualization.

I would imagine that it's fine not to perform any conversion, but I'm not familiar enough with Bullet to say for sure.

Share this post


Link to post
Share on other sites
Well... if you look at all the demos for Bullet, the internal representation is 100% compatable with OpenGL's representation. It just passes the matrix straight from the graphics API. At work, we were using DirectX, and it also "just worked" without any conversions.

What exactly were you doing that was breaking it for you?

Share this post


Link to post
Share on other sites
Quote:
Original post by KulSeran
What exactly were you doing that was breaking it for you?

I never committed a revision with the broken code, so I can no longer dig it up, and no longer remember exactly. Probably it was related to the debug draw api; I switched debug draw on for the first time, something was broken in how I was doing it, and I got scared by the physics & rendering representations seemingly differing.

Share this post


Link to post
Share on other sites

This topic is 2665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this