Page 1 of 1

m_linearFactor

Posted: Fri Dec 21, 2018 7:23 pm
by bram
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?

Re: m_linearFactor

Posted: Sun Dec 23, 2018 3:01 pm
by drleviathan
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.