private static bool RayIntersectsModel(Ray ray, Model model, Matrix worldTransform, Matrix[] absoluteBoneTransforms) { foreach (ModelMesh mesh in model.Meshes) { Matrix world = absoluteBoneTransforms[mesh.ParentBone.Index] * worldTransform; BoundingSphere sphere = TransformBoundingSphere(mesh.BoundingSphere, world); if (sphere.Intersects(ray) != null) return true; } return false; }