7 mat3f::mat3f(
const mat2f& mat)
10 mat.
get(0,0), mat.
get(0,1), 0,
11 mat.
get(1,0), mat.
get(1,1), 0,
22 float t00,
float t01,
float t02,
23 float t10,
float t11,
float t12,
24 float t20,
float t21,
float t22
75 const auto c =
cos(a);
76 const auto s =
sin(a);
90 const auto c =
cos(a);
91 const auto s =
sin(a);
105 const auto c =
cos(a);
106 const auto s =
sin(a);
118 const auto u = aa.
axis.
x;
119 const auto v = aa.
axis.
y;
120 const auto w = aa.
axis.
z;
124 rcos + u * u * (1 - rcos),
125 w * rsin + v * u * (1 - rcos),
126 -v * rsin + w * u * (1 - rcos),
128 -w * rsin + u * v * (1 - rcos),
129 rcos + v * v * (1 - rcos),
130 u * rsin + w * v * (1 - rcos),
132 v * rsin + u * w * (1 - rcos),
133 -u * rsin + v * w * (1 - rcos),
134 rcos + w * w * (1 - rcos)
142 return {
get(0, 0),
get(1, 1),
get(2, 2)};
189 #define OP(i) data[i] += rhs.data[i]
200 #define OP(i) data[i] -= rhs.data[i]
239 return data[col * 3 + row];
246 return {
get(0, c),
get(1, c),
get(2, c)};
253 return {
get(r, 0),
get(r, 1),
get(r, 2)};
259 return fmt::format(
"({}, {}, {})", m.get_row(0), m.get_row(1), m.get_row(2));
283 const auto x = lhs.
x * rhs.
x;
284 const auto y = lhs.
y * rhs.
y;
285 const auto z = lhs.
z* rhs.
z;
293 get_component_multiply_sum(vec3f{lhs.get_row(r)}, vec3f{rhs.get_column(c)})
296 OP(0, 0),
OP(0, 1),
OP(0, 2),
297 OP(1, 0),
OP(1, 1),
OP(1, 2),
298 OP(2, 0),
OP(2, 1),
OP(2, 2)
306 #define OP(r) get_component_multiply_sum(vec3f{lhs.get_row(r)}, rhs)
307 return {
OP(0),
OP(1),
OP(2)};
Angle operator+(const Angle &lhs, const Angle &rhs)
Angle operator-(const Angle &lhs, const Angle &rhs)
std::string to_string(const Aabb &a)
float cos(const Angle &ang)
float sin(const Angle &ang)
Angle operator*(const Angle &lhs, float rhs)
float get_component_multiply_sum(const vec2f &lhs, const vec2f &rhs)
Angle angle
rotation according to right-hand rule
float get(int row, int col) const
static mat3f from_rot_z(const Angle &a)
mat3f get_rotated(const AxisAngle &aa) const
float get(int row, int col) const
static mat3f from_axis_angle(const AxisAngle &aa)
vec3f get_axis(int col) const
void operator-=(const mat3f &rhs)
static mat3f from_col_major(float t00, float t01, float t02, float t10, float t11, float t12, float t20, float t21, float t22)
static mat3f from_rot_x(const Angle &a)
static mat3f from_translation2d(const vec2f &t)
constexpr static mat3f from_row_major(float t00, float t10, float t20, float t01, float t11, float t21, float t02, float t12, float t22)
static mat3f from_major(const Scale3f &major)
static mat3f from_scale(const Scale3f &scale)
vec3f get_row(int r) const
vec3f get_column(int c) const
mat3f get_transposed() const
static mat3f from_rot_y(const Angle &a)
void operator+=(const mat3f &rhs)
mat3f get_scaled(const Scale3f &scale) const