m_linearFactor

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

m_linearFactor

Post 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?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: m_linearFactor

Post 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.
Post Reply