BLI: Add accessors for translation, rotation, and scale of float4x4
This commit is contained in:
parent
dd7feb09c9
commit
9de8c2fa18
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue