public bool Compare(BVHShapeInfo p) { int b = (nBuckets * ((p.centroid[dim] - centroidBounds.min[dim]) / (centroidBounds.max[dim] - centroidBounds.min[dim]))).ToInt(); if (b == nBuckets) { b = nBuckets - 1; } Debug.Assert(b >= 0 && b < nBuckets); return(b <= splitBucket); }
public int Compare(BVHShapeInfo a, BVHShapeInfo b) { var ret = (a.centroid[dim] - b.centroid[dim]); return(ret < 0 ? -1 : (ret == 0) ? 0 : 1); }
public bool Compare(BVHShapeInfo a) { return(a.centroid[dim] < mid); }