I think I have done this before.
But in the cockpit view I want to have the camera follow an animation. I have an tip that does follow the animation. But when I switch to that view it does not move. One thing I did notice is if I switch from F1 to external and back the direction has changed but the position has not.
For testing I have the direction set straight up.
and then the key function to switch the view:
and then in the poststep
But in the cockpit view I want to have the camera follow an animation. I have an tip that does follow the animation. But when I switch to that view it does not move. One thing I did notice is if I switch from F1 to external and back the direction has changed but the position has not.
For testing I have the direction set straight up.
void FLEXARM::SelectCockpitView(int CAMVIEW) {
switch (CAMVIEW) {
case 0: //LEFT SetCameraOffset(_V(0, 1.0, -1.4)); // Set camera position (x,y,z)
SetCameraDefaultDirection(_V(0, 0, 1));
oapiCameraSetCockpitDir(0, 0); break;
case 1: //CAMMAST SetCameraOffset(CAM_tip[0]); // Set camera position (x,y,z)
SetCameraDefaultDirection(_V(0, 0, 1));
oapiCameraSetCockpitDir(0, 0); break;
case 2: //BACK SetCameraOffset(_V(-.901, -.082, 1.5));
SetCameraDefaultDirection(_V(0, 0, 1));
oapiCameraSetCockpitDir(0, 0); break;
case 3: //BACK SetCameraOffset(_V(.901, -.082, 1.5));
SetCameraDefaultDirection(_V(0, 0, 1));
oapiCameraSetCockpitDir(0, 0); break;
case 4: //BACK SetCameraOffset(_V(-.901, -.082, -1.5));
SetCameraDefaultDirection(_V(0, 0, -1));
oapiCameraSetCockpitDir(0, 0); break;
case 5: //BACK SetCameraOffset(_V(.901, -.082, -1.5));
SetCameraDefaultDirection(_V(0, 0, -1)); oapiCameraSetCockpitDir(0, 0); break; } }
here:CAM_tip[0] is the where the camera view should be. It does move with the animation. But when I switch to that view it does not change
and then the key function to switch the view:
if (key == OAPI_KEY_W) {
SelectCockpitView(CAMVIEW);
CAMVIEW = CAMVIEW + 1;
if (CAMVIEW > 5) CAMVIEW = -1;
return 1; }
and then in the poststep
void FLEXARM::clbkPostStep(double simt, double simdt, double mjd) {
SelectCockpitView(CAMVIEW);