コード例 #1
0
        [MethodImpl(MethodImplOptions.AggressiveInlining)] private QVector2D CalculateChildCenter(QQuadrant quadrant, QVector2D childHalfRegion)
        {
            float xSign = (quadrant.XComponentIsPositive()) ? 1 : -1;
            float ySign = (quadrant.YComponentIsPositive()) ? 1 : -1;

            return(new QVector2D(
                       lastPointInserted.x + xSign * childHalfRegion.x,
                       lastPointInserted.y + ySign * childHalfRegion.y
                       ));
        }
コード例 #2
0
        private QVector2D CalculateChildCenter(QQuadrant quadrant, QVector2D childHalfRegion)
        {
            float xSign = (quadrant.XComponentIsPositive()) ? 1 : -1;
            float ySign = (quadrant.YComponentIsPositive()) ? 1 : -1;

            return(new QVector2D(
                       region.center.x + xSign * childHalfRegion.x,
                       region.center.y + ySign * childHalfRegion.y
                       ));
        }