diff --git a/src/quaternion.cpp b/src/quaternion.cpp index ba2a17b..7eaf578 100644 --- a/src/quaternion.cpp +++ b/src/quaternion.cpp @@ -136,7 +136,7 @@ float &Quaternion::operator [](unsigned i) { } Vector3 Quaternion::eulerXYZ() const { - double a2 = 2 * (c[0] * c[2] - c[1] * c[3]); + float a2 = 2 * (c[0] * c[2] - c[1] * c[3]); if(a2 <= -0.99999) { return Vector3::Create( 2.0f * atan2(c[1], c[0]), @@ -151,9 +151,9 @@ Vector3 Quaternion::eulerXYZ() const { ); } else { return Vector3::Create( - atan2(2 * (c[0] * c[1] + c[2] * c[3]), (1 - 2 * (c[1] * c[1] + c[2] * c[2]))), + atan2f(2 * (c[0] * c[1] + c[2] * c[3]), (1 - 2 * (c[1] * c[1] + c[2] * c[2]))), asinf(a2), - atan2(2 * (c[0] * c[3] + c[1] * c[2]), (1 - 2 * (c[2] * c[2] + c[3] * c[3]))) + atan2f(2 * (c[0] * c[3] + c[1] * c[2]), (1 - 2 * (c[2] * c[2] + c[3] * c[3]))) ); } diff --git a/src/scalar.cpp b/src/scalar.cpp index 3fee6d1..ea0784f 100644 --- a/src/scalar.cpp +++ b/src/scalar.cpp @@ -35,7 +35,7 @@ namespace kraken { float SmoothStep(float a, float b, float t) { - float d = (3.0 * t * t - 2.0 * t * t * t); + float d = (3.0f * t * t - 2.0f * t * t * t); return a * (1.0f - d) + b * d; } diff --git a/src/triangle3.cpp b/src/triangle3.cpp index 59f6738..78093ce 100644 --- a/src/triangle3.cpp +++ b/src/triangle3.cpp @@ -150,7 +150,7 @@ Vector3 Triangle3::operator[](unsigned int i) const bool Triangle3::rayCast(const Vector3 &start, const Vector3 &dir, Vector3 &hit_point) const { // algorithm based on Dan Sunday's implementation at http://geomalgorithms.com/a06-_intersect-2.html - const float SMALL_NUM = 0.00000001; // anything that avoids division overflow + const float SMALL_NUM = 0.00000001f; // anything that avoids division overflow Vector3 u, v, n; // triangle vectors Vector3 w0, w; // ray vectors float r, a, b; // params to calc ray-plane intersect