summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/kdesavers/vec3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdescreensaver/kdesavers/vec3.cpp')
-rw-r--r--tdescreensaver/kdesavers/vec3.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tdescreensaver/kdesavers/vec3.cpp b/tdescreensaver/kdesavers/vec3.cpp
index c66730e5..1715937e 100644
--- a/tdescreensaver/kdesavers/vec3.cpp
+++ b/tdescreensaver/kdesavers/vec3.cpp
@@ -59,7 +59,9 @@ vec3<T>& vec3<T>::rotate(const vec3<T>& r)
// part of vector which is parallel to r
vec3<T> par(r*(*this)/(r*r) * r);
// part of vector which is perpendicular to r
- vec3<T> perp(*this - par);
+ vec3<T> perp(*this);
+ std::valarray<T> &perp_ = perp;
+ perp -= std::valarray<T>(par);
// rotation direction, size of perp
vec3<T> rotdir(norm(perp) * normalized(crossprod(r,perp)));
*this = par + cos(phi)*perp + sin(phi)*rotdir;