コード例 #1
0
ファイル: SceneInstance.cs プロジェクト: cg123/xenko
        private EntityProcessor CreateRenderProcessor(RegisteredRenderProcessors registeredRenderProcessor, VisibilityGroup visibilityGroup)
        {
            // Create
            var processor = (EntityProcessor)Activator.CreateInstance(registeredRenderProcessor.Type);

            // Set visibility group
            ((IEntityComponentRenderProcessor)processor).VisibilityGroup = visibilityGroup;

            // Add processor
            Processors.Add(processor);
            registeredRenderProcessor.Instances.Add(new KeyValuePair<VisibilityGroup, EntityProcessor>(visibilityGroup, processor));

            return processor;
        }
コード例 #2
0
 internal RenderObjectCollection(VisibilityGroup visibilityGroup)
 {
     this.visibilityGroup = visibilityGroup;
 }
コード例 #3
0
ファイル: SceneInstance.cs プロジェクト: cg123/xenko
        public VisibilityGroup GetOrCreateVisibilityGroup(RenderSystem renderSystem)
        {
            // Find if it exists
            VisibilityGroup visibilityGroup = null;
            foreach (var currentVisibilityGroup in VisibilityGroups)
            {
                if (currentVisibilityGroup.RenderSystem == renderSystem)
                {
                    visibilityGroup = currentVisibilityGroup;
                    break;
                }
            }

            // If first time, let's create and register it
            if (visibilityGroup == null)
                VisibilityGroups.Add(visibilityGroup = new VisibilityGroup(renderSystem));

            return visibilityGroup;
        }