Beispiel #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);
        }
Beispiel #2
0
 public float?intersects(Ray ray)
 {
     return(Intersection.intersects(ray, storageSpace));
 }
Beispiel #3
0
 public override float?intersects(Microsoft.Xna.Framework.Ray ray)
 {
     return(Intersection.intersects(ray, plantBlocks.Keys.ToList()));
 }
Beispiel #4
0
 public override float?intersects(Microsoft.Xna.Framework.Ray ray)
 {
     return(Intersection.intersects(ray, blocksToBeRemoved));
 }