BLI: add conversion from float2 to float3

Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.
This commit is contained in:
Jacques Lucke
2021-01-22 12:16:53 +01:00
parent cd8893d446
commit 6ac0a3d83c

View File

@@ -47,6 +47,11 @@ struct float2 {
return &x;
}
operator float3() const
{
return float3(x, y, 0.0f);
}
float length() const
{
return len_v2(*this);