Fixes the normals of SphereMesh when the radius is different from 1
This commit is contained in:
parent
8abd46096a
commit
7d53755ca7
|
@ -1466,7 +1466,7 @@ void SphereMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
} else {
|
} else {
|
||||||
Vector3 p = Vector3(x * radius * w, y, z * radius * w);
|
Vector3 p = Vector3(x * radius * w, y, z * radius * w);
|
||||||
points.push_back(p);
|
points.push_back(p);
|
||||||
Vector3 normal = Vector3(x * radius * w * scale, y / scale, z * radius * w * scale);
|
Vector3 normal = Vector3(x * w * scale, radius * (y / scale), z * w * scale);
|
||||||
normals.push_back(normal.normalized());
|
normals.push_back(normal.normalized());
|
||||||
};
|
};
|
||||||
ADD_TANGENT(z, 0.0, -x, 1.0)
|
ADD_TANGENT(z, 0.0, -x, 1.0)
|
||||||
|
|
Loading…
Reference in a new issue