Can't rotate view with the Rotate Mode

Hello!
Today I updated the CGE and faced with the problem: in the TCastleWalkNavigation with mdRotate mode and MouseLook is disabled, the camera does not rotate when I holding the mouse button.
rotate_view_test_02

My test project: rotate_view_test.zip (15.5 KB)

Maybe I haven’t used some new parameter or something like that?

Confirmed, it’s a bug – I’m looking into it.

I already see it has been definitely caused by new CASTLE_COLLECT_MOTION mechanism, (commehts here). This indeed changes the processing of motion – although I don’t understand yet how it breaks mdRotate (it seems the relevant code always gets “almost zero” motion delta, but instead it should accumulate and be a big delta).

Anyhow, it’s definitely a regression and I’ll try to fix it ASAP today :slight_smile: Thanks for reporting!

Ah, got it. Fixing.

Short version: The fix is pushed to the branch mouse-position-fixes and now waits for automatic tests to pass. Once this is done, I’ll merge it to master branch and let here know.

More details:

  • Fixing this was more fun than anticipated :slight_smile: The fix necessitated a code cleanup that spanned a number of files related to mouse events communication between lower-level code (sometimes system/compiler specific) and CGE.
  • Done & tested manually everything now (FPC/Delphi, Windows/Linux/Android/macOS, castle-model-viewer/model_3d_viewer/tests/few examples). Of course I also tested it fixes your testcase, mdRotate works again as it should.
  • I want now to want for our automatic checks (GitHub Actions) to confirm it’s good everywhere. It should happen this Sunday.
1 Like

Would this affect my middle mouse button mouselook issue when the mouse goes over another window that also handles middle button events? I still need to make a test case for you. I could probably fix it in my code by keeping track of the ‘active’ mouselook control, but if it is a bug you want to fix then that wouldn’t be helpful. Busy on outside fronts as winter looms at 2560m ASL.

No, I’m afraid I doubt these two issues (this thread, and thread Mouselook and my tool windows ) are related. In the latter case, it seems MousePosition is OK, but the “release” event is not reported where it should. This is something else than the error in this thread, when MousePosition was sometimes wrong (causing mdRotate to not work).

The things I’ve done here will likely have no effect on what you reported in Mouselook and my tool windows .

All done now :slight_smile: Upgrade to latest CGE and the bug reported in this thread will be gone.

  • I’ve done some additional fixes yesterday (for iOS).
  • The fix has been merged to CGE “master” branch on GitHub.
  • The downloads contain the fix.
1 Like

Thank you very much. Rotation now works fine for my project.
You’re the best!

1 Like