private static void AddNRandomObjects(int n, ref ISweepAndPrune <Object> sap, Vector2 minPoint, Vector2 maxPoint, float minRadius, float maxRadius) { while (n-- > 0) { sap.AddObject(RandomObject(minPoint, maxPoint, minRadius, maxRadius)); } }
public Simulation(Pathing.NavMesh navMesh) { this.NavMesh = navMesh; this.Settings = new Settings(); Running = true; sweepAndPrune = new SweepAndPrune1D<Unit>(false); //staticObjects = new BruteForceBoundingVolumeHierarchy<Object>(); //staticObjects = new Quadtree<Object>(0, 0, width, height, 5); staticObjects = new Quadtree<Object>(10); StaticObjectsProbe = new BVHProbe<Object>(staticObjects); //unitObjects = new BruteForceBoundingVolumeHierarchy<Unit>(); //unitObjects = new Quadtree<Unit>(0, 0, width, height, 5); unitObjects = new Quadtree<Unit>(4); UnitObjectsProbe = new BVHProbe<Unit>(unitObjects); projectiles = new List<Projectile>(); }
private static void RemoveNRandomObjects(int n, ref ISweepAndPrune <Object> sap) { //sap.DebugRemoveRandomObject((float)random.NextDouble()); }