- Joined
- Feb 2, 2012
- Messages
- 1,667
- Reaction score
- 104
- Points
- 78
Hi all,
I think this question could be only for Martin, but if anyone can help of course is much appreciated.
I'm trying to crete and manage landed vessels and vehicles.
In the past in order to properly handle this I used a very bad trick, that worked, which consisted in basically parsing a false scenario file, and let orbiter compute properly landed situtation for the vessel, calling clbkloadstateex and defsetstateex.
Now I want to get out of this, and I'm building the proper rotation matrixes for the vessels, plug the values into the arot part of the Vesselstatus2, and everything runs smoothly.
Except for one point: distance from the ground, which in scenario file is represented by the "ALT" line
When I update the status of a landed vessel without specifying the alt status anyhow I get the vessel's center of mass at ground level.
But it seems that I can't set the alt parameter in a vesselstatus2, since landed vessels will get just the Arot vector, and then latitude, longitude and heading.
I tried to modify the rpos parameter but nothing happened, seems like it is ignored.
Then I tried to give to orbiter this:
and to my surprise it worked! So it seems there is something behind the ALT line that is considered within the defsetstate that I cannot access. Is that right? is this the only way to do it?
Thanks in advance
Fred
---------- Post added 2nd Jun 2017 at 19:22 ---------- Previous post was 1st Jun 2017 at 23:33 ----------
I think this question could be only for Martin, but if anyone can help of course is much appreciated.
I'm trying to crete and manage landed vessels and vehicles.
In the past in order to properly handle this I used a very bad trick, that worked, which consisted in basically parsing a false scenario file, and let orbiter compute properly landed situtation for the vessel, calling clbkloadstateex and defsetstateex.
Now I want to get out of this, and I'm building the proper rotation matrixes for the vessels, plug the values into the arot part of the Vesselstatus2, and everything runs smoothly.
Except for one point: distance from the ground, which in scenario file is represented by the "ALT" line
When I update the status of a landed vessel without specifying the alt status anyhow I get the vessel's center of mass at ground level.
But it seems that I can't set the alt parameter in a vesselstatus2, since landed vessels will get just the Arot vector, and then latitude, longitude and heading.
I tried to modify the rpos parameter but nothing happened, seems like it is ignored.
Then I tried to give to orbiter this:
Code:
char line[52];
sprintf(line, "ALT 10");
ParseScenarioLineEx(line, &vs2);
DefSetStateEx(&vs2);
and to my surprise it worked! So it seems there is something behind the ALT line that is considered within the defsetstate that I cannot access. Is that right? is this the only way to do it?
Thanks in advance
Fred
---------- Post added 2nd Jun 2017 at 19:22 ---------- Previous post was 1st Jun 2017 at 23:33 ----------