aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/jau/math/vec2f.hpp6
-rw-r--r--include/jau/math/vec2i.hpp6
-rw-r--r--include/jau/math/vec3f.hpp6
-rw-r--r--include/jau/math/vec4f.hpp6
4 files changed, 24 insertions, 0 deletions
diff --git a/include/jau/math/vec2f.hpp b/include/jau/math/vec2f.hpp
index 9a830f7..915208d 100644
--- a/include/jau/math/vec2f.hpp
+++ b/include/jau/math/vec2f.hpp
@@ -59,6 +59,12 @@ namespace jau::math {
constexpr static const value_type zero = value_type(0);
constexpr static const value_type one = value_type(1);
+ /** Number of components */
+ constexpr static const size_t components = 2;
+
+ /** Size in bytes (aligned) */
+ constexpr static const size_t byte_size = components * sizeof(value_type);
+
value_type x;
value_type y;
diff --git a/include/jau/math/vec2i.hpp b/include/jau/math/vec2i.hpp
index ec6e237..2fa861f 100644
--- a/include/jau/math/vec2i.hpp
+++ b/include/jau/math/vec2i.hpp
@@ -60,6 +60,12 @@ namespace jau::math {
constexpr static const value_type zero = value_type(0);
constexpr static const value_type one = value_type(1);
+ /** Number of components */
+ constexpr static const size_t components = 2;
+
+ /** Size in bytes (aligned) */
+ constexpr static const size_t byte_size = components * sizeof(value_type);
+
value_type x;
value_type y;
diff --git a/include/jau/math/vec3f.hpp b/include/jau/math/vec3f.hpp
index c68b45c..5e3b7b9 100644
--- a/include/jau/math/vec3f.hpp
+++ b/include/jau/math/vec3f.hpp
@@ -63,6 +63,12 @@ namespace jau::math {
constexpr static const value_type zero = value_type(0);
constexpr static const value_type one = value_type(1);
+ /** Number of components */
+ constexpr static const size_t components = 3;
+
+ /** Size in bytes (aligned) */
+ constexpr static const size_t byte_size = components * sizeof(value_type);
+
value_type x;
value_type y;
value_type z;
diff --git a/include/jau/math/vec4f.hpp b/include/jau/math/vec4f.hpp
index b27c767..f0e89c5 100644
--- a/include/jau/math/vec4f.hpp
+++ b/include/jau/math/vec4f.hpp
@@ -63,6 +63,12 @@ namespace jau::math {
constexpr static const value_type zero = value_type(0);
constexpr static const value_type one = value_type(1);
+ /** Number of components */
+ constexpr static const size_t components = 4;
+
+ /** Size in bytes (aligned) */
+ constexpr static const size_t byte_size = components * sizeof(value_type);
+
value_type x;
value_type y;
value_type z;