Exemple #1
0
        protected override void SceneInitialization(IContextState context, RenderEngine engine, ElementTag camera)
        {
            var smanager = Context.GetSystemManager();

            smanager.CreateSystem <DefaultInputSystem>();
            smanager.CreateSystem <ZoomToAllObjectsSystem>();
            smanager.CreateSystem <MovingSystem>();
            smanager.CreateSystem <CollidingSystem>();
            smanager.CreateSystem <DefaultOrthographicCameraSystem>();
            smanager.CreateSystem <LightsSystem>();
            //  smanager.CreateSystem<MovementSystem>();
            //  smanager.CreateSystem<EmptyAnimationSystem>();
            //  smanager.CreateSystem<MeshAnimationSystem>();
            //  smanager.CreateSystem<StickOnHeightMapSystem>();
            //     smanager.CreateSystem<ObjectMovementSystem>();
            //    smanager.CreateSystem<Systems.TerrainGeneratorSystem>();
            //   smanager.CreateSystem<Physics.Engine.PhysicalSystem>();

            smanager
            .CreateSystem <RenderSystem>()
            .Init(engine.Graphics)
            // .CreateNested<SkyGradientColoringRenderTechnique>()
            //  .CreateNested<SkyPlaneWithParallaxRenderTechnique>()
            //   .CreateNested<TerrainRenderTechnique>()//
            //.CreateNested<Toolkit.D3D.CameraViews.CameraViewsRenderTechnique<CustomRenderProperties>>()
            //.CreateNested<OITTriangleColoredVertexRenderTechnique<ToolkitRenderProperties>>()
            .CreateNested <TriangleColoredVertexRenderTechnique <ToolkitRenderProperties> >()
            .CreateNested <TriangleTexturedVertexRenderTechnique <ToolkitRenderProperties> >()
            .CreateNested <LineVertexRenderTechnique <ToolkitRenderProperties> >()
            //.CreateNested<CudaTestTechniques<ToolkitRenderProperties>>()
            .CreateNested <SpherePointRenderTechnique <ToolkitRenderProperties> >()
            //.CreateNested<AminRenderTechniqueSystem>()
            ;

            //smanager
            //    .CreateSystem<AminRenderSystem>()
            //    .Init(device);Context
            var manager = Context.GetEntityManager();

            cameraObject = CameraObject.UpdateOrthographic <RenderSystem>(camera, Context, Surface);

            LightObject.CreateAmbientLight(manager, 0.2f);                                           //0.05f
            LightObject.CreateFollowCameraDirectLight(manager, System.Numerics.Vector3.UnitZ, 0.8f); //0.95f

            CoordinateSystem = CoordinateSystemLinesGameObject.Create(context, false);

            Loaded?.Invoke();


            //VisualSphereObject.SphereGeo(Context, ElementTag.New($"Point"), new VisualSphereObject.Data {
            //    Center = new Vector3(10, 20, 10),
            //    Color = V4Colors.Yellow,
            //    Radius = 10
            //});
        }