Esempio n. 1
0
 public OctreeManager(IContextState context, AxisAlignedBox box, int MaximumChildren,
                      RenderLoopSynchronizationContext syncContext) : base(box, MaximumChildren)
 {
     this.context         = context;
     IsDrawingBoxesEnable = false;
     loker      = new object();
     sync       = new SynchronizationContextAdapter <OctreeManager, SyncData>(this, syncContext);
     drawerTask = Task.CompletedTask;
 }
Esempio n. 2
0
        public static GenneralContextState Full(ContextStateProcessor processor, AxisAlignedBox octreeBounds,
                                                EngineNotificator notificator, ILabLogger logger)
        {
            var syncContext = new RenderLoopSynchronizationContext();
            var octree      = new OctreeManager(processor, octreeBounds, 5, syncContext);

            notificator.Subscribe(octree);
            var geoPool = new GeometryPool(notificator, syncContext);

            notificator.Subscribe(geoPool);

            return(new GenneralContextState(processor, octree, geoPool, notificator, syncContext, logger));
        }
Esempio n. 3
0
        public ManagerContainer(IManagerChangeNotify notify,
                                IOctreeManager octree, IContextState context, IGeometryMemoryPool geoPool,
                                RenderLoopSynchronizationContext syncContext, ILabLogger logger)
        {
            SynchronizationContext = syncContext;
            EntityOrder            = new EntityOrderContainer();
            this.SystemManager     = new SystemManager(notify, context);
            var encom = new EntityComponentManager(notify, EntityOrder, syncContext);

            GeoMemoryPool         = geoPool;
            this.ComponentManager = encom;
            this.EntityManager    = encom;
            OctreeManager         = octree;
            Logger = logger;
        }
Esempio n. 4
0
 public GeometryPool(IManagerChangeNotify notify, RenderLoopSynchronizationContext syncContext)
 {
     sync        = SynchronizationContextBuilder.Create <GeometryPool, GeometryPoolComponent>(this, syncContext);
     pool        = new ConcurrentDictionary <Guid, IGeometryData>();
     this.notify = notify;
 }
Esempio n. 5
0
 public static ISynchronizationQueue <TOwner, TInput> Create <TOwner, TInput>(TOwner owner, RenderLoopSynchronizationContext context)
 {
     return(new SynchronizationContextAdapter <TOwner, TInput>(owner, context));
 }
Esempio n. 6
0
 GenneralContextState(ContextStateProcessor processor, IOctreeManager octree,
                      IGeometryMemoryPool geoPool, EngineNotificator notificator,
                      RenderLoopSynchronizationContext context, ILabLogger logger)
     : base(processor, new ManagerContainer(notificator, octree, processor, geoPool, context, logger))
 {
 }