protected void applyAnisotropicFriction( btCollisionObject colObj, ref btVector3 frictionDirection , btCollisionObject.AnisotropicFrictionFlags frictionMode ) { if( colObj != null && colObj.hasAnisotropicFriction( frictionMode ) ) { // transform to local coordinates btVector3 loc_lateral;// = frictionDirection * colObj.getWorldTransform().getBasis(); colObj.m_worldTransform.m_basis.Apply( ref frictionDirection, out loc_lateral ); //btVector3 friction_scaling; = colObj.getAnisotropicFriction(); //apply anisotropic friction loc_lateral.Mult( ref colObj.m_anisotropicFriction, out loc_lateral ); // ... and transform it back to global coordinates colObj.m_worldTransform.m_basis.Apply( ref loc_lateral, out frictionDirection ); //frictionDirection = colObj.getWorldTransform().getBasis() * loc_lateral; } }