summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-03 23:43:33 +0200
committerGitHub <noreply@github.com>2017-07-03 23:43:33 +0200
commite54c7d5715e70c4ef08b6a3f7039c2bdf2473045 (patch)
treef782dfef613af8fa5c211d7069e061e380a1f7c2 /editor/import
parent2036273f944084ccbe2483619d4f4b3de48a322c (diff)
parent44ecfb028d21975944b47b6496712a29f17f3848 (diff)
Merge pull request #9457 from TwistedTwigleg/Fixed_Vector3_snap
Fixed syntax inconsistency in Vector3.snap and Vector3.snapped
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/editor_import_collada.cpp6
-rw-r--r--editor/import/resource_importer_obj.cpp2
-rw-r--r--editor/import/resource_importer_scene.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 7948db3797..7f91cc86cf 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -554,10 +554,10 @@ static void _generate_tangents_and_binormals(const PoolVector<int> &p_indices, c
tangent = Vector3();
} else {
tangent = Vector3((t2 * x1 - t1 * x2) * r, (t2 * y1 - t1 * y2) * r,
- (t2 * z1 - t1 * z2) * r)
+ (t2 * z1 - t1 * z2) * r)
.normalized();
binormal = Vector3((s1 * x2 - s2 * x1) * r, (s1 * y2 - s2 * y1) * r,
- (s1 * z2 - s2 * z1) * r)
+ (s1 * z2 - s2 * z1) * r)
.normalized();
}
@@ -867,7 +867,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
int normal_pos = (normal_src->stride ? normal_src->stride : 3) * p.indices[src + normal_ofs];
ERR_FAIL_INDEX_V(normal_pos, normal_src->array.size(), ERR_INVALID_DATA);
vertex.normal = Vector3(normal_src->array[normal_pos + 0], normal_src->array[normal_pos + 1], normal_src->array[normal_pos + 2]);
- vertex.normal = vertex.normal.snapped(0.001);
+ vertex.normal.snap(Vector3(0.001, 0.001, 0.001));
if (tangent_src && binormal_src) {
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index 1c5aa95ff1..4a2f37e319 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -188,7 +188,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
Vector3 vertex = vertices[vtx];
if (weld_vertices)
- vertex = vertex.snapped(weld_tolerance);
+ vertex.snap(Vector3(weld_tolerance, weld_tolerance, weld_tolerance));
surf_tool->add_vertex(vertex);
}
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 2409f6707d..2ccbd36e18 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -594,7 +594,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array
for (int i = 0; i < 3; i++) {
- Vector3 v = f.vertex[i].snapped(0.01);
+ Vector3 v = f.vertex[i].snapped(Vector3(0.01, 0.01, 0.01));
if (!points.has(v)) {
points.insert(v);
center += v;