public void UpdateWorldOneStaticBoxTest() { Unity.Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(1); BroadPhaseTests.addStaticBoxToWorld(world, 0, Vector3.zero, quaternion.identity, new Vector3(10, .1f, 10)); world.CollisionWorld.UpdateDynamicTree(ref world, 1 / 60, -9.81f * math.up()); world.Dispose(); }
public void UpdateWorldOneHundredStaticBoxesTest() { Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(100); for (int i = 0; i < 100; ++i) { BroadPhaseTests.addStaticBoxToWorld(world, i, new Vector3(11 * i, 0, 0), quaternion.identity, new Vector3(10, .1f, 10)); } world.CollisionWorld.UpdateDynamicTree(ref world, 1 / 60, -9.81f * math.up()); world.Dispose(); }
public void SheduleUpdateJobsOneStaticBoxTest() { Unity.Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(1); BroadPhaseTests.addStaticBoxToWorld(world, 0, Vector3.zero, quaternion.identity, new Vector3(10, .1f, 10)); Unity.Jobs.JobHandle handle = new Unity.Jobs.JobHandle(); Unity.Jobs.JobHandle worldJobHandle = world.CollisionWorld.ScheduleUpdateDynamicLayer(ref world, 1 / 60, 1, handle); worldJobHandle.Complete(); Assert.IsTrue(worldJobHandle.IsCompleted); world.Dispose(); }
public void SheduleUpdateJobsOneStaticBoxTest() { for (int numThreads = 0; numThreads <= 8; numThreads++) { Unity.Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(1); BroadPhaseTests.addStaticBoxToWorld(world, 0, Vector3.zero, quaternion.identity, new Vector3(10, .1f, 10)); Unity.Jobs.JobHandle handle = new Unity.Jobs.JobHandle(); Unity.Jobs.JobHandle worldJobHandle = world.CollisionWorld.ScheduleUpdateDynamicTree(ref world, 1 / 60, -9.81f * math.up(), handle, numThreads); worldJobHandle.Complete(); Assert.IsTrue(worldJobHandle.IsCompleted); world.Dispose(); } }
public void SheduleUpdateJobsOneHundredStaticBoxesTest() { Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(100); for (int i = 0; i < 100; ++i) { BroadPhaseTests.addStaticBoxToWorld(world, i, new Vector3(11 * i, 0, 0), quaternion.identity, new Vector3(10, .1f, 10)); } Unity.Jobs.JobHandle handle = new Unity.Jobs.JobHandle(); Unity.Jobs.JobHandle worldJobHandle = world.CollisionWorld.ScheduleUpdateDynamicLayer(ref world, 1 / 60, 1, handle); worldJobHandle.Complete(); Assert.IsTrue(worldJobHandle.IsCompleted); world.Dispose(); }
public void SheduleUpdateJobsTenStaticBoxesTest() { for (int numThreads = 0; numThreads <= 1; numThreads++) { Physics.PhysicsWorld world = BroadPhaseTests.createTestWorld(10); for (int i = 0; i < 10; ++i) { BroadPhaseTests.addStaticBoxToWorld(world, i, new Vector3(11 * i, 0, 0), quaternion.identity, new Vector3(10, .1f, 10)); } Unity.Jobs.JobHandle handle = new Unity.Jobs.JobHandle(); Unity.Jobs.JobHandle worldJobHandle = world.CollisionWorld.ScheduleUpdateDynamicTree(ref world, 1 / 60, -9.81f * math.up(), handle, numThreads == 1); worldJobHandle.Complete(); Assert.IsTrue(worldJobHandle.IsCompleted); world.Dispose(); } }