diff options
Diffstat (limited to 'core/math/geometry_3d.cpp')
-rw-r--r-- | core/math/geometry_3d.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index a9ff46410e..7eeb37df46 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -124,8 +124,8 @@ static bool _connect_faces(_FaceClassify *p_faces, int len, int p_group) { Vector3 vj2 = p_faces[j].face.vertex[l]; Vector3 vj1 = p_faces[j].face.vertex[(l + 1) % 3]; - if (vi1.distance_to(vj1) < 0.00001 && - vi2.distance_to(vj2) < 0.00001) { + if (vi1.distance_to(vj1) < 0.00001f && + vi2.distance_to(vj2) < 0.00001f) { if (p_faces[i].links[k].face != -1) { ERR_PRINT("already linked\n"); error = true; @@ -508,7 +508,7 @@ Vector<Face3> Geometry3D::wrap_geometry(Vector<Face3> p_array, real_t *p_error) } } - global_aabb.grow_by(0.01); // Avoid numerical error. + global_aabb.grow_by(0.01f); // Avoid numerical error. // Determine amount of cells in grid axis. int div_x, div_y, div_z; @@ -638,7 +638,7 @@ Geometry3D::MeshData Geometry3D::build_convex_mesh(const Vector<Plane> &p_planes Vector3 ref = Vector3(0.0, 1.0, 0.0); - if (ABS(p.normal.dot(ref)) > 0.95) { + if (ABS(p.normal.dot(ref)) > 0.95f) { ref = Vector3(0.0, 0.0, 1.0); // Change axis. } @@ -663,7 +663,7 @@ Geometry3D::MeshData Geometry3D::build_convex_mesh(const Vector<Plane> &p_planes Vector<Vector3> new_vertices; Plane clip = p_planes[j]; - if (clip.normal.dot(p.normal) > 0.95) { + if (clip.normal.dot(p.normal) > 0.95f) { continue; } @@ -716,7 +716,7 @@ Geometry3D::MeshData Geometry3D::build_convex_mesh(const Vector<Plane> &p_planes for (int j = 0; j < vertices.size(); j++) { int idx = -1; for (int k = 0; k < mesh.vertices.size(); k++) { - if (mesh.vertices[k].distance_to(vertices[j]) < 0.001) { + if (mesh.vertices[k].distance_to(vertices[j]) < 0.001f) { idx = k; break; } @@ -793,8 +793,8 @@ Vector<Plane> Geometry3D::build_cylinder_planes(real_t p_radius, real_t p_height Vector3 axis; axis[p_axis] = 1.0; - planes.push_back(Plane(axis, p_height * 0.5)); - planes.push_back(Plane(-axis, p_height * 0.5)); + planes.push_back(Plane(axis, p_height * 0.5f)); + planes.push_back(Plane(-axis, p_height * 0.5f)); return planes; } @@ -853,7 +853,7 @@ Vector<Plane> Geometry3D::build_capsule_planes(real_t p_radius, real_t p_height, for (int j = 1; j <= p_lats; j++) { Vector3 plane_normal = normal.lerp(axis, j / (real_t)p_lats).normalized(); - Vector3 position = axis * p_height * 0.5 + plane_normal * p_radius; + Vector3 position = axis * p_height * 0.5f + plane_normal * p_radius; planes.push_back(Plane(plane_normal, position)); planes.push_back(Plane(plane_normal * axis_neg, position * axis_neg)); } |