History

moved vector math helpers to Utils.cpp/h

ZappoMan committed 13 years ago

Commit 597f35d1 parent fc122f23 files · +27 −20Browse files

Showing the changes to interface/src/Util.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Util.cpp+23−0
@@ -140,3 +140,26 @@ void drawvec3(int x, int y, float scale, float rotate, float thick, int mono, gl · 139 unmodified lines
140140 glPopMatrix();
141141
142142 }
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+

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t