From d53dced46daebf532fbd7f222fda875e4262cf51 Mon Sep 17 00:00:00 2001 From: fauder Date: Thu, 13 Jul 2023 20:00:58 +0300 Subject: [PATCH] debuggers: display when a Vector2/3/4 is a unit vector Added Float & Double overrides, so the other variants (Half & integer variants) are effectively untouched. Added Dot() & IsNormalized() intrinsic functions for each entry. The reason we need separate entries for Float & Double is because the epsilon values used for Dot() are different. Epsilon values are taken directly from Magnum::Math::TypeTraits & they are added to & subtracted from 1.0, in order to avoid using abs(), which is prohibited in .natvis. --- src/debuggers/natvis/magnum.natvis | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/debuggers/natvis/magnum.natvis b/src/debuggers/natvis/magnum.natvis index 64318e412..ee8c4e0a1 100644 --- a/src/debuggers/natvis/magnum.natvis +++ b/src/debuggers/natvis/magnum.natvis @@ -38,16 +38,68 @@ {{ {_data[0],g}, {_data[1],g} }} {{ x={_data[0],g} y={_data[1],g} }} + + + + + + + {{ {_data[0],g}, {_data[1],g} }} + {{ x={_data[0],g} y={_data[1],g} }} + {{ x={_data[0],g} y={_data[1],g} (normalized) }} + + + + + + {{ {_data[0],g}, {_data[1],g} }} + {{ x={_data[0],g} y={_data[1],g} }} + {{ x={_data[0],g} y={_data[1],g} (normalized) }} + {{ {_data[0],g}, {_data[1],g}, {_data[2],g} }} {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} }} + + + + + {{ {_data[0],g}, {_data[1],g} {_data[2],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} (normalized) }} + + + + + + {{ {_data[0],g}, {_data[1],g} {_data[2],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} (normalized) }} + {{ {_data[0],g}, {_data[1],g}, {_data[2],g}, {_data[3],g} }} {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} }} + + + + + {{ {_data[0],g}, {_data[1],g} {_data[2],g} {_data[3],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} (normalized) }} + + + + + + {{ {_data[0],g}, {_data[1],g} {_data[2],g} {_data[3],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} (normalized) }} +