diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/point.h | 6 | ||||
-rw-r--r-- | src/math/vector.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/math/point.h b/src/math/point.h index 80f80f4..740b275 100644 --- a/src/math/point.h +++ b/src/math/point.h @@ -74,6 +74,12 @@ struct Point return (float*)this; } + //! Returns the struct cast to <tt>const float*</tt> array; use with care! + inline const float* Array() const + { + return (const float*)this; + } + //! Returns the distance from (0,0) to the point (x,y) inline float Length() { diff --git a/src/math/vector.h b/src/math/vector.h index 65fc2f9..148d648 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -79,6 +79,12 @@ struct Vector return (float*)this; } + //! Returns the struct cast to <tt>const float*</tt> array; use with care! + inline const float* Array() const + { + return (const float*)this; + } + //! Returns the vector length inline float Length() const { |