Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-31 12:17:21 +0300
committerJacques Lucke <jacques@blender.org>2020-07-31 12:17:33 +0300
commitf379bb368bf57b97eb6b10a009ecb80cbc57159f (patch)
tree697b1eddfb2ae199559f0941dedb9f94bf82236f /source/blender/blenlib/BLI_float3.hh
parent585c9c2f23d76ffe29997f2beb149fb363ef35fa (diff)
BLI: fix float3 in-place operators
Diffstat (limited to 'source/blender/blenlib/BLI_float3.hh')
-rw-r--r--source/blender/blenlib/BLI_float3.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_float3.hh b/source/blender/blenlib/BLI_float3.hh
index a0979bc75bd..6acf4716525 100644
--- a/source/blender/blenlib/BLI_float3.hh
+++ b/source/blender/blenlib/BLI_float3.hh
@@ -63,11 +63,12 @@ struct float3 {
return {a.x + b.x, a.y + b.y, a.z + b.z};
}
- void operator+=(const float3 &b)
+ float3 &operator+=(const float3 &b)
{
this->x += b.x;
this->y += b.y;
this->z += b.z;
+ return *this;
}
friend float3 operator-(const float3 &a, const float3 &b)
@@ -80,25 +81,28 @@ struct float3 {
return {-a.x, -a.y, -a.z};
}
- void operator-=(const float3 &b)
+ float3 &operator-=(const float3 &b)
{
this->x -= b.x;
this->y -= b.y;
this->z -= b.z;
+ return *this;
}
- void operator*=(float scalar)
+ float3 &operator*=(float scalar)
{
this->x *= scalar;
this->y *= scalar;
this->z *= scalar;
+ return *this;
}
- void operator*=(const float3 &other)
+ float3 &operator*=(const float3 &other)
{
this->x *= other.x;
this->y *= other.y;
this->z *= other.z;
+ return *this;
}
friend float3 operator*(const float3 &a, const float3 &b)