mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
Cache broadphases and container rejig (#3407)
This commit is contained in:
@@ -88,18 +88,15 @@ namespace Robust.Shared.Physics.Systems
|
||||
int collisionMask,
|
||||
bool approximate = true,
|
||||
PhysicsComponent? body = null,
|
||||
FixturesComponent? fixtureComp = null)
|
||||
FixturesComponent? fixtureComp = null,
|
||||
TransformComponent? xform = null)
|
||||
{
|
||||
var entities = new HashSet<EntityUid>();
|
||||
|
||||
if (!Resolve(uid, ref body, ref fixtureComp, false))
|
||||
if (!Resolve(uid, ref body, ref fixtureComp, ref xform, false))
|
||||
return entities;
|
||||
|
||||
var broadQuery = GetEntityQuery<BroadphaseComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
var broadphase = _lookup.GetBroadphase(uid, xformQuery.GetComponent(uid), broadQuery, xformQuery);
|
||||
|
||||
if (broadphase == null)
|
||||
if (!_lookup.TryGetCurrentBroadphase(xform, out var broadphase))
|
||||
return entities;
|
||||
|
||||
var state = (body, entities);
|
||||
|
||||
Reference in New Issue
Block a user