mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix the weird heightmap destroying bug
This commit is contained in:
parent
a119afcfce
commit
70a54f9588
@ -132,7 +132,8 @@ namespace NewHorizons.Builder.Body.Geometry
|
||||
|
||||
float sampleX = heightMap.width * longitude / 360f;
|
||||
float sampleY = heightMap.height * latitude / 180f;
|
||||
if (sampleX > heightMap.width) sampleX -= heightMap.width; // TODO: find out if this actually does anything
|
||||
if (sampleX > heightMap.width) sampleX -= heightMap.width;
|
||||
if (sampleX < 0) sampleX += heightMap.width;
|
||||
|
||||
float relativeHeight = heightMap.GetPixel((int)sampleX, (int)sampleY).r;
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ namespace NewHorizons.Utility
|
||||
var longitude = Mathf.Rad2Deg * Mathf.Atan2(y, x);
|
||||
|
||||
// phi
|
||||
float latitude = (Mathf.Rad2Deg * Mathf.Acos(z / dist));
|
||||
float latitude = Mathf.Rad2Deg * Mathf.Acos(z / dist);
|
||||
|
||||
return new Vector3(longitude, latitude, dist);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user