Beispiel #1
0
        public bool MinResult(CollisionResult cr)
        {
            if (cr.collision)
            {
                collision = true;
            }

            if (!distanceReversed.HasValue || (cr.distanceReversed.HasValue && cr.distanceReversed < distanceReversed))
            {
                distanceReversed = cr.distanceReversed;
                axisColReversed  = cr.axisColReversed;
            }

            if (!distance.HasValue || (cr.distance.HasValue && cr.distance < distance))
            {
                distance = cr.distance;
                axisCol  = cr.axisCol;

                return(true);
            }
            return(false);
        }