From b554b20c8d59d6046bdcec7c79fb61cd0e65811c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 3 Sep 2014 15:55:19 -0400 Subject: math: Make vectors have an array instead of different fields. --- libdimension/dimension/math.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libdimension/dimension/math.h') 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 -- cgit v1.2.3