Example #1
0
        internal static void Update()
        {
            JWorld.Step(Time.DeltaTime, true);

            var phys = CoreECS.GetPhysicsRelated();

            foreach (var p in phys)
            {
                p.Update();
            }
        }
Example #2
0
        internal static void Init()
        {
            CollisionSystem = new CollisionSystemSAP();
            JWorld          = new JWorld(CollisionSystem);
            CoreECS.SubscribeComponentAdded <RigidBody>(AddRigidBody);
            CoreECS.SubscribeComponentEnabled <RigidBody>(AddRigidBody);
            CoreECS.SubscribeComponentRemoved <RigidBody>(RemoveRigidBody);
            CoreECS.SubscribeComponentDisabled <RigidBody>(RemoveRigidBody);
            CoreECS.SubscribeComponentAdded <EmptyRigidBody>(AddEmptyRigidBody);
            CoreECS.SubscribeComponentEnabled <EmptyRigidBody>(AddEmptyRigidBody);
            CoreECS.SubscribeComponentRemoved <EmptyRigidBody>(RemoveEmptyRigidBody);
            CoreECS.SubscribeComponentDisabled <EmptyRigidBody>(RemoveEmptyRigidBody);

            CollisionSystem.CollisionDetected += CollisionDetected;
        }
Example #3
0
 public virtual void Init() {
     CoreECS.Init();
     Physics.Physics.Init();
     Renderer.Init();
 }