This commit is contained in:
TerrificTrifid 2022-11-08 17:32:17 -06:00
parent d5ec0b20f3
commit 9444b49059
3 changed files with 10 additions and 3 deletions

View File

@ -86,9 +86,10 @@ namespace NewHorizons.Builder.Body
bool hasHazardVolume = !isWormHole && (pairedSingularity == null); bool hasHazardVolume = !isWormHole && (pairedSingularity == null);
Vector3 localPosition = singularity?.position == null ? Vector3.zero : singularity.position; Vector3 localPosition = singularity?.position == null ? Vector3.zero : singularity.position;
Vector3 localRotation = singularity?.rotation == null ? Vector3.zero : singularity.rotation;
GameObject newSingularity = null; GameObject newSingularity = null;
newSingularity = MakeSingularity(go, sector, localPosition, polarity, horizonRadius, distortRadius, newSingularity = MakeSingularity(go, sector, localPosition, localRotation, polarity, horizonRadius, distortRadius,
hasHazardVolume, singularity.targetStarSystem, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride); hasHazardVolume, singularity.targetStarSystem, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride);
var uniqueID = string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID; var uniqueID = string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID;
@ -132,7 +133,7 @@ namespace NewHorizons.Builder.Body
blackHoleVolume._whiteHole = whiteHoleVolume; blackHoleVolume._whiteHole = whiteHoleVolume;
} }
public static GameObject MakeSingularity(GameObject planetGO, Sector sector, Vector3 position, bool polarity, float horizon, float distort, public static GameObject MakeSingularity(GameObject planetGO, Sector sector, Vector3 position, Vector3 rotation, bool polarity, float horizon, float distort,
bool hasDestructionVolume, string targetStarSystem = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985) bool hasDestructionVolume, string targetStarSystem = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985)
{ {
InitPrefabs(); InitPrefabs();
@ -142,6 +143,7 @@ namespace NewHorizons.Builder.Body
var singularity = new GameObject(polarity ? "BlackHole" : "WhiteHole"); var singularity = new GameObject(polarity ? "BlackHole" : "WhiteHole");
singularity.transform.parent = sector?.transform ?? planetGO.transform; singularity.transform.parent = sector?.transform ?? planetGO.transform;
singularity.transform.position = planetGO.transform.TransformPoint(position); singularity.transform.position = planetGO.transform.TransformPoint(position);
singularity.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(rotation));
var singularityRenderer = MakeSingularityGraphics(singularity, polarity, horizon, distort, renderQueue); var singularityRenderer = MakeSingularityGraphics(singularity, polarity, horizon, distort, renderQueue);

View File

@ -129,7 +129,7 @@ namespace NewHorizons.Builder.Body
var blackHoleSize = progenitor.size / 100; var blackHoleSize = progenitor.size / 100;
if (proxy != null) return SingularityBuilder.MakeSingularityProxy(proxy, Vector3.zero, true, blackHoleSize, blackHoleSize * 2.5f); if (proxy != null) return SingularityBuilder.MakeSingularityProxy(proxy, Vector3.zero, true, blackHoleSize, blackHoleSize * 2.5f);
else return SingularityBuilder.MakeSingularity(planetGO, sector, Vector3.zero, true, blackHoleSize, blackHoleSize * 2.5f, true, string.Empty); else return SingularityBuilder.MakeSingularity(planetGO, sector, Vector3.zero, Vector3.zero, true, blackHoleSize, blackHoleSize * 2.5f, true, string.Empty);
} }
public static GameObject MakeProxyRemnant(GameObject planet, GameObject proxy, IModBehaviour mod, StarModule progenitor) public static GameObject MakeProxyRemnant(GameObject planet, GameObject proxy, IModBehaviour mod, StarModule progenitor)

View File

@ -35,6 +35,11 @@ namespace NewHorizons.External.Modules.VariableSize
/// </summary> /// </summary>
public MVector3 position; public MVector3 position;
/// <summary>
/// Rotation of the singularity. Determines the direction you come out of a white hole
/// </summary>
public MVector3 rotation;
/// <summary> /// <summary>
/// Radius of the singularity. Note that this isn't the same as the event horizon, but includes the entire volume that /// Radius of the singularity. Note that this isn't the same as the event horizon, but includes the entire volume that
/// has warped effects in it. /// has warped effects in it.