1
0
Fork 0

A tiny bit more view tweaking.

This commit is contained in:
curt 1997-06-02 03:40:06 +00:00
parent 2abbce4d79
commit 95804faaea
4 changed files with 50 additions and 38 deletions

View file

@ -126,7 +126,7 @@ void GLUTkey(unsigned char k, int x, int y) {
/* Handle "special" keyboard events */
void GLUTspecialkey(unsigned char k, int x, int y) {
void GLUTspecialkey(int k, int x, int y) {
struct control_params *c;
c = &current_aircraft.controls;
@ -152,9 +152,12 @@ void GLUTspecialkey(unsigned char k, int x, int y) {
/* $Log$
/* Revision 1.8 1997/06/02 03:01:38 curt
/* Working on views (side, front, back, transitions, etc.)
/* Revision 1.9 1997/06/02 03:40:06 curt
/* A tiny bit more view tweaking.
/*
* Revision 1.8 1997/06/02 03:01:38 curt
* Working on views (side, front, back, transitions, etc.)
*
* Revision 1.7 1997/05/31 19:16:25 curt
* Elevator trim added.
*

View file

@ -37,19 +37,22 @@
/* Handle keyboard events */
void GLUTkey(unsigned char k, int x, int y);
void GLUTspecialkey(unsigned char k, int x, int y);
void GLUTspecialkey(int k, int x, int y);
#endif GLUTKEY_H
/* $Log$
/* Revision 1.3 1997/05/31 04:13:52 curt
/* WE CAN NOW FLY!!!
/*
/* Continuing work on the LaRCsim flight model integration.
/* Added some MSFS-like keyboard input handling.
/* Revision 1.4 1997/06/02 03:40:06 curt
/* A tiny bit more view tweaking.
/*
* Revision 1.3 1997/05/31 04:13:52 curt
* WE CAN NOW FLY!!!
*
* Continuing work on the LaRCsim flight model integration.
* Added some MSFS-like keyboard input handling.
*
* Revision 1.2 1997/05/23 15:40:25 curt
* Added GNU copyright headers.
* Fog now works!

View file

@ -174,30 +174,6 @@ static void fgUpdateViewParams() {
printf("Forward vector is (%.2f,%.2f,%.2f)\n", forward[0], forward[1],
forward[2]);
if ( fabs(goal_view_offset - view_offset) < 0.09 ) {
view_offset = goal_view_offset;
} else {
/* move view_offset towards goal_view_offset */
if ( goal_view_offset > view_offset ) {
if ( goal_view_offset - view_offset < M_PI ) {
view_offset += 0.05;
} else {
view_offset -= 0.05;
}
} else {
if ( view_offset - goal_view_offset < M_PI ) {
view_offset -= 0.05;
} else {
view_offset += 0.05;
}
}
if ( view_offset > PI2 ) {
view_offset -= PI2;
} else if ( view_offset < 0 ) {
view_offset += PI2;
}
}
MAT3rotate(TMP, up, view_offset);
MAT3mult_vec(fwrd_view, forward, TMP);
@ -263,6 +239,30 @@ void fgTimerCatch() {
/* update the flight model */
fgFlightModelUpdate(FG_LARCSIM, f, DEFAULT_MULTILOOP);
if ( fabs(goal_view_offset - view_offset) < 0.09 ) {
view_offset = goal_view_offset;
} else {
/* move view_offset towards goal_view_offset */
if ( goal_view_offset > view_offset ) {
if ( goal_view_offset - view_offset < M_PI ) {
view_offset += 0.05;
} else {
view_offset -= 0.05;
}
} else {
if ( view_offset - goal_view_offset < M_PI ) {
view_offset -= 0.05;
} else {
view_offset += 0.05;
}
}
if ( view_offset > PI2 ) {
view_offset -= PI2;
} else if ( view_offset < 0 ) {
view_offset += PI2;
}
}
lastSimtime = Simtime;
signal(SIGALRM, fgTimerCatch);
}
@ -483,9 +483,12 @@ int main( int argc, char *argv[] ) {
/* $Log$
/* Revision 1.12 1997/06/02 03:01:38 curt
/* Working on views (side, front, back, transitions, etc.)
/* Revision 1.13 1997/06/02 03:40:06 curt
/* A tiny bit more view tweaking.
/*
* Revision 1.12 1997/06/02 03:01:38 curt
* Working on views (side, front, back, transitions, etc.)
*
* Revision 1.11 1997/05/31 19:16:25 curt
* Elevator trim added.
*

View file

@ -44,7 +44,7 @@ GLint mesh2GL(struct mesh *m) {
int i, j, istep, jstep, iend, jend;
float temp;
istep = jstep = 30; /* Detail level 1 -- 1200 ... */
istep = jstep = 20; /* Detail level 1 -- 1200 ... */
mesh = glGenLists(1);
glNewList(mesh, GL_COMPILE);
@ -104,9 +104,12 @@ GLint mesh2GL(struct mesh *m) {
/* $Log$
/* Revision 1.15 1997/06/02 03:01:38 curt
/* Working on views (side, front, back, transitions, etc.)
/* Revision 1.16 1997/06/02 03:40:07 curt
/* A tiny bit more view tweaking.
/*
* Revision 1.15 1997/06/02 03:01:38 curt
* Working on views (side, front, back, transitions, etc.)
*
* Revision 1.14 1997/05/31 19:16:26 curt
* Elevator trim added.
*