Repository: godotengine/godot
File: modules/mono/glue/GodotSharp/GodotSharp/Core/AABB.cs (C#)

Code before:
        public Vector3 End
        {
            get { return _position + _size; }
            set { _size = value - _position; }
        }

        /// <summary>
        /// Returns an <see cref="AABB"/> with equivalent position and size, modified so that
        /// the most-negative corner is the origin and the size is positive.
        /// </summary>
        /// <returns>The modified <see cref="AABB"/>.</returns>
        public AABB Abs()
        {
            Vector3 end = End;
            Vector3 topLeft = new Vector3(Mathf.Min(_position.x, end.x), Mathf.Min(_position.y, end.y), Mathf.Min(_position.z, end.z));
            return new AABB(topLeft, _size.Abs());
        }

        /// <summary>
        /// Returns <see langword="true"/> if this <see cref="AABB"/> completely encloses another one.
        /// </summary>
        /// <param name="with">The other <see cref="AABB"/> that may be enclosed.</param>
        /// <returns>
        /// A <see langword="bool"/> for whether or not this <see cref="AABB"/> encloses <paramref name="with"/>.
        /// </returns>
        public bool Encloses(AABB with)
        {
            Vector3 srcMin = _position;
            Vector3 srcMax = _position + _size;
            Vector3 dstMin = with._position;
            Vector3 dstMax = with._position + with._size;

            return srcMin.x <= dstMin.x &&
                   srcMax.x > dstMax.x &&
                   srcMin.y <= dstMin.y &&
                   srcMax.y > dstMax.y &&
                   srcMin.z <= dstMin.z &&
                   srcMax.z > dstMax.z;
        }

        /// <summary>
        /// Returns this <see cref="AABB"/> expanded to include a given point.
        /// </summary>
        /// <param name="point">The point to include.</param>
        /// <returns>The expanded <see cref="AABB"/>.</returns>
        public AABB Expand(Vector3 point)
        {
            Vector3 begin = _position;
            Vector3 end = _position + _size;

            if (point.x < begin.x)

Review comment (suggestion):
```suggestion
            return _position + (_size * 0.5f);
```

Code after:
        public Vector3 End
        {
            get { return _position + _size; }
            set { _size = value - _position; }
        }

        /// <summary>
        /// Returns an <see cref="AABB"/> with equivalent position and size, modified so that
        /// the most-negative corner is the origin and the size is positive.
        /// </summary>
        /// <returns>The modified <see cref="AABB"/>.</returns>
        public AABB Abs()
        {
            Vector3 end = End;
            Vector3 topLeft = new Vector3(Mathf.Min(_position.x, end.x), Mathf.Min(_position.y, end.y), Mathf.Min(_position.z, end.z));
            return new AABB(topLeft, _size.Abs());
        }

        /// <summary>
        /// Returns the center of the <see cref="AABB"/>, which is equal
        /// to <see cref="Position"/> + (<see cref="Size"/> / 2).
        /// </summary>
        /// <returns>The center.</returns>
        public Vector3 GetCenter()
        {
            return _position + (_size * 0.5f);
        }

        /// <summary>
        /// Returns <see langword="true"/> if this <see cref="AABB"/> completely encloses another one.
        /// </summary>
        /// <param name="with">The other <see cref="AABB"/> that may be enclosed.</param>
        /// <returns>
        /// A <see langword="bool"/> for whether or not this <see cref="AABB"/> encloses <paramref name="with"/>.
        /// </returns>
        public bool Encloses(AABB with)
        {
            Vector3 srcMin = _position;
            Vector3 srcMax = _position + _size;
            Vector3 dstMin = with._position;
            Vector3 dstMax = with._position + with._size;

            return srcMin.x <= dstMin.x &&
                   srcMax.x > dstMax.x &&
                   srcMin.y <= dstMin.y &&
                   srcMax.y > dstMax.y &&
                   srcMin.z <= dstMin.z &&
                   srcMax.z > dstMax.z;
        }

        /// <summary>