MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / vec4

Class vec4

src/math/linear_algebra.h:35–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33class mat4;
34
35class vec4 {
36 friend class mat4;
37
38 public:
39 vec4() = default;
40
41 vec4(float x, float y, float z, float w);
42
43 vec4& operator+=(const vec4& b);
44
45 friend vec4 operator+(const vec4& a, const vec4& b) {
46 return {a.vec_[0] + b.vec_[0],
47 a.vec_[1] + b.vec_[1],
48 a.vec_[2] + b.vec_[2],
49 a.vec_[3] + b.vec_[3]};
50 }
51
52 friend vec4 operator-(const vec4& a, const vec4& b) {
53 return {a.vec_[0] - b.vec_[0],
54 a.vec_[1] - b.vec_[1],
55 a.vec_[2] - b.vec_[2],
56 a.vec_[3] - b.vec_[3]};
57 }
58
59 friend vec4 operator*(const vec4& vec, const float scalar) {
60 auto result = vec4{vec};
61 result.vec_ *= scalar;
62
63 return result;
64 }
65
66 void print() const;
67
68 float* data();
69
70 float& x();
71 float& y();
72 float& z();
73 float& w();
74
75 [[nodiscard]] const float& x() const;
76 [[nodiscard]] const float& y() const;
77 [[nodiscard]] const float& z() const;
78 [[nodiscard]] const float& w() const;
79
80 static vec4 zero();
81
82 private:
83 Eigen::Vector4f vec_{};
84};
85
86vec4 operator-(const vec4& vector);
87

Callers 8

handle_key_eventsMethod · 0.85
scale_atMethod · 0.85
set_initial_zoomMethod · 0.85
set_zoom_powerMethod · 0.85
move_toMethod · 0.85
get_positionMethod · 0.85
stage_coordinatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected