Hello!
I have a small question and I'm sorry if it was already done, but couldn't find around the exact answer:
I am compiling multistage2015 for the new beta and changing what has to be changed. In particular the 2010P1 gets to the proper orbit inclination by heading correction across ascent and it basically recalculates the azimuth each time to correct the heading. It uses GetHorizonAirspeedVector to get eastward velocity (+ earth rotation) and northward velocity in order to do the proper calculation.
for the Beta I changed the GetHorizonAirspeedVector to
Code:
VECTOR3 hspd;
GetGroundspeedVector(FRAME_HORIZON,hspd);
as I think is correct, but in 2010P1 version the final orbit inclination at burnout was very very precise, independently on orbiter configuration (non spherical gravity source activated or not etc).
In orbiter beta I keep getting an error from 2 to 10 centimals of degree at burnout, depending on launch site and target inclination (also independent on orbiter configuration).
Therefore my question is: was there any change from airspeedvector to groundspeedvector? Or is there any change relevant to latitude calculation etc?
Something else that I need to take into the count?
Thanks in advance!
Fred
---------- Post added at 19:21 ---------- Previous post was at 13:26 ----------
Sorry to bother, I just found another thing that I don't understand and maybe could be useful to be pointed out.
The very same routine for jettison/spawning of stages behaves differently from 2010P1 to the new beta, in particular relevant to the ShiftCG call.
I found it a bit difficult to explain so I post the code, if this is not the right place to do it I'm sorry
This is my jettison routine:
Code:
Spawn(type,current);
DelMesh(stage[current].msh_idh);
ClearThrusterDefinitions();
DelPropellantResource(stage[current].tank);
currentStage+=1;
UpdateMass();
UpdatePMI();
CreateUllageAndBolts();
CreateMainThruster();
CreateRCS();
ShiftCG(_V(0,0,(stage[current+1].off.z-stage[current].off.z)));
SetCameraOffset(_V(0,0,0));
And this is my spawning routine
Code:
char mn[MAXLEN];
VESSELSTATUS2 vs;
memset(&vs,0,sizeof(vs));
vs.version=2;
GetStatusEx(&vs);
VECTOR3 ofs;
VECTOR3 rofs, rvel = {vs.rvel.x, vs.rvel.y, vs.rvel.z},vrot={vs.vrot.x,vs.vrot.y,vs.vrot.z},arot={vs.arot.x,vs.arot.y,vs.arot.z};
VECTOR3 vel;
GetMeshOffset(stage[current].msh_idh,ofs);
vel =_V(stage[current].speed.x,stage[current].speed.y,stage[current].speed.z);
Local2Rel (ofs, vs.rpos);
GlobalRot(vel,rofs);
vs.rvel.x=rvel.x+rofs.x;
vs.rvel.y=rvel.y+rofs.y;
vs.rvel.z=rvel.z+rofs.z;
vs.vrot.x=vrot.x+stage[current].rot_speed.x;
vs.vrot.y=vrot.y+stage[current].rot_speed.y;
vs.vrot.z=vrot.z+stage[current].rot_speed.z;
strcpy(mn,stage[current].meshname);
oapiCreateVesselEx(mn,stage[current].module, &vs);
In orbiter Beta the spawned stage and the new stage get overlapped when this function is called, like this:
If I call ShiftMeshes manually then it works properly.
looks like if I delete a mesh, the next one is running back in the offset of the first one. Actually also if I don't call shift CG the visual looks good, but of course then engines etc are not in the correct place.
Thanks
Fred