-
- Downloads
Merge branch 'improve-render-clock' into 'master'
Improve render clock `VTKInteractorStyle::CreateRepeatingTimer` would call `VTKInteractorStyle::OnTimer` then sleep for the period given in ms after calling `OnTimer` again. This isn't adapted for rendering at a uniform frame rate, because the time spent within the `OnTimer` function is not taken into account in the sleep time. By using `OneShotTimer`, we can manipulate when to render the next frame: in (period - time spent) ms if the time spent in `OnTimer` is smaller than the period time, or right away (period of 0 ms) if the time spent is over the target period (late frame). An interface is added in the `VTKInteractorStyle`, wrapped in the `VTKViewer`, to set the target frame rate. Also added a commit to use `DATA_DIR` defined in the Sandbox example to easily change the data directory for each user on their own machine. Any local change to the `DATA_DIR` value should not be committed in the future. See merge request !114
Showing
- Base/SimulationManager/imstkVTKInteractorStyle.cpp 54 additions, 7 deletionsBase/SimulationManager/imstkVTKInteractorStyle.cpp
- Base/SimulationManager/imstkVTKInteractorStyle.h 32 additions, 13 deletionsBase/SimulationManager/imstkVTKInteractorStyle.h
- Base/SimulationManager/imstkVTKViewer.cpp 17 additions, 2 deletionsBase/SimulationManager/imstkVTKViewer.cpp
- Base/SimulationManager/imstkVTKViewer.h 21 additions, 10 deletionsBase/SimulationManager/imstkVTKViewer.h
- Examples/Sandbox/main.cpp 33 additions, 32 deletionsExamples/Sandbox/main.cpp
Loading
Please register or sign in to comment