From 75f6e410f52c5887375544197b4ffca4645711d0 Mon Sep 17 00:00:00 2001 From: Andrey Borunov Date: Mon, 20 Jun 2016 19:15:51 +0300 Subject: [PATCH] orbitalkiller: minor changes --- .../orbitalkiller/OrbitDataUpdater.scala | 4 ++-- .../orbitalkiller/OrbitalKiller.scala | 22 +++++++++++++------ .../elements/PlanetsInfluenceInfo.scala | 8 +++---- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitDataUpdater.scala b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitDataUpdater.scala index df8dbf1..6c7ca22 100644 --- a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitDataUpdater.scala +++ b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitDataUpdater.scala @@ -126,13 +126,13 @@ object OrbitDataUpdater { drawSlidingLines(yy, orbit_color) } - drawLine(new_o.f*scale, new_o.center*scale, GRAY) + /*drawLine(new_o.f*scale, new_o.center*scale, GRAY) if(_stop_after_number_of_tacts > 0) { val p = new_o.orbitalPointAfterTime(bs.coord, (_stop_after_number_of_tacts * base_dt * 1000).toLong, ccw) drawLine(p*scale, (p + (new_o.center - new_o.f).perpendicular*math.signum(p*(new_o.center - new_o.f)))*scale, GRAY) val p2 = new_o.orbitalPointByTrueAnomalyRad(_stop_in_orbit_true_anomaly) drawLine(p2*scale, (p2 + (new_o.center - new_o.f).perpendicular*math.signum(p*(new_o.center - new_o.f)))*scale, GRAY) - } + }*/ if(InterfaceHolder.namesSwitcher.showNames) { diff --git a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitalKiller.scala b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitalKiller.scala index a77b6e5..391144c 100644 --- a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitalKiller.scala +++ b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/OrbitalKiller.scala @@ -263,8 +263,8 @@ object OrbitalKiller extends ScageScreenAppDMT("Orbital Killer", property("scree //val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, -30000, earth.coord, earth.linearVelocity, earth.mass, G) // на круговой орбите в 200 км от поверхности Земли - val ship_start_position = earth.coord + DVec(-100, earth.radius + 199000) - val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true).n*18760/** 1.15 */ + //val ship_start_position = earth.coord + DVec(-100, earth.radius + 199000) + //val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true).n*18760/** 1.15 */ //val ship_start_position = earth.coord + DVec(-100, earth.radius + 198000) //val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, earth.coord, earth.linearVelocity, earth.mass, G, ccw = false) @@ -278,14 +278,22 @@ object OrbitalKiller extends ScageScreenAppDMT("Orbital Killer", property("scree //val ship_init_velocity = -escapeVelocity(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true)*1.01 // на орбите в 1000 км от поверхности Луны - //val ship_start_position = moon.coord + DVec(0, moon.radius + 100000) - //val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, moon.coord, moon.linearVelocity, moon.mass, G, ccw = false)//satelliteSpeed(ship_start_position, moon.coord, moon.linearVelocity, moon.mass, G, counterclockwise = false) + val ship_start_position = moon.coord + DVec(0, moon.radius + 100000) + val ship_init_velocity = speedToHaveOrbitWithParams(ship_start_position, 900000, moon.coord, moon.linearVelocity, moon.mass, G, ccw = true)//satelliteSpeed(ship_start_position, moon.coord, moon.linearVelocity, moon.mass, G, counterclockwise = false) //val ship_init_velocity = satelliteSpeed(ship_start_position, earth.coord, earth.linearVelocity, earth.mass, G, counterclockwise = true)*1.15 + // на гиперболической орбите Земли, приближаемся к перицентру, летим по часовой стрелке + //val ship_start_position = DVec(-6.2797933836710215E7, -1.2455588349688923E8) + earth.coord + //val ship_init_velocity = DVec(30521.418357148767,2855.1265848825283) + + // на гиперболической орбите Земли, приближаемся к перицентру, летим против часовой стрелки + //val ship_start_position = DVec(9.594617648145294E7, -8.919468846308415E7) + earth.coord + //val ship_init_velocity = DVec(28167.17922375556,2692.468259455251) + val player_ship = new Ship4(ScageId.nextId, - init_coord = DVec(9.594617648145294E7, -8.919468846308415E7)+earth.coord,//DVec(-6.2797933836710215E7, -1.2455588349688923E8)+earth.coord,//ship_start_position, - init_velocity = DVec(28167.17922375556,2692.468259455251),//DVec(30521.418357148767,2855.1265848825283),//ship_init_velocity, - init_rotation = 214.7977970092611//164.6850289440855//90 + init_coord = ship_start_position, + init_velocity = ship_init_velocity, + init_rotation = 90 ) // на круговой орбите в 200 км от поверхности Земли diff --git a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/interface/elements/PlanetsInfluenceInfo.scala b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/interface/elements/PlanetsInfluenceInfo.scala index 0a75076..8002c9b 100644 --- a/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/interface/elements/PlanetsInfluenceInfo.scala +++ b/orbitalkiller/src/main/scala/com/github/dunnololda/scageprojects/orbitalkiller/interface/elements/PlanetsInfluenceInfo.scala @@ -10,10 +10,10 @@ class PlanetsInfluenceInfo extends InterfaceElement { val sun_force = gravityForce(sun.coord, sun.mass, player_ship.coord, player_ship.mass, G).norma val earth_force = gravityForce(earth.coord, earth.mass, player_ship.coord, player_ship.mass, G).norma val moon_force = gravityForce(moon.coord, moon.mass, player_ship.coord, player_ship.mass, G).norma - val all = sun_force + earth_force + moon_force - val sun_influence_str = f"${sun.name} ${sun_force / all * 100}%.2f%%" - val earth_influence_str = f"${earth.name} ${earth_force / all * 100}%.2f%%" - val moon_influence_str = f"${moon.name} ${moon_force / all * 100}%.2f%%" + val sum_force = sun_force + earth_force + moon_force + val sun_influence_str = f"${sun.name} ${sun_force / sum_force * 100}%.2f%%" + val earth_influence_str = f"${earth.name} ${earth_force / sum_force * 100}%.2f%%" + val moon_influence_str = f"${moon.name} ${moon_force / sum_force * 100}%.2f%%" strings(0) = f"Влияние небесных тел $sun_influence_str $earth_influence_str $moon_influence_str" }