public void MultipleUpdateOptimized()
            {
                TestUtility.Time("Reference_MultipleUpdate_Sorted_Optimized", () =>
                {
                    var dt = new Unity.Mathematics.Random(RandomizerSeed);
                    GameObjectStruct.UpdateMultipleOptimizedNonContiguous(OrderedNonContiguous, dt.NextFloat(), GameObjectStruct.FlightJitter, GameObjectStruct.Damping);
                });

                TestUtility.Time("Reference_MultipleUpdate_Randomize_Optimized", () =>
                {
                    var dt = new Unity.Mathematics.Random(RandomizerSeed);
                    GameObjectStruct.UpdateMultipleOptimizedNonContiguous(RandomizedNonContiguous, dt.NextFloat(), GameObjectStruct.FlightJitter, GameObjectStruct.Damping);
                });

                TestUtility.Time("Struct_MultipleUpdate_Sorted_Optimized", () =>
                {
                    var dt = new Unity.Mathematics.Random(RandomizerSeed);
                    GameObjectStruct.UpdateMultipleOptimizedContiguous(OrderedContiguous, dt.NextFloat(), GameObjectStruct.FlightJitter, GameObjectStruct.Damping);
                });

                TestUtility.Time("Struct_MultipleUpdate_Randomize_Optimized", () =>
                {
                    var dt = new Unity.Mathematics.Random(RandomizerSeed);
                    GameObjectStruct.UpdateMultipleOptimizedContiguous(RandomizedContiguous, dt.NextFloat(), GameObjectStruct.FlightJitter, GameObjectStruct.Damping);
                });
            }
Example #2
0
 private static void BurstUpdateImpl(ref GameObjectStruct obj, float deltaTime, float flightJitter, float damping)
 {
     obj.Velocity += obj.Random.NextFloat3Direction() * flightJitter * deltaTime;
     obj.Velocity *= (1f - damping);
 }