Ejemplo n.º 1
0
        protected void PushToHeap(KDNode node, float2 tempClosestPoint, float2 queryPosition)
        {
            var queryNode = PushGetQueue();

            queryNode.node             = node;
            queryNode.tempClosestPoint = tempClosestPoint;

            float sqrDist = lengthsq(tempClosestPoint - queryPosition);

            queryNode.distance = sqrDist;
            minHeap.PushObj(queryNode, sqrDist);
        }
Ejemplo n.º 2
0
        protected void PushToHeap(KDNode node, Vector3 tempClosestPoint, Vector3 queryPosition)
        {
            var queryNode = PushGetQueue();

            queryNode.node             = node;
            queryNode.tempClosestPoint = tempClosestPoint;

            float sqrDist = Vector3.SqrMagnitude(tempClosestPoint - queryPosition);

            queryNode.distance = sqrDist;
            minHeap.PushObj(queryNode, sqrDist);
        }