Use constraints to implement 2D physics

Hi,

I’m looking into building a simple physics driven 2D game (Asteroids clone basically), rigidbodies on everything. I’ve got collisions going, and quckly realizing that all my sprites are spinning out of control in all three axis. Now I should have expected that, it is a 3D engine after all, but is there some way to constrain rotation to one axis and movement to the other two?

I was looking into the Constraint concept, but it’s not exhaustively documented yet. I assume I’m to use 6DoF constraints but I can’t figure out what matrix to provide.

Any advice for me?

Cheers!

It is quite simple. Don’t need constraints at all.
Just check RigidbodyComponent.AngularFactor and RigidbodyComponent.LinearFactor.

1 Like

That works perfectly, thanks @sinkingsugar!