SelectCockpitView

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,745
Reaction score
2,726
Points
203
Location
Dallas, TX
I want to press a key which selects which camera position to get.

I have this:
Code:
void CENTURI::SelectCockpitView (int CAM)
{

     switch (CAM) {
       case 0:  //pad
          SetCameraDefaultDirection (_V(.7,0,.7));
          SetCameraOffset (_V(37.448,-34.095,37.488));
          break;
      case 1:  //command
          SetCameraDefaultDirection (_V(0,0,-1));
          SetCameraOffset (_V(0,65,-100));
          break;
          case 2:  //balcony
          SetCameraDefaultDirection (_V(-1,0,0));
          SetCameraOffset (_V(-150,65,0));
          break;
      case 3:  //command
          SetCameraDefaultDirection (_V(0,0,1));
          SetCameraOffset (_V(0,65,100));
          break;
          case 4:  //balcony
          SetCameraDefaultDirection (_V(1,0,0));
          SetCameraOffset (_V(150,65,0));
          break;
      

      }
            }
      
....
case OAPI_KEY_C:  //Select camera
            {CAM = CAM + 1;
            if(CAM > 5) CAM = 0;
        }
            return 1;


in the h
Code:
   void CENTURI::SelectCockpitView (int CAM); 
int CAM;

compiles but the camera position doesn't change when C is pressed
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,655
Reaction score
2,376
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Why do you have CAM as object variable and as parameter?

Also how do you call SetCockpitView?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,745
Reaction score
2,726
Points
203
Location
Dallas, TX
this is what I left out. now it works:
Code:
case OAPI_KEY_C:  //Select camera
            {SelectCockpitView(CAM);
                
                CAM = CAM + 1;
            if(CAM > 5) CAM = 0;
        }
            return 1;
 
Top