aboutsummaryrefslogtreecommitdiffstats
path: root/include/vec3.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2025-12-24 15:35:21 +0100
committerladevieq <ladevie.quentin@gmail.com>2025-12-24 15:35:21 +0100
commitb4d24e8f2cb4838acc0b827f007e7faa609039ba (patch)
treeba6504b67923789d84b2473eb4e14f7002e34ab7 /include/vec3.hpp
parentc29105b461135f3909cca0308fb05715cee45763 (diff)
Use build.bat for building
Everything is included in main.cpp Do not rely on vcpkg anymore
Diffstat (limited to 'include/vec3.hpp')
-rw-r--r--include/vec3.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/vec3.hpp b/include/vec3.hpp
index 968f3ed..42172e6 100644
--- a/include/vec3.hpp
+++ b/include/vec3.hpp
@@ -41,7 +41,13 @@ class vec3 {
[[nodiscard]]vec3 (min)(const vec3& vec) const;
[[nodiscard]]vec3 (max)(const vec3& vec) const;
- float operator[](int axis);
+ template<int axis>
+ [[nodiscard]] float get() const;
+
+ template<int axis>
+ void set(float val);
+
+ [[nodiscard]] float operator[](int axis) const;
[[nodiscard]] float length() const;
@@ -61,7 +67,10 @@ class vec3 {
static vec3 random(float min, float max);
- __m128 v;
+ union {
+ __m128 v;
+ float arr[4];
+ };
};
vec3 lerp(const vec3& u, const vec3& v, float t);