So weird. I get the rover attachment point to tilt. Then it is just suppose to to translate. It does but the rover is rotating also.
if (deploystage>0 )SetAttachmentParams(LNDR, ROVERPOS, ROVERDIR,ROVERROT); if deploying then move attachment
if (deploystage == 1)//move along z axis
{
ROVERPOS.z = (ROVERPOS.z + dc);//z axis
if (ROVERPOS.z > .4) {
ROVERPOS.z = .4;
deploystage = 2;
}
}
if (deploystage == 2)//tilt down
{
sprintf(oapiDebugString(), "angle %2.2f step %d dir.y %3.4f dir.z %3.4f ROT.y %3.4f ROT.z %3.4f ", angle,deploystage,ROVERDIR.y, ROVERDIR.z, ROVERROT.y, ROVERROT.z);
angle = angle + df;
if (angle > .1) angle = .1;
ROVERROT = _V(0, sin((angle) / 180 * PI), -cos((angle) / 180 * PI));
ROVERDIR = _V(0, cos((angle) / 180 * PI), -sin((angle) / 180 * PI));
if (angle == .1) deploystage = 3;//angle reached so go to next step
}
if (deploystage == 3)//move along the rail
{
//sprintf(oapiDebugString(), "angle %2.2f step %d r3 %3.4f r2 %3.4f ", angle, deploystage, ROVERPOS.z, ROVERPOS.y);
sprintf(oapiDebugString(), "angle %2.2f step %d zpos %3.4f ypos %3.4f de %3.4f dir.y %3.4f dir.z %3.4fROT.y %3.4f ROT.z %3.4f ", angle, deploystage, ROVERPOS.z, ROVERPOS.y, de, ROVERDIR.y, ROVERDIR.z, ROVERROT.y, ROVERROT.z);
ROVERPOS.y = (ROVERPOS.y - dd);
ROVERPOS.z = (ROVERPOS.z + de);
//ROVERPOS.z = .5;
if (ROVERPOS.z > 2.0)deploystage = 0;
}
if it goes to stage 3 where it is just to translate it rotates the rover. But watching the values of the attachment point it isn't changing??