Example #1
0
        public SceneUpdater(ISceneViewModel viewModel, Int32 maxFramesPerSecond = 60)
            : base(maxFramesPerSecond)
        {
            _viewModel = viewModel;

            Task.Factory.StartNew(GameLoop, TaskCreationOptions.LongRunning);
        }
Example #2
0
 public SceneView()
 {
     InitializeComponent();
     _scene = SceneViewModel.CreateScene();
     _scene.InitializeScene(zoomctrl);
     DataContext = _scene;
 }
        // Prepares the bitmap and the scene.
        public SceneViewModel(ISceneViewModel view)
        {
            _view         = view;
            _view.Loaded += OnLoaded;

            _bmp = new BufferedBitmap(750, 450);

            _device = new Device(_bmp, new Bresenham(), new LiangBarskyClipping());

            _scene = new Scene
            {
                Camera = new Camera
                {
                    Position      = Vector3.Zero,
                    LookDirection = Vector3.UnitZ,
                    FieldOfView   = 60
                }
            };

            _scene = SceneImporter.LoadJsonFile(Path.Combine("Resources", "scene.unity.babylon"));
            _scene.Meshes.First(m => m.Name == "Plane").Color = Engine.Utilities.Colors.DarkGrey;

            //_scene.Meshes.Add(new Cube());
            //_scene.Meshes.Add(new Sphere());
            //_scene.Meshes.Add(new Cone());
            //_scene.Meshes.Add(new Tube());
        }
Example #4
0
 public static ISceneViewModel CreateScene(ISceneMediatorViewModel sceneMediator = null)
 {
     if (_scene == null)
     {
         _scene = new SceneViewModel(sceneMediator);
     }
     return(_scene);
 }
Example #5
0
        private MediatorViewModel()
        {
            var currentMetamodel = _repo.Model("RobotsMetamodel");

            _currentModel = _repo.CreateModel("New model based on RobotsMetamodel", currentMetamodel);
            _scene        = SceneViewModel.CreateScene(this);
            _palette      = PaletteViewModel.CreatePalette(this);
        }
Example #6
0
        private void ExecuteMoveSceneDown(ISceneViewModel sceneViewModel)
        {
            var index = SceneViewModels.IndexOf(sceneViewModel);

            if (index < SceneViewModels.Count - 1)
            {
                SceneViewModels.Move(index, index + 1);
                SceneViewModels[index].Index--;
                sceneViewModel.Index++;
            }
        }
Example #7
0
        private void ExecuteMoveSceneUp(ISceneViewModel sceneViewModel)
        {
            var index = SceneViewModels.IndexOf(sceneViewModel);

            if (index > 0)
            {
                SceneViewModels.Move(index, index - 1);
                SceneViewModels[index].Index++;
                sceneViewModel.Index--;
            }
        }
Example #8
0
 private void ExecuteDeleteScene(ISceneViewModel sceneViewModel)
 {
     SceneViewModels.Remove(sceneViewModel);
     Story.Scenes.Remove(sceneViewModel.Scene);
 }
Example #9
0
 public SceneView(ISceneViewModel viewModel)
 {
     InitializeComponent();
     ViewModel = viewModel;
     Loaded += Window_Loaded;
 }