Now Basis::get_uniform_scale() returns a real_t instead of a float.

This commit is contained in:
Relintai 2023-05-29 16:08:59 +02:00
parent 47e637b2b8
commit 0f6fb760ad
2 changed files with 8 additions and 5 deletions

View File

@ -216,6 +216,10 @@ Basis Basis::transposed() const {
return tr;
}
Basis Basis::from_scale(const Vector3 &p_scale) {
return Basis(p_scale.x, 0, 0, 0, p_scale.y, 0, 0, 0, p_scale.z);
}
// Multiplies the matrix from left by the scaling matrix: M -> S.M
// See the comment for Basis::rotated for further explanation.
void Basis::scale(const Vector3 &p_scale) {
@ -267,7 +271,7 @@ Basis Basis::scaled_orthogonal(const Vector3 &p_scale) const {
return m;
}
float Basis::get_uniform_scale() const {
real_t Basis::get_uniform_scale() const {
return (rows[0].length() + rows[1].length() + rows[2].length()) / 3.0f;
}
@ -1193,4 +1197,3 @@ Basis Basis::looking_at(const Vector3 &p_target, const Vector3 &p_up) {
basis.set_columns(v_x, v_y, v_z);
return basis;
}

View File

@ -122,7 +122,7 @@ struct _NO_DISCARD_CLASS_ Basis {
Basis scaled_orthogonal(const Vector3 &p_scale) const;
void make_scale_uniform();
float get_uniform_scale() const;
real_t get_uniform_scale() const;
Vector3 get_scale() const;
Vector3 get_scale_abs() const;