当前位置: 首页>>代码示例>>C#>>正文


C# CelestialBody.SetOrbit方法代码示例

本文整理汇总了C#中CelestialBody.SetOrbit方法的典型用法代码示例。如果您正苦于以下问题:C# CelestialBody.SetOrbit方法的具体用法?C# CelestialBody.SetOrbit怎么用?C# CelestialBody.SetOrbit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CelestialBody的用法示例。


在下文中一共展示了CelestialBody.SetOrbit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyTo

            public void CopyTo(CelestialBody body, bool setOrbit)
            {
                body.GeeASL = GeeASL;
                body.ocean = ocean;
                body.atmosphere = atmosphere;
                body.atmosphereContainsOxygen = atmosphereContainsOxygen;
                body.atmosphereDepth = atmosphereDepth;
                body.atmosphereTemperatureSeaLevel = atmosphereTemperatureSeaLevel;
                body.atmospherePressureSeaLevel = atmospherePressureSeaLevel;
                body.atmosphereMolarMass = atmosphereMolarMass;
                body.atmosphereAdiabaticIndex = atmosphereAdiabaticIndex;
                body.rotates = rotates;
                body.rotationPeriod = rotationPeriod;
                body.initialRotation = initialRotation;
                body.tidallyLocked = tidallyLocked;

                if (setOrbit && body.orbitDriver != null && orbit != null)
                    body.SetOrbit(orbit);

                body.RealCbUpdate();

                Extensions.Log($"Set body \"{body.bodyName}\"'s parameters to:\n{GetConfig(body)}");
            }
开发者ID:Kerbas-ad-astra,项目名称:HyperEdit,代码行数:23,代码来源:PlanetEditor.cs

示例2: ApplyConfig

            public static void ApplyConfig(ConfigNode node, CelestialBody body)
            {
                node.TryGetValue("GeeASL", ref body.GeeASL, double.TryParse);
                node.TryGetValue("ocean", ref body.ocean, bool.TryParse);
                node.TryGetValue("atmosphere", ref body.atmosphere, bool.TryParse);
                node.TryGetValue("atmosphereContainsOxygen", ref body.atmosphereContainsOxygen, bool.TryParse);
                node.TryGetValue("atmosphereDepth", ref body.atmosphereDepth, double.TryParse);
                node.TryGetValue("atmosphereTemperatureSeaLevel", ref body.atmosphereTemperatureSeaLevel, double.TryParse);
                node.TryGetValue("atmospherePressureSeaLevel", ref body.atmospherePressureSeaLevel, double.TryParse);
                node.TryGetValue("atmosphereMolarMass", ref body.atmosphereMolarMass, double.TryParse);
                node.TryGetValue("atmosphereAdiabaticIndex", ref body.atmosphereAdiabaticIndex, double.TryParse);
                node.TryGetValue("rotates", ref body.rotates, bool.TryParse);
                node.TryGetValue("rotationPeriod", ref body.rotationPeriod, double.TryParse);
                node.TryGetValue("initialRotation", ref body.initialRotation, double.TryParse);
                node.TryGetValue("tidallyLocked", ref body.tidallyLocked, bool.TryParse);

                if (body.orbitDriver != null)
                {
                    var orbit = body.orbitDriver.orbit.Clone();
                    node.TryGetValue("inclination", ref orbit.inclination, double.TryParse);
                    node.TryGetValue("eccentricity", ref orbit.eccentricity, double.TryParse);
                    node.TryGetValue("semiMajorAxis", ref orbit.semiMajorAxis, double.TryParse);
                    node.TryGetValue("LAN", ref orbit.LAN, double.TryParse);
                    node.TryGetValue("argumentOfPeriapsis", ref orbit.argumentOfPeriapsis, double.TryParse);
                    node.TryGetValue("meanAnomalyAtEpoch", ref orbit.meanAnomalyAtEpoch, double.TryParse);
                    node.TryGetValue("orbitEpoch", ref orbit.epoch, double.TryParse);
                    node.TryGetValue("orbitBody", ref orbit.referenceBody, Extensions.CbTryParse);
                    body.SetOrbit(orbit);
                }

                body.RealCbUpdate();

                Extensions.Log($"Set body \"{body.bodyName}\"'s parameters to:\n{GetConfig(body)}");
            }
开发者ID:Kerbas-ad-astra,项目名称:HyperEdit,代码行数:34,代码来源:PlanetEditor.cs


注:本文中的CelestialBody.SetOrbit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。