hyades.level.Level.RayIntersectsModel C# (CSharp) Method

RayIntersectsModel() private static method

private static RayIntersectsModel ( Microsoft.Xna.Framework.Ray ray, Model model, Matrix worldTransform, Matrix absoluteBoneTransforms ) : bool
ray Microsoft.Xna.Framework.Ray
model Microsoft.Xna.Framework.Graphics.Model
worldTransform Matrix
absoluteBoneTransforms Matrix
return bool
        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;
        }