[Bf-blender-cvs] [624794e0062] functions: float3 * scalar operator

Jacques Lucke noreply at git.blender.org
Fri Jun 28 16:04:34 CEST 2019


Commit: 624794e0062ee08939eaaa64421c4709a1a037a7
Author: Jacques Lucke
Date:   Fri Jun 28 14:46:15 2019 +0200
Branches: functions
https://developer.blender.org/rB624794e0062ee08939eaaa64421c4709a1a037a7

float3 * scalar operator

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

M	source/blender/blenlib/BLI_math.hpp

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

diff --git a/source/blender/blenlib/BLI_math.hpp b/source/blender/blenlib/BLI_math.hpp
index dd21053975b..e7576656f90 100644
--- a/source/blender/blenlib/BLI_math.hpp
+++ b/source/blender/blenlib/BLI_math.hpp
@@ -57,6 +57,13 @@ struct float3 {
     this->z += b.z;
   }
 
+  void operator*=(float scalar)
+  {
+    this->x *= scalar;
+    this->y *= scalar;
+    this->z *= scalar;
+  }
+
   friend float3 operator*(float3 a, float3 b)
   {
     return {a.x * b.x, a.y * b.y, a.z * b.z};



More information about the Bf-blender-cvs mailing list