本文整理汇总了C#中CelestialBody.GetOrbitDriver方法的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody.GetOrbitDriver方法的具体用法?C# CelestialBody.GetOrbitDriver怎么用?C# CelestialBody.GetOrbitDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CelestialBody
的用法示例。
在下文中一共展示了CelestialBody.GetOrbitDriver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadCB
//.........这里部分代码省略.........
/*if (node.HasValue("axialTilt"))
{
if (!body.inverseRotation && double.TryParse(node.GetValue("axialTilt"), out dtmp))
{
CBRotationFixer.CBRotations.Add(body.name, new CBRotation(body.name, dtmp, body.rotationPeriod, body.initialRotation));
body.rotationPeriod = 0;
}
}*/
yield return null;
#region CBOrbit
ConfigNode onode = node.GetNode("Orbit");
if (body.orbitDriver != null && body.orbit != null && onode != null)
{
if (loadInfo.useEpoch)
body.orbit.epoch = loadInfo.epoch;
onode.TryGetValue("semiMajorAxis", ref body.orbit.semiMajorAxis);
onode.TryGetValue("eccentricity", ref body.orbit.eccentricity);
onode.TryGetValue("meanAnomalyAtEpoch", ref body.orbit.meanAnomalyAtEpoch);
if (onode.TryGetValue("meanAnomalyAtEpochD", ref body.orbit.meanAnomalyAtEpoch))
body.orbit.meanAnomalyAtEpoch *= DEG2RAD;
onode.TryGetValue("inclination", ref body.orbit.inclination);
onode.TryGetValue("period", ref body.orbit.period);
onode.TryGetValue("LAN", ref body.orbit.LAN);
onode.TryGetValue("argumentOfPeriapsis", ref body.orbit.argumentOfPeriapsis);
if (onode.HasValue("orbitColor"))
{
try
{
Vector4 col = KSPUtil.ParseVector4(onode.GetValue("orbitColor"));
Color c = new Color(col.x, col.y, col.z, col.w);
body.GetOrbitDriver().orbitColor = c;
}
catch (Exception e)
{
print("*RSS* Error parsing as color4: original text: " + onode.GetValue("orbitColor") + " --- exception " + e.Message);
}
}
string bodyname = "";
if (onode.TryGetValue("referenceBody", ref bodyname))
{
if (body.orbit.referenceBody == null || !body.orbit.referenceBody.Equals(bodyname))
{
foreach (CelestialBody b in FlightGlobals.Bodies)
{
if (b.name.Equals(bodyname))
{
if (body.orbit.referenceBody)
{
body.orbit.referenceBody.orbitingBodies.Remove(body);
}
b.orbitingBodies.Add(body);
body.orbit.referenceBody = b;
break;
}
}
}
}
}
yield return null;
// SOI and HillSphere done at end
body.CBUpdate();
#endregion
#endregion