[Bf-blender-cvs] [2d1120c1718] master: BLI: Add "identity" constructor to float4x4 type

Hans Goudey noreply at git.blender.org
Mon Mar 22 16:52:59 CET 2021


Commit: 2d1120c1718da183a4178bec9d3d999ef7ac827f
Author: Hans Goudey
Date:   Mon Mar 22 11:52:44 2021 -0400
Branches: master
https://developer.blender.org/rB2d1120c1718da183a4178bec9d3d999ef7ac827f

BLI: Add "identity" constructor to float4x4 type

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

M	source/blender/blenlib/BLI_float4x4.hh

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

diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh
index a3eec075027..f5ba91bc12c 100644
--- a/source/blender/blenlib/BLI_float4x4.hh
+++ b/source/blender/blenlib/BLI_float4x4.hh
@@ -45,6 +45,13 @@ struct float4x4 {
     return mat;
   }
 
+  static float4x4 identity()
+  {
+    float4x4 mat;
+    unit_m4(mat.values);
+    return mat;
+  }
+
   operator float *()
   {
     return &values[0][0];



More information about the Bf-blender-cvs mailing list