diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:31:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-03 15:31:26 +0300 |
commit | 7704e6a678ab324b479797dc8d8f8d63b109956f (patch) | |
tree | a1ac8c05610c15aa6642b8f69b8c517533d7009b /source/blender/blenlib/BLI_float4x4.hh | |
parent | 395b294b614f43faac0ffaef167aed1b94a53b8e (diff) |
Cleanup: bring operator overloads closer together
Diffstat (limited to 'source/blender/blenlib/BLI_float4x4.hh')
-rw-r--r-- | source/blender/blenlib/BLI_float4x4.hh | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh index 0abfb751ebf..1e9bd12b12b 100644 --- a/source/blender/blenlib/BLI_float4x4.hh +++ b/source/blender/blenlib/BLI_float4x4.hh @@ -46,23 +46,6 @@ struct float4x4 { return (const float *)this; } - float4x4 inverted() const - { - float result[4][4]; - invert_m4_m4(result, values); - return result; - } - - /** - * Matrix inversion can be implemented more efficiently for affine matrices. - */ - float4x4 inverted_affine() const - { - BLI_assert(values[0][3] == 0.0f && values[1][3] == 0.0f && values[2][3] == 0.0f && - values[3][3] == 1.0f); - return this->inverted(); - } - friend float4x4 operator*(const float4x4 &a, const float4x4 &b) { float4x4 result; @@ -86,6 +69,23 @@ struct float4x4 { return m * float3(v); } + float4x4 inverted() const + { + float result[4][4]; + invert_m4_m4(result, values); + return result; + } + + /** + * Matrix inversion can be implemented more efficiently for affine matrices. + */ + float4x4 inverted_affine() const + { + BLI_assert(values[0][3] == 0.0f && values[1][3] == 0.0f && values[2][3] == 0.0f && + values[3][3] == 1.0f); + return this->inverted(); + } + struct float3x3_ref { const float4x4 &data; |