Skip to content

Commit

Permalink
Inside view: adding code to debug the hitch when flying on Mac OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
unhyperbolic committed Jul 31, 2024
1 parent 3d23368 commit a0cf05c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/raytracing/hyperboloid_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,27 @@ def setup_keymapping(self, keyboard='QWERTY'):

def apply_settings(self, settings):
self.setup_keymapping(settings.get('keyboard', 'QWERTY'))

def _start_flight_for_debugging_hitch(self):
"""
On Mac OS, there is a hitch when flying. It is subtle, but when
keeping, say the w key pressed, every second or so there a brief
moment where we are not moving.
I couldn't figure out whether this is due to how we are processing
the key events or already a problem with calling self.after from
within the redraw code.
This function initiates a flight to isolate the problem to the
latter.
To use it, do:
>>> M = Manifold("m004") # doctest: +SKIP
>>> v = M.inside_view()
>>> v.view.widget._start_flight_for_debugging_hitch()
"""

self.key_to_last_accounted_and_release_time['w'][0] = time.time()
self.schedule_process_key_events_and_redraw(1)

0 comments on commit a0cf05c

Please sign in to comment.