Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-03-19 00:29:39 +0300
committerHans Goudey <h.goudey@me.com>2021-03-19 00:29:39 +0300
commit36deb8a48ef22e8732535c48b23af3dbc260495f (patch)
treefaf871f58987f2dfa8f937f39265ef6bf194a773 /source/blender/blenlib/BLI_float4x4.hh
parentfc62d38ce105857f1c3400ba67271db7f2873a29 (diff)
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
Diffstat (limited to 'source/blender/blenlib/BLI_float4x4.hh')
-rw-r--r--source/blender/blenlib/BLI_float4x4.hh10
1 files changed, 10 insertions, 0 deletions
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];