diff options
Diffstat (limited to 'intern/cycles/util/util_math_float3.h')
-rw-r--r-- | intern/cycles/util/util_math_float3.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_float3.h b/intern/cycles/util/util_math_float3.h index c9a5b34aa58..dd2010715ba 100644 --- a/intern/cycles/util/util_math_float3.h +++ b/intern/cycles/util/util_math_float3.h @@ -35,7 +35,9 @@ ccl_device_inline float3 operator*(const float f, const float3 &a); ccl_device_inline float3 operator/(const float f, const float3 &a); ccl_device_inline float3 operator/(const float3 &a, const float f); ccl_device_inline float3 operator/(const float3 &a, const float3 &b); +ccl_device_inline float3 operator+(const float3 &a, const float f); ccl_device_inline float3 operator+(const float3 &a, const float3 &b); +ccl_device_inline float3 operator-(const float3 &a, const float f); ccl_device_inline float3 operator-(const float3 &a, const float3 &b); ccl_device_inline float3 operator+=(float3 &a, const float3 &b); ccl_device_inline float3 operator-=(float3 &a, const float3 &b); @@ -150,6 +152,11 @@ ccl_device_inline float3 operator/(const float3 &a, const float3 &b) # endif } +ccl_device_inline float3 operator+(const float3 &a, const float f) +{ + return a + make_float3(f, f, f); +} + ccl_device_inline float3 operator+(const float3 &a, const float3 &b) { # ifdef __KERNEL_SSE__ @@ -159,6 +166,11 @@ ccl_device_inline float3 operator+(const float3 &a, const float3 &b) # endif } +ccl_device_inline float3 operator-(const float3 &a, const float f) +{ + return a - make_float3(f, f, f); +} + ccl_device_inline float3 operator-(const float3 &a, const float3 &b) { # ifdef __KERNEL_SSE__ |