Fix type conversion warnings
This commit is contained in:
@@ -136,7 +136,7 @@ float &Quaternion::operator [](unsigned i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector3 Quaternion::eulerXYZ() const {
|
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) {
|
if(a2 <= -0.99999) {
|
||||||
return Vector3::Create(
|
return Vector3::Create(
|
||||||
2.0f * atan2(c[1], c[0]),
|
2.0f * atan2(c[1], c[0]),
|
||||||
@@ -151,9 +151,9 @@ Vector3 Quaternion::eulerXYZ() const {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Vector3::Create(
|
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),
|
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])))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace kraken {
|
|||||||
|
|
||||||
float SmoothStep(float a, float b, float t)
|
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;
|
return a * (1.0f - d) + b * d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ Vector3 Triangle3::operator[](unsigned int i) const
|
|||||||
bool Triangle3::rayCast(const Vector3 &start, const Vector3 &dir, Vector3 &hit_point) 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
|
// 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 u, v, n; // triangle vectors
|
||||||
Vector3 w0, w; // ray vectors
|
Vector3 w0, w; // ray vectors
|
||||||
float r, a, b; // params to calc ray-plane intersect
|
float r, a, b; // params to calc ray-plane intersect
|
||||||
|
|||||||
Reference in New Issue
Block a user