mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added target altitude effect to simulated fire fight
This commit is contained in:
@@ -179,7 +179,7 @@ void GroundUnit::AIloop()
|
||||
}
|
||||
}
|
||||
|
||||
double barrelElevation = r * (9.81 * dist / (2 * muzzleVelocity * muzzleVelocity) - barrelHeight / dist); /* m */
|
||||
double barrelElevation = r * (9.81 * dist / (2 * muzzleVelocity * muzzleVelocity) + (targetPosition.alt - (position.alt + barrelHeight)) / dist); /* m */
|
||||
|
||||
double lat = 0;
|
||||
double lng = 0;
|
||||
|
||||
@@ -568,7 +568,8 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
unitsManager->acquireControl(ID);
|
||||
double lat = value[L"location"][L"lat"].as_double();
|
||||
double lng = value[L"location"][L"lng"].as_double();
|
||||
Coords loc; loc.lat = lat; loc.lng = lng;
|
||||
double alt = value[L"altitude"].as_double();
|
||||
Coords loc; loc.lat = lat; loc.lng = lng; loc.alt = alt;
|
||||
Unit* unit = unitsManager->getGroupLeader(ID);
|
||||
unit->setState(State::SIMULATE_FIRE_FIGHT);
|
||||
unit->setTargetPosition(loc);
|
||||
|
||||
Reference in New Issue
Block a user