35 lines
554 B
C++
35 lines
554 B
C++
#pragma once
|
|
|
|
#include "mtl/target.hpp"
|
|
|
|
#include "mtl/fixed.hpp"
|
|
|
|
TARGET_ARM_MODE
|
|
|
|
namespace mtl {
|
|
|
|
class vec4 {
|
|
public:
|
|
fixed x, y, z, w;
|
|
|
|
constexpr vec4(fixed _x = 0, fixed _y = 0, fixed _z = 0, fixed _w = 0)
|
|
: x(_x), y(_y), z(_z), w(_w) {}
|
|
|
|
vec4 operator+(const vec4& rhs) const;
|
|
vec4 operator-(const vec4& rhs) const;
|
|
|
|
vec4 operator*(fixed rhs) const;
|
|
friend vec4 operator*(fixed lhs, const vec4& rhs) {
|
|
return rhs * lhs;
|
|
}
|
|
|
|
fixed operator*(const vec4& rhs) const;
|
|
|
|
fixed magnitude_sqr() const;
|
|
};
|
|
|
|
} // namespace mtl
|
|
|
|
TARGET_END_MODE
|
|
|