Example #1
0
 public OrbitableVelocity(CelestialBody b, SharedObjects shared)
 {
     Orbital = new Vector(b.KOSExtensionGetObtVelocity(shared)); // KSP's b.GetObtVelocity() is broken - it causes stack overflow
     CelestialBody parent = b.KOSExtensionGetParentBody();
     Surface = (parent != null) ?
         new Vector(b.orbit.GetVel() - parent.getRFrmVel(b.position)) :
         new Vector(Orbital); // return same velocity as orbit when no parent body to compare against.
     InitializeSuffixes();
 }
Example #2
0
 public OrbitableVelocity(CelestialBody b, SharedObjects shared)
 {
     Orbital = new Vector(b.KOSExtensionGetObtVelocity(shared)); // KSP's b.GetObtVelocity() is broken - it causes stack overflow
     CelestialBody parent = b.KOSExtensionGetParentBody();
     Surface = (parent != null) ?
         new Vector(b.orbit.GetVel() - parent.getRFrmVel(b.position)) :
         new Vector(Vector3d.zero);
     InitializeSuffixes();
 }
Example #3
0
        public OrbitableVelocity(CelestialBody b, SharedObjects shared)
        {
            Orbital = new Vector(b.KOSExtensionGetObtVelocity(shared)); // KSP's b.GetObtVelocity() is broken - it causes stack overflow
            CelestialBody parent = b.KOSExtensionGetParentBody();

            Surface = (parent != null) ?
                      new Vector(b.orbit.GetVel() - parent.getRFrmVel(b.position)) :
                      new Vector(Vector3d.zero);
            InitializeSuffixes();
        }
        public OrbitableVelocity(CelestialBody b, SharedObjects shared)
        {
            Orbital = new Vector(b.KOSExtensionGetObtVelocity(shared)); // KSP's b.GetObtVelocity() is broken - it causes stack overflow
            CelestialBody parent = b.KOSExtensionGetParentBody();

            Surface = (parent != null) ?
                      new Vector(b.orbit.GetVel() - parent.getRFrmVel(b.position)) :
                      new Vector(Orbital); // return same velocity as orbit when no parent body to compare against.
            InitializeSuffixes();
        }