示例#1
0
        public void Init(EcsSystems systems)
        {
            var world = systems.GetWorld(worldName);

            _filter = world.Filter <T> ().End();
            _pool   = world.GetPool <T> ();
        }
示例#2
0
        public void Init(EcsSystems systems)
        {
            var world = systems.GetWorld();

            shapes        = world.Filter <Shape>().Inc <BoundingBox>().End();
            shapesPool    = world.GetPool <Shape>();
            boundingBoxes = world.GetPool <BoundingBox>();
        }
示例#3
0
        public void Init(EcsSystems systems)
        {
            var worldEvents = systems.GetWorld(PhysicsWorldNames.Events);
            var physicsData = systems.GetShared <PhysicsData>();

            contacts     = worldEvents.Filter <Contact <TagA, TagB> >().End();
            contactsPool = worldEvents.GetPool <Contact <TagA, TagB> >();
            RegisterSolver(worldEvents, physicsData.ContactSolversMatrix);
        }
示例#4
0
        public void Init(EcsSystems systems)
        {
            var worldEvents = systems.GetWorld(PhysicsWorldNames.Events);
            var physicsData = systems.GetShared <PhysicsData>();

            possibleContacts     = worldEvents.Filter <PossibleContact <ShapeA, ShapeB> >().End();
            possibleContactsPool = worldEvents.GetPool <PossibleContact <ShapeA, ShapeB> >();
            contactSolversMatrix = physicsData.ContactSolversMatrix;
            RegisterTester(worldEvents, physicsData.ContactTestersMatrix);
        }
示例#5
0
 public void Run(EcsSystems systems)
 {
     if (_filter == null)
     {
         var world = GetWorld(systems);
         _pool1  = world.GetPool <T1> ();
         _filter = GetFilter(world);
         _thread = new TThread();
         _worker = _thread.Execute;
     }
     _thread.Init(
         _filter.GetRawEntities(),
         _pool1.GetRawDenseItems(), _pool1.GetRawSparseItems());
     SetData(systems, _thread);
     ThreadService.Run(_worker, _filter.GetEntitiesCount(), GetChunkSize(systems));
 }
 public PhysicsObjectsFactory(EcsWorld world, EcsWorld worldConstraints)
 {
     this.world            = world;
     this.worldConstraints = worldConstraints;
     rigidBodies           = world.GetPool <RigidBody>();
     staticBodies          = world.GetPool <StaticBody>();
     velocities            = world.GetPool <Velocity>();
     poses            = world.GetPool <Pose>();
     bodyMasks        = world.GetPool <BodyMask>();
     circleShapes     = world.GetPool <Circle>();
     segmentShapes    = world.GetPool <Segment>();
     meshShapes       = world.GetPool <Mesh>();
     aaboxShapes      = world.GetPool <AABox>();
     bboxes           = world.GetPool <BoundingBox>();
     springsBodyBody  = worldConstraints.GetPool <SpringBodyBody>();
     springsBodySpace = worldConstraints.GetPool <SpringBodySpace>();
 }