#1113 Link uml-reverse-mapper created class diagrams to readme, where needed
This commit is contained in:
@ -14,11 +14,6 @@ As explained in the book [Game Programming Patterns](http://gameprogrammingpatte
|
||||
|
||||
> efficiently locate objects by storing them in a data structure organized by their positions.
|
||||
|
||||
## Applicability
|
||||
This pattern can be used:
|
||||
* When you need to keep track of a large number of objects' positions, which are getting updated every frame.
|
||||
* When it is acceptable to trade memory for speed, since creating and updating data structure will use up extra memory.
|
||||
|
||||
## Explanation
|
||||
Say, you are building a war game with hundreds, or maybe even thousands of players, who are clashing on the battle field. Each player's position is getting updated every frame. The simple way to handle all interactions taking place on the field is to check each player's position against every other player's position:
|
||||
|
||||
@ -48,7 +43,14 @@ The idea behind the Spatial Partition design pattern is to enable quick location
|
||||
|
||||
In our implementation, we use the Quadtree data structure which will reduce the time complexity of finding the objects within a certain range from O(n^2) to O(nlogn), decreasing the computations required significantly in case of large number of objects.
|
||||
|
||||
## Class diagram
|
||||

|
||||
|
||||
## Applicability
|
||||
This pattern can be used:
|
||||
* When you need to keep track of a large number of objects' positions, which are getting updated every frame.
|
||||
* When it is acceptable to trade memory for speed, since creating and updating data structure will use up extra memory.
|
||||
|
||||
## Credits
|
||||
* [Game Programming Patterns/Spatial Partition](http://gameprogrammingpatterns.com/spatial-partition.html) by Bob Nystrom
|
||||
* [Quadtree tutorial](https://www.youtube.com/watch?v=OJxEcs0w_kE) by Daniel Schiffman
|
||||
|
||||
|
BIN
spatial-partition/etc/spatial-partition.urm.png
Normal file
BIN
spatial-partition/etc/spatial-partition.urm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
Reference in New Issue
Block a user