I am trying the moving dock capture.
case OAPI_KEY_L:
{
RevertDockingRing();
DoIDARing();
//case OAPI_KEY_B: // deploy/retract speedbrake
// if (!Playback()) RevertSpeedbrake();
return 1;
}
void Atlantis::DoIDARing()
{
VECTOR3 new_dock_pos = SHUTTLE_DOCKPOS;
new_dock_pos.y += (soft_capture_ring_proc * 0.4);//0.45
OBJHANDLE v = GetHandle();
int idx = 0; // dock index
OBJHANDLE docked_ship = GetDockStatus(GetDockHandle(0)); // object handle of docked vessel
if (docked_ship != NULL) // make sure handle is valid, if it is...
{
VESSEL* docked = oapiGetVesselInterface(docked_ship); // get VESSEL interface for docked vessel
int dcount = docked->DockCount(); // get number of docking ports
for (int i = 0; i < dcount; i++) // Cycle through ports
{
if (docked->GetDockStatus(docked->GetDockHandle(i)) == GetHandle())
{
idx = i;
docked->Undock(idx, 0);
SetDockParams(hDockODS1, new_dock_pos, SHUTTLE_DOCKDIR, SHUTTLE_DOCKROT);
docked->Dock(v, idx, 0, 0);
}
}
}
else {
SetDockParams(hDockODS1, new_dock_pos, SHUTTLE_DOCKDIR, SHUTTLE_DOCKROT);
}
}
animation which moves the docking ring
//dockring
if (ODS == 1) {//ODS is present
if (DOCKRING_status >= HATCH_RAISING) {
double da = simdt * .1;
if (DOCKRING_status == HATCH_RAISING) {
if (soft_capture_ring_proc > 0.0) soft_capture_ring_proc = max(0.0, soft_capture_ring_proc - da);
else DOCKRING_status = HATCH_UP;
}
else {
if (soft_capture_ring_proc < 1.0) soft_capture_ring_proc = min(1.0, soft_capture_ring_proc + da);
else DOCKRING_status = HATCH_DOWN;
}
SetAnimation(anim_DOCKRING, soft_capture_ring_proc);
}
}
I got to figure out the animation on the ODS ring. But now docked with the HD ISS. when I retract the ring the shuttle moves also