[Bf-blender-cvs] [543783fc619] geometry-nodes-mesh-primitives: Add float3.is_zero()

Hans Goudey noreply at git.blender.org
Thu Mar 11 23:15:11 CET 2021


Commit: 543783fc619b19411d79fe39c49f6d310a86ff09
Author: Hans Goudey
Date:   Mon Mar 8 21:34:18 2021 -0500
Branches: geometry-nodes-mesh-primitives
https://developer.blender.org/rB543783fc619b19411d79fe39c49f6d310a86ff09

Add float3.is_zero()

===================================================================

M	source/blender/blenlib/BLI_float3.hh

===================================================================

diff --git a/source/blender/blenlib/BLI_float3.hh b/source/blender/blenlib/BLI_float3.hh
index 9a8870963bf..7e49cc89b52 100644
--- a/source/blender/blenlib/BLI_float3.hh
+++ b/source/blender/blenlib/BLI_float3.hh
@@ -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);



More information about the Bf-blender-cvs mailing list