diff options
| author | Juan Linietsky | 2017-12-17 12:04:35 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-12-17 12:04:54 -0300 |
| commit | fa8a1fc4201dc4c16b5eef844dde17c5bba92dc8 (patch) | |
| tree | 5245ed8307704a90dbbcb4480cd773028ef7e225 /scene/resources/mesh.cpp | |
| parent | cacab4ba6204aa36ddbc85d55705ab82b45e7930 (diff) | |
| download | godot-fa8a1fc4201dc4c16b5eef844dde17c5bba92dc8.tar.gz godot-fa8a1fc4201dc4c16b5eef844dde17c5bba92dc8.tar.zst godot-fa8a1fc4201dc4c16b5eef844dde17c5bba92dc8.zip | |
Diffstat (limited to 'scene/resources/mesh.cpp')
| -rw-r--r-- | scene/resources/mesh.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index bb33962be..bf5f7bf03 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1111,13 +1111,14 @@ Error ArrayMesh::lightmap_unwrap(const Transform &p_base_transform, float p_texe for (int j = 0; j < vc; j++) { Vector3 v = p_base_transform.xform(r[j]); + Vector3 n = p_base_transform.basis.xform(rn[j]).normalized(); vertices[(j + vertex_ofs) * 3 + 0] = v.x; vertices[(j + vertex_ofs) * 3 + 1] = v.y; vertices[(j + vertex_ofs) * 3 + 2] = v.z; - normals[(j + vertex_ofs) * 3 + 0] = rn[j].x; - normals[(j + vertex_ofs) * 3 + 1] = rn[j].y; - normals[(j + vertex_ofs) * 3 + 2] = rn[j].z; + normals[(j + vertex_ofs) * 3 + 0] = n.x; + normals[(j + vertex_ofs) * 3 + 1] = n.y; + normals[(j + vertex_ofs) * 3 + 2] = n.z; uv_index[j + vertex_ofs] = Pair<int, int>(i, j); } |
