Introduce DynamicTree, Separate Ray from CollisionRay (#951)

* separates Rays from CollisionRays, removing collision masking from Ray

* Entity, ClientEntityManager and EntityManager classes occasionally need to UpdateEntityTree

Entity intersection queries now use a DynamicTree

DynamicTree now correctly reports Count and separately NodeCount

DynamicTree now has optionally precise queries

DynamicTree no longer incorrectly Adds on AddOrUpdate if Update is not necessary

Entity startup now starts Transform, then Collidable, then remaining components

EntityManger's Entity dictionary is now a ConcurrentDictionary to support iteration under modification

DynamicTree freeing root leaf no longer results in invalid tree

SnapGridComponent has been extended to support additional area and directional queries

* added lots of calls to UpdateEntityTree, will need to scale back during review

fixed moved/changed AABB updates to DynamicTree, missed a ref

converted other methods in EntityManager to use the tree for spatial queries

* add unit tests for DynamicTree

make Capacity and EnsureCapacity public, setting Capacity will call EnsureCapacity

* fix brace style

* Box2 Grow -> Enlarged, Combine -> Union
This commit is contained in:
Tyler Young
2020-02-06 08:13:15 -05:00
committed by GitHub
parent 58b460e9f5
commit 755675eaab
21 changed files with 2256 additions and 103 deletions

View File

@@ -422,10 +422,20 @@ namespace Robust.Server.Maps
private void FinishEntitiesStartup()
{
foreach (var entity in Entities)
{
_serverEntityManager.UpdateEntityTree(entity);
}
foreach (var entity in Entities)
{
_serverEntityManager.FinishEntityStartup(entity);
}
foreach (var entity in Entities)
{
_serverEntityManager.UpdateEntityTree(entity);
}
}
// Serialization