mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.74k stars 439 forks source link

debugger/natvis additions for Vector, Quaternion, Deg & Rad types #623

Closed fauder closed 1 year ago

fauder commented 1 year ago

Many thanks to @pezcode for the initial work he did. I also stole that file and used it in my own opengl framework repo 🙏

I've made some modifications to the magnum.natvis file in order to augment debug visualization for:

Magnum's epsilon (from Magnum::Math::TypeTraits) values were utilized for unit vector queries, by creating two intrinsic .natvis functions Dot() & IsNormalized(), the latter utilizing said epsilons (added to and subtracted from 1.0, as we can not use abs() in the .natvis file).

Similarly, Magnum::Math::Constants<T>::pi() was used in Deg/Rad conversions.

Separate Float & Double variants were added for all types mentioned since they use different epsilons/conversion multipliers.

'h' (hexadecimal integer) format specifier was used for Radd & Degd, to display more digits in the debugger.

Let me know if you want me to revise anything.

fauder commented 1 year ago

I'll resolve the remaining two points of interest tonight.

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (f79a9df) 81.78% compared to head (94f6220) 81.78%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #623 +/- ## ======================================= Coverage 81.78% 81.78% ======================================= Files 554 554 Lines 42892 42892 ======================================= Hits 35081 35081 Misses 7811 7811 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mosra commented 1 year ago

Added the explanation from your comment above, squashed the commits together a bit and merged as 3b1fb704ca1ef2d5584f0da388a379632c199fee...2eee19276cd84ca6e8ea84207f82581d749b4d55. Thank you!