예제 #1
0
        private bool FindCircleVector(bool includeCurrent)
        {
            if (includeCurrent == false)
            {
                currentIndex++;
            }

            for (var index = currentIndex; index < boundsIterator.Count; index++)
            {
                var position = boundsIterator[index];

                var length = position.lengthSquared();
                if (length > CircleUtilities.GetRadiusSquared(circle.radius))
                {
                    continue;
                }
                if (edge && circle.radius > 0 && length < CircleUtilities.GetRadiusSquared(circle.radius - 1))
                {
                    continue;
                }

                if (currentIndex == index)
                {
                    continue;
                }

                currentIndex = index;

                return(true);
            }

            return(false);
        }
예제 #2
0
        /// Gets whether [pos] is in the outermost edge of the circle.
        public bool isEdge(VectorBase pos)
        {
            var leadingEdge = true;

            if (radius > 0)
            {
                leadingEdge = (pos - center) > CircleUtilities.GetRadiusSquared(radius - 1);
            }

            return(leadingEdge);
        }