public SceneUpdater(ISceneViewModel viewModel, Int32 maxFramesPerSecond = 60) : base(maxFramesPerSecond) { _viewModel = viewModel; Task.Factory.StartNew(GameLoop, TaskCreationOptions.LongRunning); }
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()); }
public static ISceneViewModel CreateScene(ISceneMediatorViewModel sceneMediator = null) { if (_scene == null) { _scene = new SceneViewModel(sceneMediator); } return(_scene); }
private MediatorViewModel() { var currentMetamodel = _repo.Model("RobotsMetamodel"); _currentModel = _repo.CreateModel("New model based on RobotsMetamodel", currentMetamodel); _scene = SceneViewModel.CreateScene(this); _palette = PaletteViewModel.CreatePalette(this); }
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++; } }
private void ExecuteMoveSceneUp(ISceneViewModel sceneViewModel) { var index = SceneViewModels.IndexOf(sceneViewModel); if (index > 0) { SceneViewModels.Move(index, index - 1); SceneViewModels[index].Index++; sceneViewModel.Index--; } }
private void ExecuteDeleteScene(ISceneViewModel sceneViewModel) { SceneViewModels.Remove(sceneViewModel); Story.Scenes.Remove(sceneViewModel.Scene); }
public SceneView(ISceneViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; Loaded += Window_Loaded; }