[Bf-blender-cvs] [c07dad40c9c] soc-2021-adaptive-cloth: bli: float2x2: add 2 matrices

ishbosamiya noreply at git.blender.org
Mon Jul 19 17:35:43 CEST 2021


Commit: c07dad40c9cb482d56c34cae930ec7795fb56634
Author: ishbosamiya
Date:   Fri Jul 16 20:52:03 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rBc07dad40c9cb482d56c34cae930ec7795fb56634

bli: float2x2: add 2 matrices

===================================================================

M	source/blender/blenlib/BLI_float2x2.hh

===================================================================

diff --git a/source/blender/blenlib/BLI_float2x2.hh b/source/blender/blenlib/BLI_float2x2.hh
index 087d9323e80..b79adeb9af5 100644
--- a/source/blender/blenlib/BLI_float2x2.hh
+++ b/source/blender/blenlib/BLI_float2x2.hh
@@ -82,6 +82,18 @@ struct float2x2 {
     return m * float2(v);
   }
 
+  friend float2x2 operator+(const float2x2 &m1, const float2x2 &m2)
+  {
+    float2x2 res;
+
+    res.ptr()[0][0] = m1.ptr()[0][0] + m2.ptr()[0][0];
+    res.ptr()[0][1] = m1.ptr()[0][1] + m2.ptr()[0][1];
+    res.ptr()[1][0] = m1.ptr()[1][0] + m2.ptr()[1][0];
+    res.ptr()[1][1] = m1.ptr()[1][1] + m2.ptr()[1][1];
+
+    return float2x2(res);
+  }
+
   uint64_t hash() const
   {
     uint64_t h = 435109;



More information about the Bf-blender-cvs mailing list