Update() public method

Performs a single timestep.
public Update ( ) : void
return void
    public override void XUpdate()
    {
        //UnityEngine.Profiling.Profiler.BeginSample("BEPUPhysics - Update");
        _physicsSpace.Update(Time.deltaTime);

        for (int i = 0; i < nonMonoPhysics.Count; i++)
        {
            nonMonoPhysics [i].XPhysicsUpdate();
        }

        for (int i = 0; i < dynamicColliders.Count; i++)
        {
            dynamicColliders [i].XPhysicsUpdate();
        }

        //UnityEngine.Profiling.Profiler.EndSample();
    }
        double RunTest(IParallelLooper threadManager, Func<Space, int> simulationBuilder)
        {

            Space space = new Space(threadManager);

            var timeStepCount = simulationBuilder(space);


            //Perform one starter frame to warm things up.
            space.Update();

            var startTime = Stopwatch.GetTimestamp() / (double)Stopwatch.Frequency;
            for (int i = 0; i < timeStepCount; i++)
            {
                space.Update();
            }
            var endTime = Stopwatch.GetTimestamp() / (double)Stopwatch.Frequency;
            return endTime - startTime;
        }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     world.Update();
 }