pushing this home.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user