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:
@@ -47,6 +47,11 @@ struct float2 {
|
||||
return &x;
|
||||
}
|
||||
|
||||
operator float3() const
|
||||
{
|
||||
return float3(x, y, 0.0f);
|
||||
}
|
||||
|
||||
float length() const
|
||||
{
|
||||
return len_v2(*this);
|
||||
|
Reference in New Issue
Block a user