Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public Vector GetBurnVector()
return new Vector(nodeRef.GetBurnVector(vesselRef.GetOrbit()));
}

public Vector GetPosition()
{
CheckNodeRef();

return new Vector(nodeRef.patch.getRelativePositionAtUT(this.UT));
}

private void updateValues()
{
// If this node is attached, and the values on the attached node have chaged, I need to reflect that
Expand Down Expand Up @@ -117,7 +124,20 @@ public override object GetSuffix(string suffixName)
if (nodeRef == null) throw new kOSException("Node must be added to flight plan first");
return nodeRef.nextPatch.PeA;
}

else if (suffixName == "APOAPSISETA")
{
if (nodeRef == null) throw new kOSException("Node must be added to flight plan first");
return nodeRef.nextPatch.timeToAp + UT - Planetarium.GetUniversalTime();
}
else if (suffixName == "PERIAPSISETA")
{
if (nodeRef == null) throw new kOSException("Node must be added to flight plan first");
return nodeRef.nextPatch.timeToPe + UT - Planetarium.GetUniversalTime();
}
else if (suffixName == "POSITION")
{
return GetPosition();
}
return base.GetSuffix(suffixName);
}

Expand Down