Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CameraQuickZoomStarted & CameraQuickZoomEnded not fired
#1
Bug 
I think CameraQuickZoomStarted & CameraQuickZoomEnded events are not fired for MouseCameraController

I know I can subscribe to MouseCameraController.Camera.PropertyChanged, but there I can't know when zoom is done
#2
Update: I had a mistake in my initialization of the mouse camera controller

Now those events are fired properly, but when using mouse wheel, zooming seems to go other route

Is there a way I can handle when mouse wheel zoom start and end other than Avalonia/Wpf mouse events?
#3
Mouse rotation, moving and quick zoom events are all started when a specific user action is performed and then until this action is ended, the camera is rotated, moved or zoomed by using quick zoom.

However, when you rotate the mouse wheel, this is a one-time event - there is no start and end to the mouse wheeling.

From our private conversations, I know that you want to disable some rendering and update tasks to make camera rotation and movement faster - when the rotation or movement is finished, then you enable the normal rendering again. 

If you want to do a similar thing with the mouse wheel, you would need to add a timer or something that would start after the first mouse wheel event - so some time after the zooming ends, you would enable normal rendering.

To do this, you will need to subscribe to Avalonia, WPF (or other UI) mouse wheel event. For example, for Avalonia, you can use:
Code:
MainSceneView.PointerWheelChanged += (sender, args) =>
{
    var mousePoint = args.GetCurrentPoint(MainSceneView);
    var mousePosition = new Vector2((float)mousePoint.Position.X, (float)mousePoint.Position.Y);
    args.Handled = _pointerCameraController.ProcessPointerWheelChanged(mousePosition, (float)args.Delta.Y);

    // Add your code to handle zoom here:
};
Andrej Benedik
#4
I got it working 

However, I don't see much difference in performance as I do with other natively supported SharpEngine events

Anyway I can say that, thanks to your help, I've greatly improved the performance of camera operations in very large models

Thanks, Andrej
  


Forum Jump:


Users browsing this thread:
1 Guest(s)