protected override void OnCreate() { m_EndSimulationSystem = World.Active.GetOrCreateSystem <EndSimulationEntityCommandBufferSystem>(); m_BuildPhysicsWorldSystem = World.Active.GetOrCreateSystem <BuildPhysicsWorld>(); m_StepPhysicsWorld = World.Active.GetOrCreateSystem <StepPhysicsWorld>(); m_ExportPhysicsWorld = World.Active.GetOrCreateSystem <ExportPhysicsWorld>(); }
protected override void OnCreate() { m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_TriggerSystem = World.GetOrCreateSystem <TriggerEventConversionSystem>(); m_EndFramePhysicsSystem = World.GetOrCreateSystem <EndFramePhysicsSystem>(); m_HierarchyChildMask = EntityManager.GetEntityQueryMask( GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(Parent), typeof(LocalToWorld) } }) ); m_NonTriggerDynamicBodyMask = EntityManager.GetEntityQueryMask( GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(Translation), typeof(Rotation), typeof(PhysicsVelocity) }, None = new ComponentType[] { typeof(StatefulTriggerEvent) } }) ); }
protected override void OnCreate() { Enabled = false; m_BuildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_StepPhysicsWorld = World.GetOrCreateSystem <StepPhysicsWorld>(); m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); }
protected override void OnCreate() { Enabled = false; m_BuildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_StepPhysicsWorld = World.GetOrCreateSystem <StepPhysicsWorld>(); m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_FixedStepGroup = World.GetOrCreateSystem <FixedStepSimulationSystemGroup>(); }
protected override void OnCreate() { m_exportPhysicsWorldSystem = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_buildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_characterControllerQuery = GetEntityQuery( typeof(CharacterController), typeof(PhysicsCollider), typeof(Translation), typeof(Rotation) ); }
protected override void OnCreate() { m_ExportPhysicsWorldSystem = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_buildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_motorQuery = GetEntityQuery( typeof(KinematicMotor), typeof(Movement), typeof(PhysicsCollider), typeof(Translation), typeof(Rotation) ); }
protected override void OnCreate() { m_VerificationGroup = GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(ChangeCompoundFilterData) } }); RequireForUpdate(m_VerificationGroup); m_BuildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_ChangeCompoundFilterSystem = World.GetOrCreateSystem <ChangeCompoundFilterSystem>(); m_Counter = 0; }
protected override void OnCreate() { buildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); exportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); endFramePhysicsSystem = World.GetOrCreateSystem <EndFramePhysicsSystem>(); characterControllerGroup = GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(CharacterControllerComponent), typeof(Translation), typeof(Rotation), typeof(PhysicsCollider) } }); }
protected override void OnCreate() { m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>(); m_ExportPhysicsWorldSystem = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_EndFramePhysicsSystem = World.GetOrCreateSystem <EndFramePhysicsSystem>(); EntityQueryDesc query = new EntityQueryDesc { All = new ComponentType[] { typeof(CharacterControllerComponentData), typeof(CharacterControllerInternalData), typeof(PhysicsCollider), typeof(Translation), typeof(Rotation), } }; m_CharacterControllersGroup = GetEntityQuery(query); }
protected override void OnCreate() { m_ExportPhysicsWorldSystem = World.GetOrCreateSystem <ExportPhysicsWorld>(); InterpolatedDynamicBodiesGroup = GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(PhysicsVelocity), typeof(Translation), typeof(Rotation), typeof(PhysicsGraphicalInterpolationBuffer) }, None = new ComponentType[] { typeof(PhysicsExclude) }, Options = EntityQueryOptions.FilterWriteGroup }); RequireForUpdate(InterpolatedDynamicBodiesGroup); }
protected override void OnCreate() { base.OnCreate(); m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); m_SmoothRigidBodiesGraphicalMotion = World.GetOrCreateSystem <SmoothRigidBodiesGraphicalMotion>(); SmoothedDynamicBodiesGroup = GetEntityQuery(new EntityQueryDesc { All = new ComponentType[] { typeof(PhysicsVelocity), typeof(PhysicsGraphicalSmoothing) }, None = new ComponentType[] { typeof(PhysicsExclude) }, Options = EntityQueryOptions.FilterWriteGroup }); RequireForUpdate(SmoothedDynamicBodiesGroup); }
protected override void OnCreate() { buildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>(); exportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>(); endFramePhysicsSystem = World.GetOrCreateSystem <EndFramePhysicsSystem>(); }
public virtual IEnumerator LoadScenes([ValueSource(nameof(GetScenes))] string scenePath) { // Log scene name in case Unity crashes and test results aren't written out. Debug.Log("Loading " + scenePath); LogAssert.Expect(LogType.Log, "Loading " + scenePath); List <RigidTransform> expected = null; List <RigidTransform> actual = null; // First run { m_BuildPhysicsWorld = DefaultWorld.GetOrCreateSystem <BuildPhysicsWorld>(); m_StepPhysicsWorld = DefaultWorld.GetOrCreateSystem <StepPhysicsWorld>(); m_ExportPhysicsWorld = DefaultWorld.GetOrCreateSystem <ExportPhysicsWorld>(); var testSystem = GetTestSystem(); // Disable the systems DisablePhysicsSystems(); // Wait for running systems to finish yield return(null); // Load the scene StartTest(scenePath); while (!testSystem.TestingFinished()) { yield return(new WaitForSeconds(k_BusyWaitPeriodInSeconds)); } expected = EndTest(); } // Second run { m_BuildPhysicsWorld = DefaultWorld.GetOrCreateSystem <BuildPhysicsWorld>(); m_StepPhysicsWorld = DefaultWorld.GetOrCreateSystem <StepPhysicsWorld>(); m_ExportPhysicsWorld = DefaultWorld.GetOrCreateSystem <ExportPhysicsWorld>(); var testSystem = GetTestSystem(); DisablePhysicsSystems(); yield return(null); // Load the scene StartTest(scenePath); while (!testSystem.TestingFinished()) { yield return(new WaitForSeconds(k_BusyWaitPeriodInSeconds)); } actual = EndTest(); } // Compare results { // Verification int numSame = 0; int numBodies = expected.Count; for (int i = 0; i < numBodies; i++) { if (math.all(expected[i].pos == actual[i].pos) && math.all(expected[i].rot.value == actual[i].rot.value)) { numSame++; } else { if (!math.all(expected[i].pos == actual[i].pos)) { Debug.Log($"Expected Position: {expected[i].pos}, Actual: {actual[i].pos}, RigidBodyIndex: {i}"); } if (!math.all(expected[i].rot.value == actual[i].rot.value)) { Debug.Log($"Expected Rotation: {expected[i].rot.value}, Actual: {actual[i].rot.value}, RigidBodyIndex: {i}"); } } } Assert.AreEqual(numBodies, numSame, "Not all bodies have the same transform!"); LogAssert.NoUnexpectedReceived(); } }