private static void ApplyAnisotropicFriction(CollisionObject colObj, ref IndexedVector3 frictionDirection) { if (colObj != null && colObj.HasAnisotropicFriction()) { // transform to local coordinates IndexedVector3 loc_lateral = frictionDirection * colObj.GetWorldTransform()._basis; IndexedVector3 friction_scaling = colObj.GetAnisotropicFriction(); //apply anisotropic friction loc_lateral *= friction_scaling; // ... and transform it back to global coordinates frictionDirection = colObj.GetWorldTransform()._basis * loc_lateral; } }