c++physicsbullet

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


Solution

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