private static RayIntersectsModel ( Microsoft.Xna.Framework.Ray ray, |
||
ray | Microsoft.Xna.Framework.Ray | |
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;
}