From 2cc2c3ae6e1255affa92911e93b3b549be48ee37 Mon Sep 17 00:00:00 2001
From: blat-blatnik <55242398+blat-blatnik@users.noreply.github.com>
Date: Fri, 17 Apr 2020 00:35:24 +0200
Subject: [PATCH] Added features to the .natvis file
I've been using this natvis file in some personal projects that use GLM and I've found it to be very helpful when debugging GLM code.
vectors are displayed in the debugger like this:
glm::vec4 v(1, 2, 3, 4); // [1 2 3 4]
when expanding the view, the debugger will show each individual component, as well as the length of the vector, and hex RGBA code (for float vectors only), like this:
glm::vec4 v(0.5); // [0.5 0.5 0.5 0.5]
[len] 1
[rgba] #7F7F7F7F
x 0.5
y 0.5
z 0.5
w 0.5
Matrices are displayed in row major order when expanded in the debugger like this:
glm::mat4 m = glm::translate(glm::mat4(1), glm::vec3(1, 2, 3));
// [1 0 0 0] [0 1 0 0] [0 0 1 0] [1 2 3 1]
row 1 [1 0 0 1]
row 2 [0 1 0 2]
row 3 [0 0 1 3]
row 4 [0 0 0 1]
columns
- col 1 [1 0 0 0]
- col 2 [0 1 0 0]
- col 3 [0 0 1 0]
- col 4 [1 2 3 1]
Quaternions are displayed as: w + xi + yj + zk
glm::quat q(1, 2, 3, 4); // 1 + 2i + 3j + 4k
Dual quaternions are displayed as:
glm::dualquat dq(q, q); // [r: 1 + 2i + 3j + 4k] [d: 1 + 2i + 3j + 4k]
---
util/glm.natvis | 620 +++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 555 insertions(+), 65 deletions(-)
diff --git a/util/glm.natvis b/util/glm.natvis
index 7687f8bb..4db2418e 100644
--- a/util/glm.natvis
+++ b/util/glm.natvis
@@ -1,65 +1,555 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {x}
-
- - x
-
-
-
-
- {x}, {y}
-
- - x
- - y
-
-
-
-
- {x}, {y}, {z}
-
- - x
- - y
- - z
-
-
-
-
- {x}, {y}, {z}, {w}
-
- - x
- - y
- - z
- - w
-
-
-
-
- {x}, {y}, {z}, {w}
-
- - x
- - y
- - z
- - w
-
-
-
-
- (({real.x}, {real.y}, {real.z}), {real.w}), (({dual.x}, {dual.y}, {dual.z}), {dual.w})
-
- - real
- - dual
-
-
-
-
-
+
+
+
+
+
+
+
+ [{x,g}]
+
+ - x,g
+
+
+
+
+ [{x,g} {y,g}]
+
+ - x,g
+ - y,g
+
+
+
+
+ [{x,g} {y,g} {z,g}]
+
+ - x,g
+ - y,g
+ - z,g
+
+
+
+
+ [{x,g} {y,g} {z,g} {w,g}]
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ [{(int)x}]
+
+ - x
+
+
+
+
+ [{(int)x} {(int)y}]
+
+ - x
+ - y
+
+
+
+
+ [{(int)x,g} {(int)y,g} {(int)z,g}]
+
+ - x
+ - y
+ - z
+
+
+
+
+ [{(int)x,g} {(int)y,g} {(int)z,g} {(int)w,g}]
+
+ - x
+ - y
+ - z
+ - w
+
+
+
+
+ [{x,g} {y,g}]
+
+
+
+
+
+
+
+ k = *(float *)&i
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0f,g
+
+
+ - x,g
+ - y,g
+
+
+
+
+ [{x,g} {y,g} {z,g}]
+
+
+
+
+
+
+
+ k = *(float *)&i
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0f,g
+
+
+
+
+
+ #{
+ (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) |
+ (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) |
+ (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) | 0xFF,Xb
+ }
+
+
+ - x,g
+ - y,g
+ - z,g
+
+
+
+
+ [{x,g} {y,g} {z,g} {w,g}]
+
+
+
+
+
+
+
+ k = *(float *)&i
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0f,g
+
+
+
+
+
+ #{
+ (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) |
+ (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) |
+ (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) |
+ (unsigned((w<0?0:(w>1?1:w))*255.5f) << 0),Xb
+ }
+
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ [{x,g} {y,g}]
+
+
+
+
+
+
+
+ k = *(double *)&i
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0,g
+
+
+ - x,g
+ - y,g
+
+
+
+
+ [{x,g} {y,g} {z,g}]
+
+
+
+
+
+
+
+ k = *(double *)&i
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0,g
+
+
+ - x,g
+ - y,g
+ - z,g
+
+
+
+
+ [{x,g} {y,g} {z,g} {w,g}]
+
+
+
+
+
+
+
+ k = *(double *)&i
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0,g
+
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ {w,g} + {x,g}i + {y,g}j + {z,g}k
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ {w,g} + {x,g}i + {y,g}j + {z,g}k
+
+
+
+
+
+
+
+ k = *(float *)&i
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ k = k * (1.5f - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0f,g
+
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ {w,g} + {x,g}i + {y,g}j + {z,g}k
+
+
+
+
+
+
+
+ k = *(double *)&i
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ k = k * (1.5 - (n * k * k))
+ - 1/k,g
+
+
+ - 0.0,g
+
+
+ - x,g
+ - y,g
+ - z,g
+ - w,g
+
+
+
+
+ [{value[0]} {value[1]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g}]
+
+
+
+ - value[0]
+ - value[1]
+
+
+
+
+
+
+ [{value[0]} {value[1]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g}]
+
+
+
+ - value[0]
+ - value[1]
+
+
+
+
+
+
+ [{value[0]} {value[1]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g}]
+
+
+ [{value[0].w,g} {value[1].w,g}]
+
+
+
+ - value[0]
+ - value[1]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g} {value[2].z,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g} {value[2].z,g}]
+
+
+ [{value[0].w,g} {value[1].w,g} {value[2].w,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]} {value[3]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+ - value[3]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]} {value[3]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+ - value[3]
+
+
+
+
+
+
+ [{value[0]} {value[1]} {value[2]} {value[3]}]
+
+
+
+ [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}]
+
+
+ [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}]
+
+
+ [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}]
+
+
+ [{value[0].w,g} {value[1].w,g} {value[2].w,g} {value[3].w,g}]
+
+
+
+ - value[0]
+ - value[1]
+ - value[2]
+ - value[3]
+
+
+
+
+
+
+ [r: {real}] [d: {dual}]
+
+ - real
+ - dual
+
+
+
+
\ No newline at end of file