Example #1
0
        private ScalarValue TrueAnomalyAtEqDN(Orbitable obt)
        {
            Vector3d vectorToAN = Vector3d.Cross(obt.Orbit.referenceBody.transform.up, SwappedOrbitNormal(obt.Orbit));
            double   ta         = TrueAnomalyFromVector(obt.Orbit, vectorToAN);

            return(ClampAngle360(ta + 180));
        }
Example #2
0
 private ScalarValue RelativeInclination(Orbitable obt, Orbitable tgt)
 {
     if (ReferenceEquals(tgt, null))
     {
         throw new ArgumentNullException();
     }
     return(FinePrint.Utilities.OrbitUtilities.GetRelativeInclination(obt.Orbit, tgt.Orbit));
 }
    public override void OnInspectorGUI()
    {
        Orbitable t = target as Orbitable;

        //Draw if has not been done yet
        if (t.trajectory == null)
        {
            t.UpdateTrajectory();
            t.MoveToStart();
        }

        EditorGUI.BeginChangeCheck();
        base.OnInspectorGUI();
        if (EditorGUI.EndChangeCheck())
        {
            t.UpdateTrajectory();
            t.MoveToStart();
        }
    }
Example #4
0
 public OrbitInfo(Orbitable orb, SharedObjects sharedObj)
 {
     orbit = orb.Orbit;
     shared = sharedObj;
     name = orb.GetName();
 }
Example #5
0
    // -------------------------------------------------------------------------------

    public void FollowLinkedOrbitable(Orbitable linkedOrbitable)
    {
        var linkedToCenter = (mCenterOfTheUniverse - linkedOrbitable.transform.position).normalized;

        transform.position = mCenterOfTheUniverse + (linkedToCenter * OrbitDistance);
    }
Example #6
0
 public override void AddCelestialObject(Orbitable child)
 {
     _parent.AddCelestialObject(child);
 }
Example #7
0
 private ScalarValue TrueAnomalyAtDN(Orbitable obt, Orbitable tgt)
 {
     return(ClampAngle180(FinePrint.Utilities.OrbitUtilities.AngleOfDescendingNode(obt.Orbit, tgt.Orbit)));
 }
Example #8
0
        private ScalarValue TrueAnomalyAtEqAN(Orbitable obt)
        {
            Vector3d vectorToAN = Vector3d.Cross(obt.Orbit.referenceBody.transform.up, SwappedOrbitNormal(obt.Orbit));

            return(TrueAnomalyFromVector(obt.Orbit, vectorToAN));
        }
Example #9
0
 private ScalarValue EccentricAnomalyAtUT(Orbitable obt, ScalarValue ut)
 {
     return(RadToDeg(obt.Orbit.EccentricAnomalyAtUT(ut)));
 }
Example #10
0
 private ScalarValue UTAtTrueAnomaly(Orbitable obt, ScalarValue trueAnomaly)
 {
     return(obt.Orbit.GetUTforTrueAnomaly(DegToRad(trueAnomaly), 0));
 }
Example #11
0
 private ScalarValue TrueAnomalyAtUT(Orbitable obt, ScalarValue ut)
 {
     return(RadToDeg(obt.Orbit.TrueAnomalyAtUT(ut)));
 }
Example #12
0
 private ScalarValue TrueAnomalyAtRadius(Orbitable obt, ScalarValue radius)
 {
     return(RadToDeg(obt.Orbit.TrueAnomalyAtRadius(radius)));
 }
Example #13
0
 private ScalarValue RadiusAtTrueAnomaly(Orbitable obt, ScalarValue trueAnomaly)
 {
     return(obt.Orbit.RadiusAtTrueAnomaly(DegToRad(trueAnomaly)));
 }
Example #14
0
        private ScalarValue MeanAnomalyAtUT(Orbitable obt, ScalarValue ut)
        {
            var percent = obt.Orbit.getObtAtUT(ut) / shared.Vessel.orbit.period;

            return(RadToDeg(percent * (2 * Math.PI)));
        }
Example #15
0
 public OrbitInfo(Orbitable orb, SharedObjects sharedObj)
 {
     orbit  = orb.Orbit;
     shared = sharedObj;
     name   = orb.GetName();
 }