public void AddCameraUserControls() { if (Configuration.physicsCamera) { physicsCamera = new PhysicsCamera(camera); AddPhysicsObject(physicsCamera); MovePhysicsObject(physicsCamera, physicsCamera.Frame.LocalToWorld.Matrix); physicsCamera.RigidBody.AffectedByGravity = userInterfaceManager.FlyMode ? false : true; cameraControls = new PhysicsFpsFrameController(); (cameraControls as PhysicsFpsFrameController).PhysicsObject = physicsCamera; } else { if (Configuration.lockUpVector) { cameraControls = new HeadingElevationFrameController(); } else { cameraControls = new FrameController(); } cameraControls.Frame = camera.Frame; } userInterfaceManager.ConnectUserControls(); }
public ViewBase(string uri, IAppModel appModel, IFrameController frameController, IFrameConfig frameConfig) { _Uri = uri; AppModel = appModel; FrameController = frameController; FrameConfig = frameConfig; }
private void InitAppWithConfig(IFrameConfig frameConfig) { if (_FrameController != null) { _FrameController.Stop(); } _FrameController = new FrameController(frameConfig, new UIDispatchDelegate((a) => UIDispatch.Invoke(a))); _ViewManager = new ViewManager(this, _FrameController, frameConfig); ShowDebugInfo = _FrameConfig.ShowDebugInfo; _FrameController.CurrentPhotoChanged += (s, e) => { CreateAndShowNewView(); }; CreateAndShowNewView(); _FrameController.TimerValueChanged += (s, e) => { TimerValue = _FrameController.TimerValue; }; _FrameController.Start(); }
public static void SetController(Frame holder, IFrameController controller) { if (controller == null) { return; } controller.Holder = holder; }
public ViewModelColorize(IFrameController frameController, IFrameConfig config) : base(frameController, config) { var colorizeInfo = frameController.GetNextColorizeInfo(); Hue = colorizeInfo.Hue; Saturation = colorizeInfo.Saturation; Lightness = colorizeInfo.Lightness; }
public ViewModelBase(IFrameController frameController, IFrameConfig config) { FrameController = frameController; FrameConfig = config; ImageUri = frameController.CurrentPhoto; FrameController.CurrentPhotoChanged += FrameController_CurrentPhotoChanged; _Counter++; Console.WriteLine($"Number of ViewModels: {_Counter}"); }
public void UpdateFixedStep() { if (RuntimeConfiguration.gameTest == false) { IFrameController cameraControls = sceneManager.CameraControls; if (userControls != null) { cameraControls.UpdateFixedStep(); } } }
private void HomeCamera(Area area) { Camera camera = sceneManager.Camera; camera.Frame.LocalToParent.Set( Matrix4.CreateLookAt( sceneManager.Home, Vector3.Zero, Vector3.UnitY ) ); IFrameController cameraControls = sceneManager.CameraControls; cameraControls.SetTransform(camera.Frame.LocalToParent.Matrix); cameraControls.Clear(); }
public void UpdateOncePerFrame() { if (RuntimeConfiguration.gameTest == false) { IFrameController cameraControls = sceneManager.CameraControls; //if(ignore != false) { current = OpenTK.Input.Mouse.GetState(); if (mouseReset == false && (current != previous)) { if (lockMouse && hasMouse && window.Focused) { int xdelta = current.X - previous.X; int ydelta = current.Y - previous.Y; float wheelDelta = current.WheelPrecise - previous.WheelPrecise; if ((xdelta > 0) || (ydelta > 0) || (xdelta < 0) || (ydelta < 0)) { userControls.RotateY.Adjust(-xdelta / 1024.0f); userControls.RotateX.Adjust(-ydelta / 1024.0f); CenterMouse(); //System.Console.WriteLine("Mouse delta: " + xdelta + ", " + ydelta); } } } previous = current; } cameraControls.UpdateOncePerFrame(); } //float wheelNow = window.Mouse.WheelPrecise; //float wheelDelta = wheel - wheelNow; //wheel = wheelNow; var m = materialManager[CurrentMaterial]; { if (m != null) { m.Sync(); } } }
public void ToggleController() { if (userControls == sceneManager.CameraControls) { if (RuntimeConfiguration.gameTest) { var game = Services.Get <Game>(); if (game != null) { var player = game.Player; if (player != null) { userControls = player.Controller; } } } } else { userControls = sceneManager.CameraControls; } }
public ViewNormal(IAppModel appModel, IFrameController frameController, IFrameConfig config) : base("ViewNormal.qml", appModel, frameController, config) { }
public TestView(string uri, IAppModel appModel, IFrameController frameController, IFrameConfig config) : base(uri, appModel, frameController, config) { ViewModelMock = Mock.Of <IViewModel>(); }
public ViewModelNormal(IFrameController frameController, IFrameConfig config) : base(frameController, config) { }
public SimulationControllerBase(bool load = false, string path = "./model.json", Func <TGroup> generator = null, SimulationStrategy strategy = SimulationStrategy.Plane) { if (load) { switch (strategy) { case SimulationStrategy.None: { Frames = new SimulationNoMemoryFrameController <State>(); break; } case SimulationStrategy.Plane: { Frames = new SimulationPlaneFrameController <State>(path); break; } case SimulationStrategy.Diffs: { Frames = new SimulationDiffFrameController <State>(path); break; } default: throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null); } state = Load(); } else { if (generator != null) { state.TopGroup = generator(); } else { throw new Exception("Bad generator"); } state.RefreshMarks(); state.TimeStep = state.TopGroup.SetGlobatTransitionTimeScales(); var fat = state.TopGroup.Descriptor.SubGroups.Values .Traverse(g => g.Value.Descriptor.SubGroups.Values) .SelectMany(g => g.Value.Descriptor.Transitions) .Select(pair => pair.Value).ToList(); fat.AddRange(state.TopGroup.Descriptor.Transitions.Values); Transitions = fat.OrderBy( x => { if (x.Attributes.Any(a => a is PrioretyAttribute)) { var pa = (PrioretyAttribute)x.Attributes.First(a => a is PrioretyAttribute); return(pa.Priorety); } return(0); } ) .ToList(); if (Transitions .Any(descriptor => !descriptor.Value.CheckActionFunctions())) { throw new Exception("Bad Action routing detected"); } switch (strategy) { case SimulationStrategy.None: { Frames = new SimulationNoMemoryFrameController <State>(); break; } case SimulationStrategy.Plane: { Frames = new SimulationPlaneFrameController <State>(path, false); break; } case SimulationStrategy.Diffs: { Frames = new SimulationDiffFrameController <State>(path, false); break; } default: throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null); } Frames.SaveState(state); } }
public ViewTestBase() { _AppModelMock = Mock.Of <IAppModel>(); _FrameControllerMock = Mock.Of <IFrameController>(); _FrameConfigMock = Mock.Of <IFrameConfig>(); }
public ViewModelBorder(IFrameController frameController, IFrameConfig config) : base(frameController, config) { BorderColor = ColorToString(FrameController.GetNextBorderColor()); BorderWidth = FrameConfig.BorderWidth; }
public ViewBorder(IAppModel appModel, IFrameController frameController, IFrameConfig config) : base("ViewBorder.qml", appModel, frameController, config) { }
public ViewModelBaseTestClass(IFrameController frameController, IFrameConfig frameConfig) : base(frameController, frameConfig) { }
public ViewModelTestBase() { _FrameControllerMock = Mock.Of <IFrameController>(); _FrameConfigMock = Mock.Of <IFrameConfig>(); }
public ViewManagerTest() { _AppModelMock = Mock.Of <IAppModel>(); _FrameControllerMock = Mock.Of <IFrameController>(); _FrameConfigMock = Mock.Of <IFrameConfig>(); }
public ViewColorize(IAppModel appModel, IFrameController frameController, IFrameConfig frameConfig) : base("ViewColorized.qml", appModel, frameController, frameConfig) { }
public ViewManager(IAppModel appModel, IFrameController frameController, IFrameConfig frameConfig) { _appModel = appModel; _frameController = frameController; _frameConfig = frameConfig; }