Пример #1
0
        public override float?intersects(Microsoft.Xna.Framework.Ray ray)
        {
            float?intersection = null;
            Tree  closest      = null; //currently found but not used for anything

            foreach (Tree test in trees)
            {
                float?thisIntersecton = Intersection.intersects(ray, test.getTrunkBlocks());
                if (thisIntersecton.HasValue)
                {
                    if (intersection.HasValue == false || (float)thisIntersecton < (float)intersection)
                    {
                        intersection = thisIntersecton;
                        closest      = test;
                    }
                }
            }
            return(intersection);
        }
Пример #2
0
 public float?intersects(Ray ray)
 {
     return(Intersection.intersects(ray, storageSpace));
 }
Пример #3
0
 public override float?intersects(Microsoft.Xna.Framework.Ray ray)
 {
     return(Intersection.intersects(ray, plantBlocks.Keys.ToList()));
 }
Пример #4
0
 public override float?intersects(Microsoft.Xna.Framework.Ray ray)
 {
     return(Intersection.intersects(ray, blocksToBeRemoved));
 }