summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/mesh.cpp7
-rw-r--r--scene/resources/room.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index bb33962be6..bf5f7bf039 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);
}
diff --git a/scene/resources/room.h b/scene/resources/room.h
index aadee858c2..0e021cfcf7 100644
--- a/scene/resources/room.h
+++ b/scene/resources/room.h
@@ -36,7 +36,7 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-//left for reference but will be removed when portals are reimplemented using Area
+// FIXME: left for reference but will be removed when portals are reimplemented using Area
#if 0
class RoomBounds : public Resource {