Merge pull request #84097 from stoofin/plane-mesh-tangent

Fix PlaneMesh tangents for 'Face X' orientation
This commit is contained in:
Rémi Verschelde 2023-10-30 10:18:57 +01:00
commit ad9297ee8c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1300,7 +1300,11 @@ void PlaneMesh::_create_mesh_array(Array &p_arr) const {
points.push_back(Vector3(-x, z, 0.0) + center_offset);
}
normals.push_back(normal);
ADD_TANGENT(1.0, 0.0, 0.0, 1.0);
if (orientation == FACE_X) {
ADD_TANGENT(0.0, 0.0, -1.0, 1.0);
} else {
ADD_TANGENT(1.0, 0.0, 0.0, 1.0);
}
uvs.push_back(Vector2(1.0 - u, 1.0 - v)); /* 1.0 - uv to match orientation with Quad */
point++;