internal static void Update() { JWorld.Step(Time.DeltaTime, true); var phys = CoreECS.GetPhysicsRelated(); foreach (var p in phys) { p.Update(); } }
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; }
public virtual void Init() { CoreECS.Init(); Physics.Physics.Init(); Renderer.Init(); }