summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/math.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-09-03 15:55:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2015-10-25 11:03:56 -0400
commitb554b20c8d59d6046bdcec7c79fb61cd0e65811c (patch)
treea6c6f257cfaffcec953be7c0cce180f7a8855c68 /libdimension/dimension/math.h
parentb2cf35c26d5263f3079480208429e3a1d7dd2373 (diff)
downloaddimension-b554b20c8d59d6046bdcec7c79fb61cd0e65811c.tar.xz
math: Make vectors have an array instead of different fields.
Diffstat (limited to 'libdimension/dimension/math.h')
-rw-r--r--libdimension/dimension/math.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/dimension/math.h b/libdimension/dimension/math.h
index 603373f..e110ffb 100644
--- a/libdimension/dimension/math.h
+++ b/libdimension/dimension/math.h
@@ -43,3 +43,14 @@ extern "C" {
#endif
#endif /* DMNSN_MATH_H */
+
+#if defined(DMNSN_SHORT_NAMES) && !defined(DMNSN_SHORT_NAMES_DEFINED)
+ #define DMNSN_SHORT_NAMES_DEFINED
+
+ /** Short name for the \a x component of a \c dmnsn_vector. */
+ #define X n[0]
+ /** Short name for the \a y component of a \c dmnsn_vector. */
+ #define Y n[1]
+ /** Short name for the \a z component of a \c dmnsn_vector. */
+ #define Z n[2]
+#endif