private BvhTreeAABB(BvhTreeAABB <TValue> first, BvhTreeAABB <TValue> second, AxisAlignedBoundingBox[] boundingBoxes, TValue[] values, int startIndexInclusive, int endIndexExclusive, AxisAlignedBoundingBox bounds) { First = first; Second = second; BoundingBoxes = boundingBoxes; Values = values; StartIndexInclusive = startIndexInclusive; EndIndexExclusive = endIndexExclusive; Bounds = bounds; }
public bool TryIntersect(ref DoubleVector3 p, out BvhTreeAABB <TValue> node) { if (!Bounds.Contains(ref p)) { node = null; return(false); } if (First != null) { return(First.TryIntersect(ref p, out node) || Second.TryIntersect(ref p, out node)); } for (var i = StartIndexInclusive; i < EndIndexExclusive; i++) { if (BoundingBoxes[i].Contains(ref p)) { node = this; return(true); } } node = null; return(false); }
public bool TryIntersect(DoubleVector3 p, out BvhTreeAABB <TValue> node) { return(TryIntersect(ref p, out node)); }