Iteratively solves solver updateables, converging to a solution for simulated joints and collision pair contact constraints.
Inheritance: MultithreadedProcessingStage
Exemple #1
0
        ///<summary>
        /// Constructs a new space for things to live in.
        ///</summary>
        ///<param name="threadManager">Thread manager to use with the space.</param>
        public Space(IThreadManager threadManager)
        {
            timeStepSettings = new TimeStepSettings();

            this.threadManager = threadManager;

            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>
 /// Called when the updateable is removed from its solver.
 /// </summary>
 /// <param name="oldSolver">Solver from which the updateable was removed.</param>
 public override void OnRemovalFromSolver(Solver oldSolver)
 {
     //This should only be called after the constraint has been removed from the solver.
     if (pair == null)
     {
         CleanUpReferences();
     }
 }
Exemple #3
0
        ///<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);

        }
Exemple #4
0
 /// <summary>
 /// Called when the updateable is removed from its solver.
 /// </summary>
 /// <param name="oldSolver">Solver from which the updateable was removed.</param>
 public virtual void OnRemovalFromSolver(Solver oldSolver)
 {
 }
Exemple #5
0
 ///<summary>
 /// Called when the updateable is added to a solver.
 ///</summary>
 ///<param name="newSolver">Solver to which the updateable was added.</param>
 public virtual void OnAdditionToSolver(Solver newSolver)
 {
 }