Ejemplo n.º 1
0
 void FixedUpdate()
 {
     Constants.SetConstants(compute, Time.fixedDeltaTime);
     VelSimulation.Simulate();
     Broadphase.FindBand(2f * constants.radius);
     for (var i = 0; i < 4; i++)
     {
         ParticleSolver.Solve();
         WallSolver.Solve();
         Velocities.ClampMagnitude();
     }
     PosSimulation.Simulate();
     BoundsChecker.Check();
     Lifes.Simulate();
 }
Ejemplo n.º 2
0
 void FixedUpdate()
 {
     Constants.SetConstants(compute, constants.FixedDeltaTime);
     VelSimulation.Simulate();
     if (particleCollisionEnabled)
     {
         Collisions.Detect(2f * constants.radius);
     }
     for (var i = 0; i < 10; i++)
     {
         PolygonSolver.Solve();
         if (particleCollisionEnabled)
         {
             ParticleSolver.Solve();
         }
         Velocities.ClampMagnitude();
     }
     PosSimulation.Simulate();
     BoundsChecker.Check();
     Lifes.Simulate();
 }