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


C# Vessel.CriticalHeatPart方法代码示例

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


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

示例1: UpdateMap

 public void UpdateMap(Vessel vessel)
 {
     double yScale;
     if (vessel.mainBody.atmosphere)
         yScale = vessel.mainBody.atmosphereDepth;
     else
         yScale = turner.DestinationHeight * 1000;
     double MetersPerPixel = yScale / texture.height;
     double x = turner.HorizontalDistance / MetersPerPixel % texture.width;
     double y = vessel.altitude / MetersPerPixel % texture.height;
     float red = (float)(vessel.CriticalHeatPart().CriticalHeat());
     float green = (float)turner.vesselState.drag / 5;
     float blue = (float)(turner.vesselState.thrustCurrent / turner.MaxThrust);
     texture.SetPixel((int)x, (int)y, new Color(red, green, blue));
     texture.Apply();
 }
开发者ID:johnfink8,项目名称:GravityTurn,代码行数:16,代码来源:FlightMap.cs

示例2: CalculateLosses

        void CalculateLosses(Vessel vessel)
        {
            double fwdAcceleration = Vector3d.Dot(vessel.acceleration, vesselState.forward.normalized);
            double GravityDrag = Vector3d.Dot(vesselState.gravityForce, -vessel.obt_velocity.normalized);
            double TimeInterval = Time.time - FlyTimeInterval;
            FlyTimeInterval = Time.time;
            HorizontalDistance += Vector3d.Exclude(vesselState.up, vesselState.orbitalVelocity).magnitude * TimeInterval;
            VelocityLost += ((vesselState.thrustCurrent / vesselState.mass) - fwdAcceleration) * TimeInterval;
            DragLoss += vesselState.drag * TimeInterval;
            GravityDragLoss += GravityDrag * TimeInterval;
            double VectorDrag = vesselState.thrustCurrent - Vector3d.Dot(vesselState.thrustVectorLastFrame, vessel.obt_velocity.normalized);
            VectorDrag = VectorDrag / vesselState.mass;
            VectorLoss += VectorDrag * TimeInterval;
            TotalBurn += vesselState.thrustCurrent / vesselState.mass * TimeInterval;
            double GravityDragLossAtAp = GravityDragLoss + vessel.obt_velocity.magnitude - vessel.orbit.getOrbitalVelocityAtUT(vessel.orbit.timeToAp + Planetarium.GetUniversalTime()).magnitude;
            TotalLoss = DragLoss + GravityDragLossAtAp + VectorLoss;
            if (vessel.CriticalHeatPart().CriticalHeat() > MaxHeat)
                MaxHeat = vessel.CriticalHeatPart().CriticalHeat();
            launchdb.RecordLaunch();
            Message = string.Format(
@"Air Drag: {0:0.00}m/s²
GravityDrag: {1:0.00}m/s²
Thrust Vector Drag: {5:0.00}m/s²
Air Drag Loss: {2:0.00}m/s
Gravity Drag Loss: {3:0.00} -> {4:0.00}m/s (at AP)
Total Vector Loss: {6:0.00}m/s
Total Loss: {7:0.00}m/s
Total Burn: {8:0.0}",
                vesselState.drag,
                GravityDrag,
                DragLoss,
                GravityDragLoss, GravityDragLossAtAp,
                VectorDrag,
                VectorLoss,
                DragLoss + GravityDragLossAtAp + VectorLoss,
                TotalBurn
                );
        }
开发者ID:johnfink8,项目名称:GravityTurn,代码行数:38,代码来源:GravityTurner.cs


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