diff options
-rw-r--r-- | source/blender/blenlib/BLI_float4x4.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh index b44c07a38e4..a3eec075027 100644 --- a/source/blender/blenlib/BLI_float4x4.hh +++ b/source/blender/blenlib/BLI_float4x4.hh @@ -89,6 +89,26 @@ struct float4x4 { return m * float3(v); } + float3 translation() const + { + return float3(values[3]); + } + + /* Assumes XYZ rotation order. */ + float3 to_euler() const + { + float3 euler; + mat4_to_eul(euler, values); + return euler; + } + + float3 scale() const + { + float3 scale; + mat4_to_size(scale, values); + return scale; + } + float4x4 inverted() const { float4x4 result; |