Showing the changes to interface/src/Util.cpp (1 of 3 files). Show all
Unified · Split
| @@ -140,3 +140,26 @@ void drawvec3(int x, int y, float scale, float rotate, float thick, int mono, gl · 139 unmodified lines | ||
| 140 | 140 | glPopMatrix(); |
| 141 | 141 | |
| 142 | 142 | } |
| 143 | + | |
| 144 | +// XXXBHG - These handy operators should probably go somewhere else, I'm surprised they don't | |
| 145 | +// already exist somewhere in OpenGL. Maybe someone can point me to them if they do exist! | |
| 146 | +glm::vec3 operator* (float lhs, const glm::vec3& rhs) | |
| 147 | +{ | |
| 148 | + glm::vec3 result = rhs; | |
| 149 | + result.x *= lhs; | |
| 150 | + result.y *= lhs; | |
| 151 | + result.z *= lhs; | |
| 152 | + return result; | |
| 153 | +} | |
| 154 | + | |
| 155 | +// XXXBHG - These handy operators should probably go somewhere else, I'm surprised they don't | |
| 156 | +// already exist somewhere in OpenGL. Maybe someone can point me to them if they do exist! | |
| 157 | +glm::vec3 operator* (const glm::vec3& lhs, float rhs) | |
| 158 | +{ | |
| 159 | + glm::vec3 result = lhs; | |
| 160 | + result.x *= rhs; | |
| 161 | + result.y *= rhs; | |
| 162 | + result.z *= rhs; | |
| 163 | + return result; | |
| 164 | +} | |
| 165 | + | |