The Diagnosed 9mm
The Diagnosed 9mm

Reputation: 39

How can I lock a rigidbody's rotation on all axis? Bullet Physics

I am making a physics-based character controller however I have hit a roadblock; the character topples over. I have tried to use SetAngularFactor() but that only locks the rotation on 1 axis when I need to lock all 3. Here is a basic version of my code: rigidbody->setAngularFactor(btVector3(1.0f, 1.0f, 1.0f)); All help is appreciated

Upvotes: 0

Views: 94

Answers (1)

The Diagnosed 9mm
The Diagnosed 9mm

Reputation: 39

I am so silly! I just set the x,y and z in setAngularFactor() to 0 and it works as intended!

Upvotes: 1

Related Questions