From ae7d514cf3b23508db390173970349a588d618cd Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 8 Aug 2022 01:18:58 +0200 Subject: [PATCH] Added set_column to Basis. --- core/math/basis.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/math/basis.h b/core/math/basis.h index aad280149..4beced931 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -201,6 +201,13 @@ public: return Vector3(elements[0][i], elements[1][i], elements[2][i]); } + _FORCE_INLINE_ void set_column(int p_index, const Vector3 &p_value) { + // Set actual basis axis column (we store transposed as rows for performance). + elements[0][p_index] = p_value.x; + elements[1][p_index] = p_value.y; + elements[2][p_index] = p_value.z; + } + _FORCE_INLINE_ Vector3 get_row(int i) const { return Vector3(elements[i][0], elements[i][1], elements[i][2]); }