mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Don't use height map
This commit is contained in:
parent
c42318542e
commit
330a9d91e5
@ -44,10 +44,9 @@ namespace NewHorizons.Builder.Body
|
|||||||
// We want to take the largest size I think
|
// We want to take the largest size I think
|
||||||
var realSize = body.Config.Base.surfaceSize;
|
var realSize = body.Config.Base.surfaceSize;
|
||||||
|
|
||||||
GameObject heightMap = null;
|
|
||||||
if (body.Config.HeightMap != null)
|
if (body.Config.HeightMap != null)
|
||||||
{
|
{
|
||||||
heightMap = HeightMapBuilder.Make(newProxy, null, body.Config.HeightMap, body.Mod, 20);
|
HeightMapBuilder.Make(newProxy, null, body.Config.HeightMap, body.Mod, 20);
|
||||||
if (realSize < body.Config.HeightMap.maxHeight) realSize = body.Config.HeightMap.maxHeight;
|
if (realSize < body.Config.HeightMap.maxHeight) realSize = body.Config.HeightMap.maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +157,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null)
|
if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null)
|
||||||
{
|
{
|
||||||
proxyController._supernovaPlanetEffectController = SupernovaEffectBuilder.Make(newProxy, null, body.Config, heightMap, procGen, null, null, null, proxyController._atmosphere, proxyController._fog);
|
proxyController._supernovaPlanetEffectController = SupernovaEffectBuilder.Make(newProxy, null, body.Config, procGen, null, null, null, proxyController._atmosphere, proxyController._fog);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove all collisions if there are any
|
// Remove all collisions if there are any
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
{
|
{
|
||||||
public static class SupernovaEffectBuilder
|
public static class SupernovaEffectBuilder
|
||||||
{
|
{
|
||||||
public static NHSupernovaPlanetEffectController Make(GameObject planetGO, Sector sector, PlanetConfig config, GameObject heightMap, GameObject procGen, Light ambientLight, PlanetaryFogController fog, LODGroup atmosphere, Renderer atmosphereRenderer, Renderer fogImpostor)
|
public static NHSupernovaPlanetEffectController Make(GameObject planetGO, Sector sector, PlanetConfig config, GameObject procGen, Light ambientLight, PlanetaryFogController fog, LODGroup atmosphere, Renderer atmosphereRenderer, Renderer fogImpostor)
|
||||||
{
|
{
|
||||||
var vanillaController = planetGO.GetComponentInChildren<SupernovaPlanetEffectController>();
|
var vanillaController = planetGO.GetComponentInChildren<SupernovaPlanetEffectController>();
|
||||||
if (vanillaController != null)
|
if (vanillaController != null)
|
||||||
@ -129,20 +129,11 @@ namespace NewHorizons.Builder.Body
|
|||||||
shockLayer.transform.position = planetGO.transform.position;
|
shockLayer.transform.position = planetGO.transform.position;
|
||||||
shockLayer.transform.localScale = Vector3.one * biggestSize * 1.1f;
|
shockLayer.transform.localScale = Vector3.one * biggestSize * 1.1f;
|
||||||
|
|
||||||
if (!noMeshChange)
|
if (!noMeshChange && procGen != null)
|
||||||
{
|
{
|
||||||
if (heightMap != null)
|
shockLayer.GetComponent<MeshFilter>().sharedMesh = procGen.GetComponent<MeshFilter>().sharedMesh;
|
||||||
{
|
shockLayer.transform.localScale = Vector3.one * 1.1f;
|
||||||
shockLayer.GetComponent<MeshFilter>().sharedMesh = heightMap.GetComponent<MeshCollider>().sharedMesh;
|
shockLayer.transform.rotation = Quaternion.Euler(90, 0, 0);
|
||||||
shockLayer.transform.localScale = Vector3.one * 1.1f;
|
|
||||||
shockLayer.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0));
|
|
||||||
}
|
|
||||||
else if (procGen != null)
|
|
||||||
{
|
|
||||||
shockLayer.GetComponent<MeshFilter>().sharedMesh = procGen.GetComponent<MeshFilter>().sharedMesh;
|
|
||||||
shockLayer.transform.localScale = Vector3.one * 1.1f;
|
|
||||||
shockLayer.transform.rotation = Quaternion.Euler(90, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return supernovaEffectController;
|
return supernovaEffectController;
|
||||||
|
|||||||
@ -476,13 +476,12 @@ namespace NewHorizons.Handlers
|
|||||||
GeometryBuilder.Make(go, sector, body.Config.Base.groundSize);
|
GeometryBuilder.Make(go, sector, body.Config.Base.groundSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject heightMap = null;
|
|
||||||
if (body.Config.HeightMap != null)
|
if (body.Config.HeightMap != null)
|
||||||
{
|
{
|
||||||
// resolution = tris on edge per face
|
// resolution = tris on edge per face
|
||||||
// divide by 4 to account for all the way around the equator
|
// divide by 4 to account for all the way around the equator
|
||||||
var res = body.Config.HeightMap.resolution / 4;
|
var res = body.Config.HeightMap.resolution / 4;
|
||||||
heightMap = HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, res, true);
|
HeightMapBuilder.Make(go, sector, body.Config.HeightMap, body.Mod, res, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject procGen = null;
|
GameObject procGen = null;
|
||||||
@ -583,7 +582,7 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null)
|
if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null)
|
||||||
{
|
{
|
||||||
SupernovaEffectBuilder.Make(go, sector, body.Config, heightMap, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor);
|
SupernovaEffectBuilder.Make(go, sector, body.Config, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return go;
|
return go;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user