add multiply(float, Vec3) because multiply commutes

This commit is contained in:
Andrew Meadows 2014-09-19 16:54:03 -07:00
parent 76f78e77d1
commit 09d3c51120
2 changed files with 5 additions and 0 deletions

View file

@ -25,6 +25,10 @@ glm::vec3 Vec3::multiply(const glm::vec3& v1, float f) {
return v1 * f;
}
glm::vec3 Vec3::multiply(float f, const glm::vec3& v1) {
return v1 * f;
}
glm::vec3 Vec3::multiplyQbyV(const glm::quat& q, const glm::vec3& v) {
return q * v;
}

View file

@ -28,6 +28,7 @@ public slots:
glm::vec3 cross(const glm::vec3& v1, const glm::vec3& v2);
float dot(const glm::vec3& v1, const glm::vec3& v2);
glm::vec3 multiply(const glm::vec3& v1, float f);
glm::vec3 multiply(float, const glm::vec3& v1);
glm::vec3 multiplyQbyV(const glm::quat& q, const glm::vec3& v);
glm::vec3 sum(const glm::vec3& v1, const glm::vec3& v2);
glm::vec3 subtract(const glm::vec3& v1, const glm::vec3& v2);