Browse Source

debuggers/magnum.natvis: display the angle in Deg/Rad nicely (along w/ equivalent Rad/Deg in parentheses)

There are two variants per angle type, so a total of four entries.
There are separate entries for Float & Double variants because in order to calculate the equivalent value for the given angle type in the other type,
I used the same exact values for the multipliers as the ones in Magnum::Math (utilizing Math::Constants<T>::pi()).

Also I used the format specifier 'h' (hexadecimal integer) for Double variants, as it shows a lot more digits, which may be more desirable when working with double data types for angles.
pull/623/head
fauder 3 years ago
parent
commit
8cf411c3ea
  1. 21
      src/debuggers/natvis/magnum.natvis

21
src/debuggers/natvis/magnum.natvis

@ -7,6 +7,7 @@
2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz>
Copyright © 2021 Jonathan Hale <squareys@googlemail.com>
Copyright © 2023 Pablo Escobar <mail@rvrs.in>
Copyright © 2023 Burak Canik <canik.burak@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -160,4 +161,24 @@
</ArrayItems>
</Expand>
</Type>
<!-- Magnum::Math::Deg< Float > -->
<Type Name="Magnum::Math::Deg&lt;float&gt;">
<DisplayString IncludeView="simple">{_value,g}° ({_value * 0.0174532924,g} radians)</DisplayString>
<DisplayString ExcludeView="simple">{_value,g}° ({_value * 0.0174532924,g} radians)</DisplayString>
</Type>
<!-- Magnum::Math::Deg< Double > -->
<Type Name="Magnum::Math::Deg&lt;double&gt;">
<DisplayString IncludeView="simple">{_value,h}° ({_value * 0.017453292519943295,h} radians)</DisplayString>
<DisplayString ExcludeView="simple">{_value,h}° ({_value * 0.017453292519943295,h} radians)</DisplayString>
</Type>
<!-- Magnum::Math::Rad< Float > -->
<Type Name="Magnum::Math::Rad&lt;float&gt;">
<DisplayString IncludeView="simple">{_value,g} radians ({_value * 57.2957764,g}°)</DisplayString>
<DisplayString ExcludeView="simple">{_value,g} radians ({_value * 57.2957764,g}°)</DisplayString>
</Type>
<!-- Magnum::Math::Rad< Double > -->
<Type Name="Magnum::Math::Rad&lt;double&gt;">
<DisplayString IncludeView="simple">{_value,h} radians ({_value * 57.295779513082323,h}°)</DisplayString>
<DisplayString ExcludeView="simple">{_value,h} radians ({_value * 57.295779513082323,h}°)</DisplayString>
</Type>
</AutoVisualizer>

Loading…
Cancel
Save