aboutsummaryrefslogtreecommitdiff
path: root/quat.cpp
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2019-02-04 18:16:49 -0500
committerFranklin Wei <me@fwei.tk>2019-02-04 18:16:49 -0500
commitcf7eff7aab751fd1b599d967ee156c7ebb61cbbd (patch)
tree04c414b2c7b7b42ea80e157458ac5228e04e45dd /quat.cpp
parentf02c73a1cde15f55eac0ee2ecd0a10b6778d8b6c (diff)
downloadfieldviz-cf7eff7aab751fd1b599d967ee156c7ebb61cbbd.zip
fieldviz-cf7eff7aab751fd1b599d967ee156c7ebb61cbbd.tar.gz
fieldviz-cf7eff7aab751fd1b599d967ee156c7ebb61cbbd.tar.bz2
fieldviz-cf7eff7aab751fd1b599d967ee156c7ebb61cbbd.tar.xz
Work on adding toroid
Diffstat (limited to 'quat.cpp')
-rw-r--r--quat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/quat.cpp b/quat.cpp
index aa53af6..df117d0 100644
--- a/quat.cpp
+++ b/quat.cpp
@@ -1,9 +1,9 @@
#include "quat.h"
#include <cmath>
-quat::quat(double w_, double x_, double y_, double z_) : w(w_), x(x_), y(y_), z(z_) { }
-quat::quat(double x_, double y_, double z_) : w(0), x(x_), y(y_), z(z_) { }
-quat::quat(double w_, vec3 vec) : w(w_), x(vec[0]), y(vec[1]), z(vec[2]) { }
+quat::quat(scalar w_, scalar x_, scalar y_, scalar z_) : w(w_), x(x_), y(y_), z(z_) { }
+quat::quat(scalar x_, scalar y_, scalar z_) : w(0), x(x_), y(y_), z(z_) { }
+quat::quat(scalar w_, vec3 vec) : w(w_), x(vec[0]), y(vec[1]), z(vec[2]) { }
quat::quat(vec3 vec) : w(0), x(vec[0]), y(vec[1]), z(vec[2]) { }
quat::quat() : w(0), x(0), y(0), z(0) { }
@@ -25,10 +25,10 @@ quat quat::conjugate() const
return quat(this->w, -this->x, -this->y, -this->z);
}
-quat quat::from_angleaxis(double angle, vec3 axis)
+quat quat::from_angleaxis(scalar angle, vec3 axis)
{
- double si = std::sin(angle / 2);
- double co = std::cos(angle / 2);
+ scalar si = std::sin(angle / 2);
+ scalar co = std::cos(angle / 2);
return quat(co, si * axis[0], si * axis[1], si * axis[2]);
}