BEPUphysics.SolverSystems.SolverUpdateable.UpdateSolverActivity C# (CSharp) Method

UpdateSolverActivity() public method

Updates the activity state of the solver updateable based on its members.
public UpdateSolverActivity ( ) : void
return void
        public virtual void UpdateSolverActivity()
        {
            if (isActive)
            {
                //This is a simulation island connection.  We already know that all connected objects share the
                //same simulation island (or don't have one, in the case of kinematics).  All we have to do is test to see if that island is active!
                for (int i = 0; i < simulationIslandConnection.entries.Count; i++)
                {
                    var island = simulationIslandConnection.entries.Elements[i].Member.SimulationIsland;
                    if (island != null && island.isActive)
                    {
                        isActiveInSolver = true;
                        return;
                    }
                }
            }
            isActiveInSolver = false;
        }

Usage Example

Example #1
0
 protected internal void UnsafePrestep(SolverUpdateable updateable)
 {
     updateable.UpdateSolverActivity();
     if (updateable.isActiveInSolver)
     {
         SolverSettings solverSettings = updateable.solverSettings;
         solverSettings.currentIterations       = 0;
         solverSettings.iterationsAtZeroImpulse = 0;
         updateable.Update(timeStepSettings.TimeStepDuration);
         updateable.ExclusiveUpdate();
     }
 }
All Usage Examples Of BEPUphysics.SolverSystems.SolverUpdateable::UpdateSolverActivity