- Joined
- Feb 2, 2012
- Messages
- 1,667
- Reaction score
- 115
- Points
- 78
Hi there,
I'm trying to create via API a vessel that should be landed and upright as soon as it's created, but with the new touchdown points it seems I can't make it.
The vessel appears landed in place but randomly rotated, not upright. To turn it upright I need to create it up above the ground level, let it fall and wait for it to IDLE.
Since the vessel from which it gets the vessel status is upright I don't understand why this information is not passed.
The following code is what I'm using, it's in clbkPostCreation.
Thanks in advance
I'm trying to create via API a vessel that should be landed and upright as soon as it's created, but with the new touchdown points it seems I can't make it.
The vessel appears landed in place but randomly rotated, not upright. To turn it upright I need to create it up above the ground level, let it fall and wait for it to IDLE.
Since the vessel from which it gets the vessel status is upright I don't understand why this information is not passed.
The following code is what I'm using, it's in clbkPostCreation.
Thanks in advance
Code:
VESSELSTATUS2 vsramp;
memset(&vsramp,0,sizeof(vsramp));
vsramp.version=2;
GetStatusEx(&vsramp);
OBJHANDLE hramp= oapiCreateVesselEx("EmptyMod","EmptyModule",&vsramp);
VESSEL3 *vramp;
vramp = (VESSEL3*)oapiGetVesselInterface(hramp);
vramp->SetEmptyMass(1000);
TOUCHDOWNVTX td[3];
for(int i=0;i<3;i++)
{
td[i].damping=3e5;
td[i].mu=3;
td[i].mu_lng=3;
td[i].stiffness=3e5;
}
td[0].pos.x=-1;
td[0].pos.y=-1;
td[0].pos.z=0;
td[1].pos.x=0;
td[1].pos.y=1;
td[1].pos.z=0;
td[2].pos.x=1;
td[2].pos.y=-1;
td[2].pos.z=0;
vsramp.status=1;
vramp->SetTouchdownPoints(td,3);
vramp->clbkSetStateEx(&vsramp);
