internal void CleanUp() { SlatedForRemoval = false; entries.Clear(); Owner = null; DeactivationManager = null; }
///<summary> /// Constructs a new space for things to live in. ///</summary> ///<param name="parallelLooper">Used by the space to perform multithreaded updates. Pass null if multithreading is not required.</param> public Space(IParallelLooper parallelLooper) { timeStepSettings = new TimeStepSettings(); this.parallelLooper = parallelLooper; SpaceObjectBuffer = new SpaceObjectBuffer(this); EntityStateWriteBuffer = new EntityStateWriteBuffer(); DeactivationManager = new DeactivationManager(TimeStepSettings, ParallelLooper); ForceUpdater = new ForceUpdater(TimeStepSettings, ParallelLooper); BoundingBoxUpdater = new BoundingBoxUpdater(TimeStepSettings, ParallelLooper); BroadPhase = new DynamicHierarchy(ParallelLooper); NarrowPhase = new NarrowPhase(TimeStepSettings, BroadPhase.Overlaps, ParallelLooper); Solver = new Solver(TimeStepSettings, DeactivationManager, ParallelLooper); NarrowPhase.Solver = Solver; PositionUpdater = new ContinuousPositionUpdater(TimeStepSettings, ParallelLooper); BufferedStates = new BufferedStatesManager(ParallelLooper); DeferredEventDispatcher = new DeferredEventDispatcher(); DuringForcesUpdateables = new DuringForcesUpdateableManager(timeStepSettings, ParallelLooper); BeforeNarrowPhaseUpdateables = new BeforeNarrowPhaseUpdateableManager(timeStepSettings, ParallelLooper); BeforeSolverUpdateables = new BeforeSolverUpdateableManager(timeStepSettings, ParallelLooper); BeforePositionUpdateUpdateables = new BeforePositionUpdateUpdateableManager(timeStepSettings, ParallelLooper); EndOfTimeStepUpdateables = new EndOfTimeStepUpdateableManager(timeStepSettings, ParallelLooper); EndOfFrameUpdateables = new EndOfFrameUpdateableManager(timeStepSettings, ParallelLooper); }
internal void CleanUp() { SlatedForRemoval = false; members.Clear(); Owner = null; DeactivationManager = null; }
///<summary> /// Constructs a Solver. ///</summary> ///<param name="timeStepSettings">Time step settings used by the solver.</param> ///<param name="deactivationManager">Deactivation manager used by the solver.</param> public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager) { TimeStepSettings = timeStepSettings; DeactivationManager = deactivationManager; multithreadedPrestepDelegate = MultithreadedPrestep; multithreadedIterationDelegate = MultithreadedIteration; Enabled = true; }
///<summary> /// Constructs a Solver. ///</summary> ///<param name="timeStepSettings">Time step settings used by the solver.</param> ///<param name="deactivationManager">Deactivation manager used by the solver.</param> public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager) { TimeStepSettings = timeStepSettings; DeactivationManager = deactivationManager; multithreadedPrestepDelegate = MultithreadedPrestep; multithreadedExclusiveUpdateDelegate = MultithreadedExclusiveUpdate; multithreadedIterationDelegate = MultithreadedIteration; Enabled = true; PermutationMapper = new PermutationMapper(); }
///<summary> /// Constructs a Solver. ///</summary> ///<param name="timeStepSettings">Time step settings used by the solver.</param> ///<param name="deactivationManager">Deactivation manager used by the solver.</param> /// <param name="threadManager">Thread manager used by the solver.</param> public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager, IThreadManager threadManager) : this(timeStepSettings, deactivationManager) { ThreadManager = threadManager; AllowMultithreading = true; }
///<summary> /// Constructs a new space for things to live in. ///</summary> public Space() { NarrowPhaseHelper.CollisionManagers = NarrowPhaseHelper.CollisionManagers; //Forces the NarrowPhaseHelper to run the static constructor. Better to do it now instead of mid-simulation. timeStepSettings = new TimeStepSettings(); #if !WINDOWS threadManager = new SpecializedThreadManager(); #else threadManager = new SpecializedThreadManager(); #endif SpaceObjectBuffer = new SpaceObjectBuffer(this); EntityStateWriteBuffer = new EntityStateWriteBuffer(); DeactivationManager = new DeactivationManager(TimeStepSettings, ThreadManager); ForceUpdater = new ForceUpdater(TimeStepSettings, ThreadManager); BoundingBoxUpdater = new BoundingBoxUpdater(TimeStepSettings, ThreadManager); BroadPhase = new DynamicHierarchy(ThreadManager); NarrowPhase = new NarrowPhase(TimeStepSettings, BroadPhase.Overlaps, ThreadManager); Solver = new Solver(TimeStepSettings, DeactivationManager, ThreadManager); NarrowPhase.Solver = Solver; PositionUpdater = new ContinuousPositionUpdater(TimeStepSettings, ThreadManager); BufferedStates = new BufferedStatesManager(ThreadManager); DeferredEventDispatcher = new DeferredEventDispatcher(); DuringForcesUpdateables = new DuringForcesUpdateableManager(timeStepSettings, ThreadManager); BeforeNarrowPhaseUpdateables = new BeforeNarrowPhaseUpdateableManager(timeStepSettings, ThreadManager); BeforeSolverUpdateables = new BeforeSolverUpdateableManager(timeStepSettings, ThreadManager); BeforePositionUpdateUpdateables = new BeforePositionUpdateUpdateableManager(timeStepSettings, ThreadManager); EndOfTimeStepUpdateables = new EndOfTimeStepUpdateableManager(timeStepSettings, ThreadManager); EndOfFrameUpdateables = new EndOfFrameUpdateableManager(timeStepSettings, ThreadManager); }
///<summary> /// Constructs a Solver. ///</summary> ///<param name="timeStepSettings">Time step settings used by the solver.</param> ///<param name="deactivationManager">Deactivation manager used by the solver.</param> /// <param name="parallelLooper">Parallel loop provider used by the solver.</param> public Solver(TimeStepSettings timeStepSettings, DeactivationManager deactivationManager, IParallelLooper parallelLooper) : this(timeStepSettings, deactivationManager) { ParallelLooper = parallelLooper; AllowMultithreading = true; }