Beispiel #1
0
    public void AddObject(IUKSpatialObject o)
    {
        Profiler.BeginSample("AddObject");

        foreach(var h in EnumHashsOfBounds(o.SpatialBounds())) {
            EnsureHash(h);
            var l = spatialHashTable[h];
            if (!l.ContainsKey(o)) l.Add(o, h);
        }

        Profiler.EndSample();
    }
Beispiel #2
0
    public void RemoveObject(IUKSpatialObject o)
    {
        Profiler.BeginSample("RemoveObject");

        foreach(var h in EnumHashsOfBounds(o.SpatialBounds())) {
            EnsureHash(h);
            var l = spatialHashTable[h];
            l.Remove(o);
        }

        Profiler.EndSample();
    }