[Bf-blender-cvs] [36deb8a48ef] master: BLI: Add location, rotation, scale constructor to float4x4

Hans Goudey noreply at git.blender.org
Thu Mar 18 22:29:42 CET 2021


Commit: 36deb8a48ef22e8732535c48b23af3dbc260495f
Author: Hans Goudey
Date:   Thu Mar 18 17:29:39 2021 -0400
Branches: master
https://developer.blender.org/rB36deb8a48ef22e8732535c48b23af3dbc260495f

BLI: Add location, rotation, scale constructor to float4x4

This is simply a convenience when using this type. More similar
constructors can be added in the future when they are useful.

Differential Revision: https://developer.blender.org/D10714

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

M	source/blender/blenlib/BLI_float4x4.hh

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

diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh
index d6d759ccfe4..b44c07a38e4 100644
--- a/source/blender/blenlib/BLI_float4x4.hh
+++ b/source/blender/blenlib/BLI_float4x4.hh
@@ -35,6 +35,16 @@ struct float4x4 {
   {
   }
 
+  /* Assumes an XYZ euler order. */
+  static float4x4 from_loc_eul_scale(const float3 location,
+                                     const float3 rotation,
+                                     const float3 scale)
+  {
+    float4x4 mat;
+    loc_eul_size_to_mat4(mat.values, location, rotation, scale);
+    return mat;
+  }
+
   operator float *()
   {
     return &values[0][0];



More information about the Bf-blender-cvs mailing list