protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_StepPhysicsWorldSystem  = World.GetOrCreateSystem <StepPhysicsWorld>();
            m_EndFramePhysicsSystem   = World.GetOrCreateSystem <EndFramePhysicsSystem>();

            m_SharedData = SharedData.Create();
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            DynamicEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsVelocity),
                    typeof(Translation),
                    typeof(Rotation)
                },
                None = new ComponentType[]
                {
                    typeof(PhysicsExclude)
                }
            });

            StaticEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsCollider)
                },
                Any = new ComponentType[]
                {
                    typeof(LocalToWorld),
                    typeof(Translation),
                    typeof(Rotation)
                },
                None = new ComponentType[]
                {
                    typeof(PhysicsExclude),
                    typeof(PhysicsVelocity)
                }
            });

            JointEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsConstrainedBodyPair),
                    typeof(PhysicsJoint)
                },
                None = new ComponentType[]
                {
                    typeof(PhysicsExclude)
                }
            });

            CollisionWorldProxyGroup = GetEntityQuery(ComponentType.ReadWrite <CollisionWorldProxy>());

            m_StepPhysicsWorldSystem = World.GetOrCreateSystem <StepPhysicsWorld>();
            m_EndFramePhysicsSystem  = World.GetOrCreateSystem <EndFramePhysicsSystem>();
        }
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_EndFramePhysicsSystem   = World.GetOrCreateSystem <EndFramePhysicsSystem>();

            m_SharedData = SharedData.Create();

#if !ENABLE_UNITY_COLLECTIONS_CHECKS
            // Calling RequireForUpdate will mean that the system will not be updated if there are no dynamic bodies.
            // However, if we are performing want collider integrity checks we need the system to run regardless.
            RequireForUpdate(m_BuildPhysicsWorldSystem.DynamicEntityGroup);
#endif
        }
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem  = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_ExportPhysicsWorldSystem = World.GetOrCreateSystem <ExportPhysicsWorld>();
            m_EndFramePhysicsSystem    = World.GetOrCreateSystem <EndFramePhysicsSystem>();

#if !NET_DOTS
            Assert.AreEqual(Enum.GetValues(typeof(SimulationType)).Length, k_NumSimulationTypes);
#endif

            RegisterSimulation(SimulationType.NoPhysics, () => new DummySimulation());
            RegisterSimulation(SimulationType.UnityPhysics, () => new Simulation());
            RegisterSimulation(SimulationType.HavokPhysics, () =>
                               throw new NotSupportedException("Havok Physics package not present. Use the package manager to add it."));

            base.OnCreate();
        }
Example #5
0
        protected override void OnCreate()
        {
            base.OnCreate();

            DynamicEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsVelocity),
                    typeof(Translation),
                    typeof(Rotation)
                }
            });

            StaticEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsCollider)
                },
                Any = new ComponentType[]
                {
                    typeof(LocalToWorld),
                    typeof(Translation),
                    typeof(Rotation)
                },
                None = new ComponentType[]
                {
                    typeof(PhysicsVelocity),
                    typeof(Parent)
                }
            });

            JointEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsJoint)
                }
            });

            m_EndFramePhysicsSystem = World.GetOrCreateSystem <EndFramePhysicsSystem>();
        }