Use the correct math to unproject the mouse movement from screen space
to the Z=0 plane on the camera space. This handles both perspective
and orthographic projection at any window size or zoom level.
OpenMP does not yet permit unsigned loop counters. Most compilers seem
to allow them anyway, but a few have been seen to complain.
Mistake introduced in:
commit 82ed0fde32
Author: Chris Pavlina <pavlina.chris@gmail.com>
Date: Sun Aug 28 02:05:49 2016 -0400
Fix shared data access in raytracer, tidy up render loop
Render loop lost track of which blocks had been rendered due to a
synchronization issue. Specifically, std::vector<bool> is special-cased
as a bitfield and so is pretty much guaranteed not to be atomic unless
synchronized externally.
Also:
- Clean up types of a few variables
- Clean up openmp sharing type of variables (may result in better
optimization)
- Replace shared rendered block count with an openmp reduction (results
in fewer locks)
Fixes: lp:1608289
* https://bugs.launchpad.net/kicad/+bug/1608289
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
* Use platform cache path insted of the KiCad configuration path to write the
3D model cache.
* OSX: ${HOME}/Library/Caches/kicad/3d
* Linux: ${XDG_CACHE_HOME}/kicad/3d or ${HOME}/.cache/kicad/3d
* Windows: AppData\Local\kicad\3d
* Add a Help button and text to the 3D alias configuration dialog
* Display KISYS3DMOD and internally defined KiCad path env vars
* Add a button to bring up the "Configure Paths" (env vars) dialog
* Remove the file name mapping feature from the resolver; this results in
the resolver always using the current definition rather than a possibly
outdated cache value.
Array is in pairs but has a single sentinel, trips up Coverity (CID 147346) and
does allow an out-of-bounds write if WX_GL_SAMPLES were ever removed from the
array.