pushing this home.

This commit is contained in:
Yggdrasil75
2025-12-29 14:57:29 -05:00
parent 1a4ad39642
commit bc55db2c74
4 changed files with 180 additions and 40 deletions

View File

@@ -5,6 +5,7 @@
#include <algorithm>
#include <string>
#include <ostream>
#include <cstdint>
template<typename T>
class Vec3 {
@@ -14,7 +15,7 @@ public:
Vec3() : x(0), y(0), z(0) {}
Vec3(T x, T y, T z) : x(x), y(y), z(z) {}
Vec3(T scalar) : x(scalar), y(scalar), z(scalar) {}
Vec3(float[3] acd) : x(acd[0]), y(acd[1]), z(acd[2]) {}
Vec3(float acd[3]) : x(acd[0]), y(acd[1]), z(acd[2]) {}
Vec3(const class Vec2& vec2, T z = 0);
@@ -127,7 +128,7 @@ public:
return x * other.x + y * other.y + z * other.z;
}
Vec3& cross(const Vec3& other) const {
Vec3 cross(const Vec3& other) const {
return Vec3(
y * other.z - z * other.y,
z * other.x - x * other.z,