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