forked from bartvdbraak/blender
BLI: Add "is_zero" method to float2 and float3 types
This is not necessary, but a nice convenience to avoid using `is_zero_v3`. Differential Revision: https://developer.blender.org/D10713
This commit is contained in:
parent
070010e203
commit
c23da7a5c9
@ -65,6 +65,11 @@ struct float2 {
|
||||
return len_squared_v2(*this);
|
||||
}
|
||||
|
||||
bool is_zero() const
|
||||
{
|
||||
return this->x == 0.0f && this->y == 0.0f;
|
||||
}
|
||||
|
||||
float2 &operator+=(const float2 &other)
|
||||
{
|
||||
x += other.x;
|
||||
|
@ -174,6 +174,11 @@ struct float3 {
|
||||
return len_squared_v3(*this);
|
||||
}
|
||||
|
||||
bool is_zero() const
|
||||
{
|
||||
return this->x == 0.0f && this->y == 0.0f && this->z == 0.0f;
|
||||
}
|
||||
|
||||
void reflect(const float3 &normal)
|
||||
{
|
||||
*this = this->reflected(normal);
|
||||
|
Loading…
Reference in New Issue
Block a user