mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Rotation
This commit is contained in:
parent
d5ec0b20f3
commit
9444b49059
@ -86,9 +86,10 @@ namespace NewHorizons.Builder.Body
|
||||
bool hasHazardVolume = !isWormHole && (pairedSingularity == null);
|
||||
|
||||
Vector3 localPosition = singularity?.position == null ? Vector3.zero : singularity.position;
|
||||
Vector3 localRotation = singularity?.rotation == null ? Vector3.zero : singularity.rotation;
|
||||
|
||||
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);
|
||||
|
||||
var uniqueID = string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID;
|
||||
@ -132,7 +133,7 @@ namespace NewHorizons.Builder.Body
|
||||
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)
|
||||
{
|
||||
InitPrefabs();
|
||||
@ -142,6 +143,7 @@ namespace NewHorizons.Builder.Body
|
||||
var singularity = new GameObject(polarity ? "BlackHole" : "WhiteHole");
|
||||
singularity.transform.parent = sector?.transform ?? planetGO.transform;
|
||||
singularity.transform.position = planetGO.transform.TransformPoint(position);
|
||||
singularity.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(rotation));
|
||||
|
||||
var singularityRenderer = MakeSingularityGraphics(singularity, polarity, horizon, distort, renderQueue);
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ namespace NewHorizons.Builder.Body
|
||||
var blackHoleSize = progenitor.size / 100;
|
||||
|
||||
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)
|
||||
|
||||
@ -35,6 +35,11 @@ namespace NewHorizons.External.Modules.VariableSize
|
||||
/// </summary>
|
||||
public MVector3 position;
|
||||
|
||||
/// <summary>
|
||||
/// Rotation of the singularity. Determines the direction you come out of a white hole
|
||||
/// </summary>
|
||||
public MVector3 rotation;
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user