protected override void OnUpdate() { if (m_PhysicsWorldSystem.PhysicsWorld.BodyCount == 0) { return; } var debugDisplay = GetSingleton <PhysicsDebugDisplay>(); if (debugDisplay.DrawColliderAabbs == 0) { return; } JobHandle callback(ref PhysicsWorld world, JobHandle deps) { return(new DisplayColliderAabbJob { OutputStream = m_DebugStreamSystem.GetContext(1), DebugDisplay = debugDisplay, PhysicsBodies = m_PhysicsWorldSystem.PhysicsWorld.AllBodies }.Schedule(deps)); } m_PhysicsWorldSystem.ScheduleCallback(PhysicsCallbacks.Phase.PreStepSimulation, callback); }
protected override void OnUpdate() { if (m_PhysicsWorldSystem.PhysicsWorld.BodyCount == 0) { return; } var debugDisplay = GetSingleton <PhysicsDebugDisplay>(); if (debugDisplay.DrawStaticColliders != 0) { JobHandle callback(ref PhysicsWorld world, JobHandle deps) { return(new DisplayColliderJob { OutputStream = m_DebugStreamSystem.GetContext(1), ColliderColor = (Vector4)debugDisplay.StaticColliderColor, PhysicsBodies = m_PhysicsWorldSystem.PhysicsWorld.StaticBodies }.Schedule(deps)); } m_PhysicsWorldSystem.ScheduleCallback(PhysicsCallbacks.Phase.PreStepSimulation, callback); } if (debugDisplay.DrawDynamicColliders != 0) { JobHandle callback(ref PhysicsWorld world, JobHandle deps) { return(new DisplayColliderJob { OutputStream = m_DebugStreamSystem.GetContext(1), ColliderColor = (Vector4)debugDisplay.DynamicColliderColor, PhysicsBodies = m_PhysicsWorldSystem.PhysicsWorld.DynamicBodies }.Schedule(deps)); } m_PhysicsWorldSystem.ScheduleCallback(PhysicsCallbacks.Phase.PreStepSimulation, callback); } }
protected override void OnUpdate() { var debugDisplay = GetSingleton <PhysicsDebugDisplay>(); if (debugDisplay.DrawBroadphase == 0) { return; } JobHandle callback(ref PhysicsWorld world, JobHandle deps) { return(new DisplayBroadphaseJob { OutputStream = m_DebugStreamSystem.GetContext(1), DebugDisplay = debugDisplay, StaticNodes = world.CollisionWorld.Broadphase.StaticTree.Nodes, DynamicNodes = world.CollisionWorld.Broadphase.DynamicTree.Nodes, }.Schedule(deps)); } m_PhysicsWorldSystem.ScheduleCallback(PhysicsCallbacks.Phase.PreStepSimulation, callback); }