mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Tweaks but it works tho
This commit is contained in:
parent
b4675a5c50
commit
87d4d3ad83
@ -17,7 +17,6 @@ namespace NewHorizons.Builder.Orbital
|
|||||||
{
|
{
|
||||||
public static InitialMotion Make(GameObject body, AstroObject primaryBody, AstroObject secondaryBody, OWRigidbody OWRB, OrbitModule orbit)
|
public static InitialMotion Make(GameObject body, AstroObject primaryBody, AstroObject secondaryBody, OWRigidbody OWRB, OrbitModule orbit)
|
||||||
{
|
{
|
||||||
body.SetActive(false);
|
|
||||||
InitialMotion initialMotion = body.AddComponent<InitialMotion>();
|
InitialMotion initialMotion = body.AddComponent<InitialMotion>();
|
||||||
|
|
||||||
// This bit makes the initial motion not try to calculate the orbit velocity itself for reasons
|
// This bit makes the initial motion not try to calculate the orbit velocity itself for reasons
|
||||||
@ -76,8 +75,6 @@ namespace NewHorizons.Builder.Orbital
|
|||||||
initialMotion._initLinearSpeed = 0f;
|
initialMotion._initLinearSpeed = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.SetActive(true);
|
|
||||||
|
|
||||||
return initialMotion;
|
return initialMotion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +137,7 @@ namespace NewHorizons.Builder.Orbital
|
|||||||
);
|
);
|
||||||
|
|
||||||
// We know their velocities sum up to the total relative velocity and are related to the masses / distances
|
// We know their velocities sum up to the total relative velocity and are related to the masses / distances
|
||||||
|
// Idk where the times 2 comes from but it makes it work? Idk theres 2 planets? Makes no sense
|
||||||
var relativeVelocity = 2f * reducedOrbit.InitialVelocity;
|
var relativeVelocity = 2f * reducedOrbit.InitialVelocity;
|
||||||
var secondaryVelocity = relativeVelocity / (1f + (r1 / r2));
|
var secondaryVelocity = relativeVelocity / (1f + (r1 / r2));
|
||||||
var primaryVelocity = relativeVelocity - secondaryVelocity;
|
var primaryVelocity = relativeVelocity - secondaryVelocity;
|
||||||
|
|||||||
@ -60,9 +60,9 @@ namespace NewHorizons.Builder.Orbital
|
|||||||
|
|
||||||
orbitLine._astroObject = astroobject;
|
orbitLine._astroObject = astroobject;
|
||||||
orbitLine._fade = fade;
|
orbitLine._fade = fade;
|
||||||
orbitLine._lineWidth = 0.3f;
|
orbitLine._lineWidth = 1f;
|
||||||
|
|
||||||
orbitLine.InitializeLineRenderer();
|
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(orbitLine.InitializeLineRenderer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,9 +17,10 @@ namespace NewHorizons.Components.Orbital
|
|||||||
|
|
||||||
public GameObject FakeMassBody { get; set; }
|
public GameObject FakeMassBody { get; set; }
|
||||||
|
|
||||||
void Awake()
|
void Start()
|
||||||
{
|
{
|
||||||
FakeMassBody.SetActive(true);
|
// Make sure its active but maybe it hasn't been set yet
|
||||||
|
if(FakeMassBody) FakeMassBody.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user