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


C# TimeSpan.ToUnixStyleTime方法代码示例

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


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

示例1: GetPositionAtUT

 /// <summary>
 ///   Get the position of this thing in this orbit at the given
 ///   time.  Note that it does NOT take into account any
 ///   encounters or manuever nodes - it assumes the current
 ///   orbit patch remains followed forever.
 /// </summary>
 /// <param name="timeStamp">The universal time to query for</param>
 /// <returns></returns>
 public Vector GetPositionAtUT( TimeSpan timeStamp )
 {
     return new Vector( orbit.getPositionAtUT( timeStamp.ToUnixStyleTime() ) - shared.Vessel.GetWorldPos3D() );
 }
开发者ID:kevin-ye,项目名称:KOS,代码行数:12,代码来源:OrbitInfo.cs

示例2: GetVelocityAtUT

 /// <summary>
 ///   Get the velocity pairing of this thing in this orbit at the given
 ///   time.  Note that it does NOT take into account any
 ///   encounters or manuever nodes - it assumes the current
 ///   orbit patch remains followed forever.
 /// </summary>
 /// <param name="timeStamp">The universal time to query for</param>
 /// <returns></returns>
 public OrbitableVelocity GetVelocityAtUT( TimeSpan timeStamp )
 {
     var orbVel = new Vector( orbit.getOrbitalVelocityAtUT( timeStamp.ToUnixStyleTime() ) );
     // For some weird reason orbit returns velocities with Y and Z swapped, so flip them back:
     orbVel = new Vector( orbVel.X, orbVel.Z, orbVel.Y );
     CelestialBody parent = orbit.referenceBody;
     Vector surfVel;
     if (parent != null)
     {
         Vector3d pos = GetPositionAtUT( timeStamp ).ToVector3D();
         surfVel = new Vector( orbVel - parent.getRFrmVel( pos + shared.Vessel.GetWorldPos3D()) );
     }
     else
         surfVel = new Vector( orbVel.X, orbVel.Y, orbVel.Z );
     return new OrbitableVelocity( orbVel, surfVel );
 }
开发者ID:kevin-ye,项目名称:KOS,代码行数:24,代码来源:OrbitInfo.cs


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