Post Reply
Posts: 50
Joined: Sun Nov 23, 2008 4:43 pm


Post by bram » Fri Dec 21, 2018 7:23 pm

What is the function of btRigidBody's m_linearFactor member variable?

It is set by ::setLinearFactor() function.

But a grep on the source code doesn't show a single use of this function?

User avatar
Posts: 489
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: m_linearFactor

Post by drleviathan » Sun Dec 23, 2018 3:01 pm

As far as I can tell when looking at the code... the linearFactor is only used by the constraint solver. It is a component-wise scaling factor for applied impulses. The math is always done in the world-frame.

So, if you wanted an object to only ever slide along a limited set of the world-frame cannonical axes, you would set the other components of linearFactor to zero. For example: to constrain an object to only move in the XZ plane, you would set the Y-component of linearFactor to 0, and the XZ components to 1.

Post Reply