Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_float3.hh
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | operator float *() | ||||
| return &x; | return &x; | ||||
| } | } | ||||
| friend float3 operator+(const float3 &a, const float3 &b) | friend float3 operator+(const float3 &a, const float3 &b) | ||||
| { | { | ||||
| return {a.x + b.x, a.y + b.y, a.z + b.z}; | return {a.x + b.x, a.y + b.y, a.z + b.z}; | ||||
| } | } | ||||
| friend float3 operator+(const float3 &a, const float &b) | |||||
| { | |||||
| return {a.x + b, a.y + b, a.z + b}; | |||||
| } | |||||
| float3 &operator+=(const float3 &b) | float3 &operator+=(const float3 &b) | ||||
| { | { | ||||
| this->x += b.x; | this->x += b.x; | ||||
| this->y += b.y; | this->y += b.y; | ||||
| this->z += b.z; | this->z += b.z; | ||||
| return *this; | return *this; | ||||
| } | } | ||||
| friend float3 operator-(const float3 &a, const float3 &b) | friend float3 operator-(const float3 &a, const float3 &b) | ||||
| { | { | ||||
| return {a.x - b.x, a.y - b.y, a.z - b.z}; | return {a.x - b.x, a.y - b.y, a.z - b.z}; | ||||
| } | } | ||||
| friend float3 operator-(const float3 &a, const float &b) | |||||
| { | |||||
| return {a.x - b, a.y - b, a.z - b}; | |||||
| } | |||||
| friend float3 operator-(const float3 &a) | friend float3 operator-(const float3 &a) | ||||
| { | { | ||||
| return {-a.x, -a.y, -a.z}; | return {-a.x, -a.y, -a.z}; | ||||
| } | } | ||||
| float3 &operator-=(const float3 &b) | float3 &operator-=(const float3 &b) | ||||
| { | { | ||||
| this->x -= b.x; | this->x -= b.x; | ||||
| ▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines | |||||