From b26766ec401b8f3213e6b800282a19f7437ac98b Mon Sep 17 00:00:00 2001 From: Jean-David Moisan Date: Sun, 11 Feb 2024 18:07:02 -0500 Subject: [PATCH] Added Bounds to API --- Source/AABBTree.cs | 5 +++++ Source/IntervalTree.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Source/AABBTree.cs b/Source/AABBTree.cs index 4eeb145..7c49ba0 100644 --- a/Source/AABBTree.cs +++ b/Source/AABBTree.cs @@ -63,6 +63,11 @@ public float MoveConstant { /// public int Count => _tree.Count; + /// + /// Bounds of all the items in the tree. + /// + public RectangleF? Bounds => _tree.Root != AABB_TREE_NULL_NODE_INDEX ? _tree.AABBs[_tree.Root] : null; + /// /// Adds a new leaf to the tree, and rebalances as necessary. /// diff --git a/Source/IntervalTree.cs b/Source/IntervalTree.cs index e33fa2a..2158355 100644 --- a/Source/IntervalTree.cs +++ b/Source/IntervalTree.cs @@ -61,6 +61,11 @@ public float MoveConstant { /// public int Count => _tree.Count; + /// + /// Bounds of all the items in the tree. + /// + public Interval? Bounds => _tree.Root != INTERVAL_TREE_NULL_NODE_INDEX ? _tree.Intervals[_tree.Root] : null; + /// /// Adds a new leaf to the tree, and rebalances as necessary. ///