Hello,
I am developing the ground release code for UCSO. I am using this code:
The orientation should be the same as the parent vessel orientation, but this isn't the case:
Scenario parameters:
You can see the difference in the orientation and altitude. If I copied the orientation and the altitude from the parent to the cargo, it appears correctly. How to do that in code?
I am developing the ground release code for UCSO. I am using this code:
Code:
if (vessel->GetFlightStatus() & 1) {
VESSELSTATUS2 status;
memset(&status, 0, sizeof(status));
status.version = 2;
vessel->GetStatusEx(&status);
double longitude, latitude, radius;
vessel->GetEquPos(longitude, latitude, radius);
double angularDistance = releaseDistance / radius;
double trueCourse = 180 * (PI / 180);
double releaseLatitude = asin(sin(latitude) * cos(angularDistance) + cos(latitude) * sin(angularDistance) * cos(trueCourse));
double dLongitude = atan2(sin(trueCourse) * sin(angularDistance) * cos(latitude),
cos(angularDistance) - sin(latitude) * sin(releaseLatitude));
double releaseLongitude = fmod(longitude + dLongitude + PI, 2 * PI) - PI;
status.surf_lng = releaseLongitude;
status.surf_lat = releaseLatitude;
if (vessel->DetachChild(attachsMap[pair.first], 0.0)) {
cargo->DefSetStateEx(&status);
if (isTotalMassGet) totalCargoMass -= cargo->GetMass();
cargoReleased = true;
}
else cargoReleased = false;
}
The orientation should be the same as the parent vessel orientation, but this isn't the case:

Scenario parameters:
Code:
ShuttlePB:ShuttlePB_UCSO ;Parent vessel
STATUS Landed Earth
POS -80.6758980 28.5227620
HEADING 109.16
[COLOR="Red"]ALT 1.287[/COLOR]
[COLOR="Red"]AROT -86.168 -72.488 146.453[/COLOR]
AFCMODE 7
PRPLEVEL 0:1.000000
NAVFREQ 0 0
END
ShuttlePB1:ShuttlePB_UCSO ;Cargo
STATUS Landed Earth
POS -80.6758980 28.5227170
HEADING 109.16
[COLOR="Red"]ALT 0.000[/COLOR]
[COLOR="Red"]AROT -54.479 -64.756 112.835[/COLOR]
AFCMODE 7
PRPLEVEL 0:1.000000
NAVFREQ 0 0
END
You can see the difference in the orientation and altitude. If I copied the orientation and the altitude from the parent to the cargo, it appears correctly. How to do that in code?
Last edited: