You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/future_features.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,26 +5,42 @@ If you really want any of these features, please let us know by opening an issue
5
5
6
6
If you have any suggestions or would like to contribute, please feel free to open an issue or a pull request.
7
7
8
-
## Planned Features
8
+
The features will likely be implemented in the order they are listed below, but this is not guaranteed.
9
9
10
-
### 1. [COMPLETE] Quadtree serialization
10
+
##🚧 Planned Features
11
11
12
-
By serializing the quadtree, we can save its state to a file and load it later. This will allow us to persist the quadtree structure and data across sessions. For example, you could pre build a quadtree with all the walls in your video game level, serialize it to a file, and then load it when the game starts. This will heavily reduce the game load time since you won't have to rebuild the quadtree from scratch every time.
12
+
### 1. Configurable Quadtree Coordinate Type
13
13
14
-
### 2. Circle support
14
+
Currently, the point quadtree only uses f32 for point coordinates, limiting precision in favor of better performance.
15
+
To make the quadtree more flexible, we could allow users to specify the coordinate type (e.g., f64, i32, etc.) when creating a quadtree.
16
+
The f32 will remain the default, but users will be able to specify a different type if needed.
15
17
16
-
Currently, we support points and rectangles in two separate quadtrees.
17
-
For example, in the ball-pit demo, we use a point quadtree, but then query a larger area to account for the radius of the balls.
18
-
With a circle quadtree, we could directly insert circles and perform circle-circle collision detection.
18
+
If the type cannot be made truly generic, then only the following types would be supported: f32, f64, i32, i64
19
19
20
-
### 3. KNN with criteria function
20
+
### 2. KNN with criteria function
21
21
22
22
Currently, KNN only supports finding the nearest neighbors based on euclidean distance.
23
23
By adding a criteria function, we could allow users to define custom criteria for finding neighbors by passing a function that
24
24
takes in a point and returns a score. The KNN algorithm would then use this score to determine the nearest neighbors.
25
25
26
-
### 4. KNN in rectangle quadtree
26
+
### 3. KNN in rectangle quadtree
27
27
28
28
Currently, KNN is only supported in the point quadtree. By adding KNN support to the rectangle quadtree, we could allow users to find the nearest rectangles to a given point. This would be to the nearest edge of the rectangle, adding complexity to the algorithm.
29
29
However, it will allow for really quick collision detection between a point and a set of rectangles as the point can just do
30
-
robust-collision handling with the nearest rectangles.
30
+
robust-collision handling with the nearest rectangles.
31
+
32
+
### 4. Circle support
33
+
34
+
Currently, we support points and rectangles in two separate quadtrees.
35
+
For example, in the ball-pit demo, we use a point quadtree, but then query a larger area to account for the radius of the balls.
36
+
With a circle quadtree, we could directly insert circles and perform circle-circle collision detection.
37
+
38
+
A good alternative is to use the rectangle quadtree and insert the minimum bounding rectangles of the circles.
39
+
40
+
## ✅ Completed Planned Features
41
+
42
+
Once a feature from above is completed, it will be moved to this section.
43
+
44
+
### Quadtree serialization
45
+
46
+
By serializing the quadtree, we can save its state to a file and load it later. This will allow us to persist the quadtree structure and data across sessions. For example, you could pre build a quadtree with all the walls in your video game level, serialize it to a file, and then load it when the game starts. This will heavily reduce the game load time since you won't have to rebuild the quadtree from scratch every time.
0 commit comments