double radSlotLength = slotLengthMeters / cBodyRadius; // slot length in radians
double radSlotWidth = slotWidthMeters / cBodyRadius; // slot width in radians
VECTOR3 rotateAxis = {0, 0, -1};
for (int i = 0; i < toExpose; i++) {
VESSELSTATUS2 vs;
memset (&vs, 0, sizeof(vs));
vs.version = 2;
vs.status = 1; // landed
vs.rbody = _cBody;
// find place
bool found = false;
for (UINT x = 0; x < 10; x++) {
for (UINT y = 0; y < 10; y++) {
VECTOR3 rpos; // relative position
rpos.x = x * radSlotWidth;
rpos.y = -(y * radSlotLength);
rpos.z = 0.0;
RotateVector(rpos, rotateAxis, exposition.hdg * RAD);
VECTOR3 pos;
pos.x = exposition.lng * RAD; // exposition.lng - longitude of the first object in degrees
pos.y = exposition.lat * RAD;
pos.z = cBodyRadius;
pos += rpos;
// check if occupied
if (!occupied) {
vs.surf_lng = pos.x;
vs.surf_lat = pos.y;
reservedPositions.push_back(pos);
found = true;
}
if (found) break;
}
if (found) break;
}
if (found) {
// create the vessel
}
}