32 Vec4(
float x,
float y,
float z,
float w)
40 Vec4 operator*(
float scalar) {
return Vec4(x * scalar, y * scalar, z * scalar, w * scalar); }
41 Vec4 operator+(
Vec4 other) {
return Vec4(x + other.x, y + other.y, z + other.z, w + other.w); }
68 Vec3(
float x,
float y,
float z)
82 Vec3 operator*(
float scalar) {
return Vec3(x * scalar, y * scalar, z * scalar); }
83 Vec3 operator+(
Vec3 other) {
return Vec3(x + other.x, y + other.y, z + other.z); }
84 Vec3 operator-(
Vec3 other) {
return Vec3(x - other.x, y - other.y, z - other.z); }
85 void operator+=(
Vec3 other)
91 void operator-=(
Vec3 other)
98 glm::vec3 ToGLM() {
return glm::vec3(x, y, z); }
117 Vec2(
float x,
float y)
123 Vec2 operator*(
float scalar) {
return Vec2(x * scalar, y * scalar); }
125 Vec2 operator*(
double scalar) {
return Vec2(x * scalar, y * scalar); }
127 Vec2 operator+(
Vec2 other) {
return Vec2(x + other.x, y + other.y); }
129 Vec2 operator-(
Vec2 other) {
return Vec2(x - other.x, y - other.y); }
131 Vec2 Perpendicular() {
return Vec2(-y, x); }
135 float length = sqrt(x * x + y * y);
136 return Vec2(x / length, y / length);