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); }
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); }