tuxracer-checkins Mailing List for Tux Racer (Page 13)
Status: Beta
Brought to you by:
jfpatry
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(46) |
Sep
(274) |
Oct
(36) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jasmin P. <jf...@us...> - 2000-09-02 21:37:43
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv30158 Modified Files: course_render.c Log Message: Set glColour before drawing sky cube (necessary so that we don't inherit transparent alphas) Index: course_render.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_render.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** course_render.c 2000/09/02 17:21:10 1.15 --- course_render.c 2000/09/02 21:37:40 1.16 *************** *** 337,340 **** --- 337,342 ---- } + glColor4f( 1.0, 1.0, 1.0, 1.0 ); + glPushMatrix(); |
From: Jasmin P. <jf...@us...> - 2000-09-02 19:44:20
|
Update of /cvsroot/tuxracer/tuxracer In directory slayer.i.sourceforge.net:/tmp/cvs-serv32314 Modified Files: configure.in Log Message: Moved -lSDL_mixer before -lSDL (seems to be necessary when cross-compiling with mingw32) Index: configure.in =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/configure.in,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** configure.in 2000/08/15 01:12:29 1.14 --- configure.in 2000/09/02 19:44:17 1.15 *************** *** 91,95 **** dnl Check for SDL_mixer ! AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, TUXRACER_EXTRA_COMPILEFLAGS="$TUXRACER_EXTRA_COMPILEFLAGS -DHAVE_SDL_MIXER=1"; LIBS="$LIBS -lSDL_mixer") dnl Check for OpenGL. --- 91,95 ---- dnl Check for SDL_mixer ! AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, TUXRACER_EXTRA_COMPILEFLAGS="$TUXRACER_EXTRA_COMPILEFLAGS -DHAVE_SDL_MIXER=1"; LIBS="-lSDL_mixer $LIBS") dnl Check for OpenGL. |
From: Jasmin P. <jf...@us...> - 2000-09-02 19:39:54
|
Update of /cvsroot/tuxracer/tuxracer-data In directory slayer.i.sourceforge.net:/tmp/cvs-serv32011 Modified Files: tuxracer_init.tcl Log Message: Now only bind sound/music if sound/music was successfully loaded. Index: tuxracer_init.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/tuxracer_init.tcl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** tuxracer_init.tcl 2000/08/31 22:52:09 1.2 --- tuxracer_init.tcl 2000/09/02 19:39:49 1.3 *************** *** 6,24 **** # Start screen ! tux_load_music start_screen music/start1-jt.it ! tux_bind_music start_screen start_screen -1 # Options screen ! tux_load_music options_screen music/options1-jt.it # Music played during race ! tux_load_music racing music/race1-jt.it ! tux_bind_music intro racing -1 ! tux_bind_music racing racing -1 ! tux_bind_music paused racing -1 # Game Over screen ! tux_load_music game_over music/wonrace1-jt.it ! tux_bind_music game_over game_over 1 --- 6,29 ---- # Start screen ! if { [tux_load_music start_screen music/start1-jt.it] } { ! tux_bind_music start_screen start_screen -1 ! } # Options screen ! if { [tux_load_music options_screen music/options1-jt.it] } { ! # not used currently ! } # Music played during race ! if { [tux_load_music racing music/race1-jt.it] } { ! tux_bind_music intro racing -1 ! tux_bind_music racing racing -1 ! tux_bind_music paused racing -1 ! } # Game Over screen ! if { [tux_load_music game_over music/wonrace1-jt.it] } { ! tux_bind_music game_over game_over 1 ! } *************** *** 28,59 **** # Thud ! tux_load_sound thud1 sounds/thud1-jb.wav ! tux_load_sound thud2 sounds/thud2-jb.wav ! tux_bind_sounds soft_collision thud1 thud2 # "Ow!" ! tux_load_sound ow1 sounds/ow1-jb.wav ! tux_load_sound ow2 sounds/ow2-jb.wav ! tux_load_sound ow3 sounds/ow3-jb.wav ! tux_load_sound ow4 sounds/ow4-jb.wav ! tux_bind_sounds hard_collision ow1 ow2 ow2 ow4 # "Let's Go!" ! tux_load_sound letsgo1 sounds/letsgo1-jb.wav ! tux_load_sound letsgo2 sounds/letsgo2-jb.wav ! tux_bind_sounds start_race letsgo1 letsgo2 # "Look out!" ! tux_load_sound lookout1 sounds/lookout1-jb.wav ! tux_load_sound lookout2 sounds/lookout2-jb.wav ! tux_bind_sounds going_to_collide lookout1 lookout2 # Sky Cube ! tux_load_texture alpine1-front courses/common/alpine1-front.rgb ! tux_load_texture alpine1-right courses/common/alpine1-right.rgb ! tux_load_texture alpine1-left courses/common/alpine1-left.rgb ! tux_load_texture alpine1-back courses/common/alpine1-back.rgb ! tux_load_texture alpine1-top courses/common/alpine1-top.rgb ! tux_load_texture alpine1-bottom courses/common/alpine1-bottom.rgb tux_bind_texture sky_front alpine1-front --- 33,72 ---- # Thud ! if { [tux_load_sound thud1 sounds/thud1-jb.wav] && ! [tux_load_sound thud2 sounds/thud2-jb.wav] } \ ! { ! tux_bind_sounds soft_collision thud1 thud2 ! } # "Ow!" ! if { [tux_load_sound ow1 sounds/ow1-jb.wav] && ! [tux_load_sound ow2 sounds/ow2-jb.wav] && ! [tux_load_sound ow3 sounds/ow3-jb.wav] && ! [tux_load_sound ow4 sounds/ow4-jb.wav] } \ ! { ! tux_bind_sounds hard_collision ow1 ow2 ow2 ow4 ! } # "Let's Go!" ! if { [tux_load_sound letsgo1 sounds/letsgo1-jb.wav] && ! [tux_load_sound letsgo2 sounds/letsgo2-jb.wav] } \ ! { ! tux_bind_sounds start_race letsgo1 letsgo2 ! } # "Look out!" ! if { [tux_load_sound lookout1 sounds/lookout1-jb.wav] && ! [tux_load_sound lookout2 sounds/lookout2-jb.wav] } \ ! { ! tux_bind_sounds going_to_collide lookout1 lookout2 ! } # Sky Cube ! tux_load_texture alpine1-front courses/common/alpine1-front.rgb 0 ! tux_load_texture alpine1-right courses/common/alpine1-right.rgb 0 ! tux_load_texture alpine1-left courses/common/alpine1-left.rgb 0 ! tux_load_texture alpine1-back courses/common/alpine1-back.rgb 0 ! tux_load_texture alpine1-top courses/common/alpine1-top.rgb 0 ! tux_load_texture alpine1-bottom courses/common/alpine1-bottom.rgb 0 tux_bind_texture sky_front alpine1-front |
From: Jasmin P. <jf...@us...> - 2000-09-02 19:38:32
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv31921 Modified Files: phys_sim.c phys_sim.h Log Message: - Changed physics so that player's distance below surface is measure along surface normal, instead of along y axis. - Constrained a player's distance below surface to MAX_SURFACE_PENETRATION (20 cm currently) Index: phys_sim.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/phys_sim.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** phys_sim.c 2000/09/02 17:28:58 1.14 --- phys_sim.c 2000/09/02 19:38:28 1.15 *************** *** 104,107 **** --- 104,110 ---- #define TUX_GLUTE_MAX_SPRING_FORCE 3000 + /* Maximum distance that player can penetrate into terrain (m) */ + #define MAX_SURFACE_PENETRATION 0.2 + /* Density of air @ -3 C (kg/m^3) */ #define AIR_DENSITY 1.308 *************** *** 498,501 **** --- 501,518 ---- } + plane_t get_local_course_plane( point_t pt ) + { + plane_t plane; + + pt.y = find_y_coord( pt.x, pt.z ); + + plane.nml = find_course_normal( pt.x, pt.z ); + plane.d = -( plane.nml.x * pt.x + + plane.nml.y * pt.y + + plane.nml.z * pt.z ); + + return plane; + } + static void update_paddling( player_data_t *plyr ) { *************** *** 721,731 **** * speed */ ! scalar_t adjust_velocity( vector_t *vel, point_t pos, scalar_t surf_y, ! vector_t surf_nml ) { scalar_t speed; ! /* adjust_for_tree_collision( pos, vel ); */ ! /* we do this in solve_ode_system now, see the comments there */ speed = normalize_vector( vel ); --- 738,748 ---- * speed */ ! scalar_t adjust_velocity( vector_t *vel, point_t pos, ! plane_t surf_plane, scalar_t dist_from_surface ) { + vector_t surf_nml; scalar_t speed; ! surf_nml = surf_plane.nml; speed = normalize_vector( vel ); *************** *** 748,754 **** } ! void adjust_position( point_t *pos, scalar_t surf_y, terrain_t surf_type ) { ! /* No need to do anything */ return; } --- 765,779 ---- } ! void adjust_position( point_t *pos, plane_t surf_plane, ! scalar_t dist_from_surface, terrain_t surf_type ) { ! ! if ( dist_from_surface < -MAX_SURFACE_PENETRATION ) ! { ! *pos = move_point( *pos, ! scale_vector( -MAX_SURFACE_PENETRATION - ! dist_from_surface, ! surf_plane.nml ) ); ! } return; } *************** *** 798,802 **** void adjust_orientation( player_data_t *plyr, scalar_t dtime, point_t pos, vector_t vel, ! scalar_t surf_y, vector_t surf_nml ) { vector_t new_x, new_y, new_z; --- 823,827 ---- void adjust_orientation( player_data_t *plyr, scalar_t dtime, point_t pos, vector_t vel, ! scalar_t dist_from_surface, vector_t surf_nml ) { vector_t new_x, new_y, new_z; *************** *** 808,812 **** static vector_t minus_y_vec = { 0., -1., 0. }; ! if ( pos.y > surf_y ) { if ( getparam_tux_slides_on_belly() ) { --- 833,837 ---- static vector_t minus_y_vec = { 0., -1., 0. }; ! if ( dist_from_surface > 0 ) { if ( getparam_tux_slides_on_belly() ) { *************** *** 850,854 **** } ! time_constant = pos.y > surf_y ? TUX_ORIENTATION_AIRBORNE_TIME_CONSTANT : TUX_ORIENTATION_TIME_CONSTANT; --- 875,879 ---- } ! time_constant = dist_from_surface > 0 ? TUX_ORIENTATION_AIRBORNE_TIME_CONSTANT : TUX_ORIENTATION_TIME_CONSTANT; *************** *** 1052,1056 **** ! static vector_t calc_net_force( player_data_t *plyr, point_t uncorr_pos, vector_t vel ) { --- 1077,1081 ---- ! static vector_t calc_net_force( player_data_t *plyr, point_t pos, vector_t vel ) { *************** *** 1068,1072 **** scalar_t comp_depth; /* depth to which the terrain can be compressed */ scalar_t speed; /* speed (m/s) */ - scalar_t surf_y; /* y coord of terrain surface */ vector_t orig_surf_nml; /* normal to terrain at current position */ vector_t surf_nml; /* normal to terrain w/ roll effect */ --- 1093,1096 ---- *************** *** 1076,1085 **** matrixgl_t fric_rot_mat; /* Matrix to rotate frictional force */ vector_t jump_f; ! surf_type = get_surface_type( uncorr_pos.x, uncorr_pos.z ); ! orig_surf_nml = find_course_normal( uncorr_pos.x, uncorr_pos.z ); surf_nml = adjust_surf_nml_for_roll( plyr, vel, fricCoeff[surf_type], orig_surf_nml ); - surf_y = find_y_coord( uncorr_pos.x, uncorr_pos.z ); comp_depth = get_compression_depth( surf_type ); --- 1100,1111 ---- matrixgl_t fric_rot_mat; /* Matrix to rotate frictional force */ vector_t jump_f; + plane_t surf_plane; + scalar_t dist_from_surface; ! surf_type = get_surface_type( pos.x, pos.z ); ! surf_plane = get_local_course_plane( pos ); ! orig_surf_nml = surf_plane.nml; surf_nml = adjust_surf_nml_for_roll( plyr, vel, fricCoeff[surf_type], orig_surf_nml ); comp_depth = get_compression_depth( surf_type ); *************** *** 1087,1100 **** grav_f = make_vector( 0, -EARTH_GRAV * TUX_MASS, 0 ); /* * Calculate normal force */ nml_f = make_vector( 0., 0., 0. ); ! if ( uncorr_pos.y <= surf_y - comp_depth ) { /* * Tux ended up below the surface. * Calculate the spring force exterted by his rear end. :-) */ ! glute_compression = surf_y - comp_depth - uncorr_pos.y; check_assertion( glute_compression >= 0, "unexpected negative compression" ); --- 1113,1128 ---- grav_f = make_vector( 0, -EARTH_GRAV * TUX_MASS, 0 ); + dist_from_surface = distance_to_plane( surf_plane, pos ); + /* * Calculate normal force */ nml_f = make_vector( 0., 0., 0. ); ! if ( dist_from_surface <= -comp_depth ) { /* * Tux ended up below the surface. * Calculate the spring force exterted by his rear end. :-) */ ! glute_compression = -dist_from_surface - comp_depth; check_assertion( glute_compression >= 0, "unexpected negative compression" ); *************** *** 1129,1133 **** fric_dir = scale_vector( -1.0, fric_dir ); ! if ( uncorr_pos.y <= surf_y && speed > MIN_FRICTION_SPEED ) { vector_t tmp_nml_f = nml_f; --- 1157,1161 ---- fric_dir = scale_vector( -1.0, fric_dir ); ! if ( dist_from_surface < 0 && speed > MIN_FRICTION_SPEED ) { vector_t tmp_nml_f = nml_f; *************** *** 1197,1201 **** */ update_paddling( plyr ); ! if ( plyr->control.is_paddling && uncorr_pos.y <= surf_y ) { paddling_f = scale_vector( -1 * min( MAX_PADDLING_FORCE, --- 1225,1229 ---- */ update_paddling( plyr ); ! if ( plyr->control.is_paddling && dist_from_surface <= 0 ) { paddling_f = scale_vector( -1 * min( MAX_PADDLING_FORCE, *************** *** 1498,1502 **** void update_player_pos( player_data_t *plyr, scalar_t dtime ) { - scalar_t surf_y; /* y coord of terrain */ vector_t surf_nml; /* normal vector of terrain */ terrain_t surf_type; /* type of terrain */ --- 1526,1529 ---- *************** *** 1506,1509 **** --- 1533,1538 ---- vector_t local_force; scalar_t jump_factor; + plane_t surf_plane; + scalar_t dist_from_surface; if ( dtime > 2. * EPS ) { *************** *** 1517,1525 **** */ surf_type = get_surface_type( plyr->pos.x, plyr->pos.z ); ! surf_nml = find_course_normal( plyr->pos.x, plyr->pos.z ); ! surf_y = find_y_coord( plyr->pos.x, plyr->pos.z ); ! adjust_velocity( &plyr->vel, plyr->pos, surf_y, ! surf_nml ); ! adjust_position( &plyr->pos, surf_y, surf_type ); speed = normalize_vector( &tmp_vel ); --- 1546,1555 ---- */ surf_type = get_surface_type( plyr->pos.x, plyr->pos.z ); ! surf_plane = get_local_course_plane( plyr->pos ); ! surf_nml = surf_plane.nml; ! dist_from_surface = distance_to_plane( surf_plane, plyr->pos ); ! adjust_velocity( &plyr->vel, plyr->pos, surf_plane, ! dist_from_surface ); ! adjust_position( &plyr->pos, surf_plane, dist_from_surface, surf_type ); speed = normalize_vector( &tmp_vel ); *************** *** 1527,1531 **** set_tux_pos( plyr, plyr->pos ); adjust_orientation( plyr, dtime, plyr->pos, plyr->vel, ! surf_y, surf_nml ); if ( plyr->control.is_paddling ) { --- 1557,1561 ---- set_tux_pos( plyr, plyr->pos ); adjust_orientation( plyr, dtime, plyr->pos, plyr->vel, ! dist_from_surface, surf_nml ); if ( plyr->control.is_paddling ) { Index: phys_sim.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/phys_sim.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** phys_sim.h 2000/03/13 23:12:20 1.2 --- phys_sim.h 2000/09/02 19:38:28 1.3 *************** *** 39,42 **** --- 39,43 ---- scalar_t find_y_coord( scalar_t x, scalar_t z ); terrain_t get_surface_type( scalar_t x, scalar_t z ); + plane_t get_local_course_plane( point_t pt ); void set_tux_pos( player_data_t *plyr, point_t newPos ); void update_player_pos( player_data_t *plyr, scalar_t dtime ); |
From: Jasmin P. <jf...@us...> - 2000-09-02 19:35:59
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv31718 Modified Files: alglib.c alglib.h Log Message: Added routine to compute the distance of a point from a plane. Index: alglib.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/alglib.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** alglib.c 2000/09/02 17:21:10 1.7 --- alglib.c 2000/09/02 19:35:54 1.8 *************** *** 260,263 **** --- 260,272 ---- } + scalar_t distance_to_plane( plane_t plane, point_t pt ) + { + return + plane.nml.x * pt.x + + plane.nml.y * pt.y + + plane.nml.z * pt.z + + plane.d; + } + void make_identity_matrix(matrixgl_t h) { Index: alglib.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/alglib.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** alglib.h 2000/09/02 17:21:10 1.6 --- alglib.h 2000/09/02 19:35:54 1.7 *************** *** 66,69 **** --- 66,70 ---- plane_t make_plane( scalar_t nx, scalar_t ny, scalar_t nz, scalar_t d ); bool_t intersect_planes( plane_t s1, plane_t s2, plane_t s3, point_t *p ); + scalar_t distance_to_plane( plane_t plane, point_t pt ); /* matrices */ |
From: Jasmin P. <jf...@us...> - 2000-09-02 17:29:00
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv6551 Modified Files: phys_sim.c Log Message: Placed limit on turning force; this fixes the wacky turning behaviour on rock. Index: phys_sim.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/phys_sim.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** phys_sim.c 2000/08/28 03:42:36 1.13 --- phys_sim.c 2000/09/02 17:28:58 1.14 *************** *** 48,51 **** --- 48,53 ---- #define MAX_TURN_ANGLE 60 + #define MAX_TURN_PERPENDICULAR_FORCE 400 + /* Maximum increase in friction when turning */ #define MAX_TURN_PENALTY 0.3 *************** *** 244,248 **** angle = get_course_angle(); ! minY = -courseLength * tan( angle * M_PI / 180.0 ); return minY; } --- 246,250 ---- angle = get_course_angle(); ! minY = -courseLength * tan( ANGLES_TO_RADIANS( angle ) ); return minY; } *************** *** 1055,1060 **** vector_t nml_f; /* normal force */ vector_t unclamped_nml_f; /* unclamped normal force (for damage calc) */ - scalar_t nml_f_mag; /* and its magnitude */ vector_t fric_f; /* frictional force */ vector_t fric_dir; /* direction of frictional force */ vector_t grav_f; /* gravitational force */ --- 1057,1062 ---- vector_t nml_f; /* normal force */ vector_t unclamped_nml_f; /* unclamped normal force (for damage calc) */ vector_t fric_f; /* frictional force */ + scalar_t fric_f_mag; /* frictional force magnitude */ vector_t fric_dir; /* direction of frictional force */ vector_t grav_f; /* gravitational force */ *************** *** 1130,1137 **** vector_t tmp_nml_f = nml_f; ! nml_f_mag = normalize_vector( &tmp_nml_f ); ! fric_f = scale_vector( ! fricCoeff[surf_type] * nml_f_mag, fric_dir ); --- 1132,1138 ---- vector_t tmp_nml_f = nml_f; ! fric_f_mag = normalize_vector( &tmp_nml_f ) * fricCoeff[surf_type]; ! fric_f = scale_vector( fric_f_mag, fric_dir ); *************** *** 1140,1143 **** --- 1141,1156 ---- */ steer_angle = plyr->control.turn_fact * MAX_TURN_ANGLE; + + /* limit turning force */ + if ( fabs( fric_f_mag * sin( ANGLES_TO_RADIANS( steer_angle ) ) ) > + MAX_TURN_PERPENDICULAR_FORCE ) + { + check_assertion( fabs( plyr->control.turn_fact ) > 0, + "steer angle is non-zero when player is not " + "turning" ); + steer_angle = RADIANS_TO_ANGLES( + asin( MAX_TURN_PERPENDICULAR_FORCE / fric_f_mag ) ) * + plyr->control.turn_fact / fabs( plyr->control.turn_fact ); + } make_rotation_about_vector_matrix( fric_rot_mat, orig_surf_nml, steer_angle ); |
From: Jasmin P. <jf...@us...> - 2000-09-02 17:21:13
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv6098 Modified Files: alglib.c alglib.h course_load.c course_render.c preview.c view.c viewfrustum.c Log Message: Created ANGLES_TO_RADIANS and RADIANS_TO_ANGLES macros; changed all such conversions to use these macros. Index: alglib.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/alglib.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** alglib.c 2000/08/31 15:24:39 1.6 --- alglib.c 2000/09/02 17:21:10 1.7 *************** *** 303,308 **** { scalar_t sinv, cosv; ! sinv = sin( angle * M_PI / 180.0 ); ! cosv = cos( angle * M_PI / 180.0 ); make_identity_matrix( mat ); --- 303,308 ---- { scalar_t sinv, cosv; ! sinv = sin( ANGLES_TO_RADIANS( angle ) ); ! cosv = cos( ANGLES_TO_RADIANS( angle ) ); make_identity_matrix( mat ); Index: alglib.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/alglib.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** alglib.h 2000/08/31 15:24:39 1.5 --- alglib.h 2000/09/02 17:21:10 1.6 *************** *** 37,40 **** --- 37,43 ---- #endif + #define ANGLES_TO_RADIANS(x) ( M_PI / 180.0 * (x) ) + #define RADIANS_TO_ANGLES(x) ( 180.0 / M_PI * (x) ) + /* points and vectors */ vector_t make_vector( scalar_t x, scalar_t y, scalar_t z ); Index: course_load.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_load.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** course_load.c 2000/08/31 15:29:34 1.15 --- course_load.c 2000/09/02 17:21:10 1.16 *************** *** 119,123 **** scalar_t get_terrain_base_height( scalar_t distance ) { ! scalar_t slope = tan( course_angle * M_PI/180.0 ); scalar_t base_height; --- 119,123 ---- scalar_t get_terrain_base_height( scalar_t distance ) { ! scalar_t slope = tan( ANGLES_TO_RADIANS( course_angle ) ); scalar_t base_height; *************** *** 443,447 **** } ! slope = tan( course_angle * M_PI/180.0 ); pad = 0; /* RGBA images rows are aligned on 4-byte boundaries */ --- 443,447 ---- } ! slope = tan( ANGLES_TO_RADIANS( course_angle ) ); pad = 0; /* RGBA images rows are aligned on 4-byte boundaries */ Index: course_render.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_render.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** course_render.c 2000/09/01 00:12:05 1.14 --- course_render.c 2000/09/02 17:21:10 1.15 *************** *** 456,460 **** /* make background fill field of view */ ! bgndWidth = 2 * tan(fov/2.*M_PI/180.) * aspect * total_length; if ( bgndWidth < total_length ) { --- 456,461 ---- /* make background fill field of view */ ! bgndWidth = 2 * tan( ANGLES_TO_RADIANS( fov/2. ) ) * ! aspect * total_length; if ( bgndWidth < total_length ) { *************** *** 672,676 **** get_course_dimensions( &course_width, &course_length ); course_angle = get_course_angle(); ! slope = tan( course_angle * M_PI / 180.0 ); left_edge_plane = make_plane( 1.0, 0.0, 0.0, 0.0 ); --- 673,677 ---- get_course_dimensions( &course_width, &course_length ); course_angle = get_course_angle(); ! slope = tan( ANGLES_TO_RADIANS( course_angle ) ); left_edge_plane = make_plane( 1.0, 0.0, 0.0, 0.0 ); Index: preview.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/preview.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** preview.c 2000/03/13 23:01:54 1.3 --- preview.c 2000/09/02 17:21:10 1.4 *************** *** 50,60 **** courseAngle = get_course_angle(); ! eye_pt = make_point( sin( theta * M_PI / 180.0 ) * courseLength + courseWidth / 2., ! -courseLength * tan( courseAngle*M_PI/180.0 ) / 2., ! -cos( theta * M_PI / 180.0 ) * courseLength ); coursePt = make_point( courseWidth / 2., ! -courseLength * tan( courseAngle*M_PI/180.0 ) / 2., -courseLength / 2.); --- 50,62 ---- courseAngle = get_course_angle(); ! eye_pt = make_point( sin( ANGLES_TO_RADIANS( theta ) ) * courseLength + courseWidth / 2., ! -courseLength * ! tan( ANGLES_TO_RADIANS( courseAngle ) ) / 2., ! -cos( ANGLES_TO_RADIANS( theta ) ) * courseLength ); coursePt = make_point( courseWidth / 2., ! -courseLength * ! tan( ANGLES_TO_RADIANS( courseAngle ) ) / 2., -courseLength / 2.); Index: view.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/view.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** view.c 2000/08/31 15:44:43 1.5 --- view.c 2000/09/02 17:21:10 1.6 *************** *** 183,188 **** /* Constrain angle with x-z plane */ ! theta = ( M_PI/2 - acos( dot_product( vec2, y_vec ) ) ) * ! 180.0/M_PI; if ( theta > max_vec_angle ) --- 183,187 ---- /* Constrain angle with x-z plane */ ! theta = RADIANS_TO_ANGLES( M_PI/2 - acos( dot_product( vec2, y_vec ) ) ); if ( theta > max_vec_angle ) *************** *** 329,340 **** /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ), ! cos( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); --- 328,339 ---- /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) ), ! cos( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); *************** *** 417,428 **** /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ), ! cos( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); --- 416,427 ---- /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) ), ! cos( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE + ! PLAYER_ANGLE_IN_CAMERA ) ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); *************** *** 506,517 **** /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE+ ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ), ! cos( ( course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE+ ! PLAYER_ANGLE_IN_CAMERA ) * ! M_PI/180.0 ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); --- 505,516 ---- /* Construct vector from player to camera */ view_vec = make_vector( 0, ! sin( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE+ ! PLAYER_ANGLE_IN_CAMERA ) ), ! cos( ANGLES_TO_RADIANS( ! course_angle - ! CAMERA_ANGLE_ABOVE_SLOPE+ ! PLAYER_ANGLE_IN_CAMERA ) ) ); view_vec = scale_vector( CAMERA_DISTANCE, view_vec ); Index: viewfrustum.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/viewfrustum.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** viewfrustum.c 2000/08/31 15:45:27 1.4 --- viewfrustum.c 2000/09/02 17:21:10 1.5 *************** *** 40,44 **** point_t pt; point_t origin = { 0., 0., 0. }; ! scalar_t half_fov = getparam_fov() * M_PI/180.0 * 0.5; scalar_t half_fov_horiz = atan( tan( half_fov ) * aspect ); --- 40,44 ---- point_t pt; point_t origin = { 0., 0., 0. }; ! scalar_t half_fov = ANGLES_TO_RADIANS( getparam_fov() * 0.5 ); scalar_t half_fov_horiz = atan( tan( half_fov ) * aspect ); |
From: Jasmin P. <jf...@us...> - 2000-09-02 17:18:23
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv5911 Modified Files: main.c Log Message: Fixed bug that would cause segfault when audio device not successfully opened. Index: main.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** main.c 2000/08/31 15:32:30 1.12 --- main.c 2000/09/02 17:18:20 1.13 *************** *** 131,136 **** if ( Mix_OpenAudio(hz, format, channels, buffer) < 0 ) { print_warning( 1, ! "Warning: Couldn't set %s Hz %s-bit audio\n- " ! "Reason: %s\n", SDL_GetError()); } else { /* Calling SDL_Quit at exit when audio hasn't been opened --- 131,139 ---- if ( Mix_OpenAudio(hz, format, channels, buffer) < 0 ) { print_warning( 1, ! "Warning: Couldn't set %d Hz %d-bit audio\n" ! " Reason: %s\n", ! hz, ! getparam_audio_format_mode() == 0 ? 8 : 16, ! SDL_GetError()); } else { /* Calling SDL_Quit at exit when audio hasn't been opened |
From: Jasmin P. <jf...@us...> - 2000-09-02 17:17:41
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv5868 Modified Files: audio_data.c Log Message: tux_load_sound/tux_load_music callbacks now return true/false to indicate if sound/music was loaded successfully. Tcl code needs to check result and only call tux_bind_sounds/tux_bind_music on successfully loaded sounds/music Index: audio_data.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/audio_data.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** audio_data.c 2000/08/15 02:35:53 1.3 --- audio_data.c 2000/09/02 17:17:38 1.4 *************** *** 600,608 **** Author: jfpatry Created: 2000-08-13 ! Last Modified: 2000-08-13 */ static int load_sound_cb( ClientData cd, Tcl_Interp *ip, int argc, char *argv[]) { check_assertion( initialized_, "audio_data module not initialized" ); --- 600,610 ---- Author: jfpatry Created: 2000-08-13 ! Last Modified: 2000-09-02 */ static int load_sound_cb( ClientData cd, Tcl_Interp *ip, int argc, char *argv[]) { + Tcl_Obj *result; + check_assertion( initialized_, "audio_data module not initialized" ); *************** *** 614,618 **** } ! load_sound( argv[1], argv[2] ); return TCL_OK; } --- 616,621 ---- } ! result = Tcl_NewBooleanObj( load_sound( argv[1], argv[2] ) ); ! Tcl_SetObjResult( ip, result ); return TCL_OK; } *************** *** 625,633 **** Author: jfpatry Created: 2000-08-13 ! Last Modified: 2000-08-13 */ static int load_music_cb( ClientData cd, Tcl_Interp *ip, int argc, char *argv[]) { check_assertion( initialized_, "audio_data module not initialized" ); --- 628,638 ---- Author: jfpatry Created: 2000-08-13 ! Last Modified: 2000-09-02 */ static int load_music_cb( ClientData cd, Tcl_Interp *ip, int argc, char *argv[]) { + Tcl_Obj *result; + check_assertion( initialized_, "audio_data module not initialized" ); *************** *** 639,643 **** } ! load_music( argv[1], argv[2] ); return TCL_OK; } --- 644,649 ---- } ! result = Tcl_NewBooleanObj( load_music( argv[1], argv[2] ) ); ! Tcl_SetObjResult( ip, result ); return TCL_OK; } |
From: Jasmin P. <jf...@us...> - 2000-09-02 17:15:30
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv5696 Modified Files: audio.c Log Message: play_sound, play_music, and update_audio now make sure the audio device is open before doing anything. Index: audio.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/audio.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** audio.c 2000/08/23 22:59:19 1.4 --- audio.c 2000/09/02 17:15:26 1.5 *************** *** 66,69 **** --- 66,86 ---- } + + /*! + Returns the status of the audio device + \return True if audio has been opened, False otherwise + \author jfpatry + \date Created: 2000-09-02 + \date Modified: 2000-09-02 + */ + bool_t is_audio_open() + { + int tmp_freq; + Uint16 tmp_format; + int tmp_channels; + + return (bool_t) Mix_QuerySpec( &tmp_freq, &tmp_format, &tmp_channels ); + } + /*! Associate the sounds in the _name_ array with the *************** *** 350,354 **** \author jfpatry \date Created: 2000-08-13 ! \date Modified: 2000-08-13 */ bool_t play_sound( char *sound_context ) --- 367,371 ---- \author jfpatry \date Created: 2000-08-13 ! \date Modified: 2000-09-02 */ bool_t play_sound( char *sound_context ) *************** *** 362,365 **** --- 379,386 ---- } + if ( ! is_audio_open() ) { + return False; + } + check_assertion( sound_context != NULL, "sound_context is null" ); *************** *** 386,390 **** \author jfpatry \date Created: 2000-08-13 ! \date Modified: 2000-08-14 */ bool_t play_music( char *music_context ) --- 407,411 ---- \author jfpatry \date Created: 2000-08-13 ! \date Modified: 2000-09-02 */ bool_t play_music( char *music_context ) *************** *** 400,403 **** --- 421,428 ---- } + if ( ! is_audio_open() ) { + return False; + } + if ( music_context == NULL ) { if ( current_music_name_ != NULL ) { *************** *** 441,445 **** \author jfpatry \date Created: 2000-08-14 ! \date Modified: 2000-08-14 */ void --- 466,470 ---- \author jfpatry \date Created: 2000-08-14 ! \date Modified: 2000-09-02 */ void *************** *** 449,452 **** --- 474,481 ---- check_assertion( initialized_, "audio module not initialized" ); + + if ( ! is_audio_open() ) { + return; + } if ( getparam_music_enabled() == False ) { |
From: Eric H. <eh...@us...> - 2000-09-01 00:12:09
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv1295 Modified Files: course_render.c racing.c textures.c textures.h Log Message: - made sky cube boundaries seemless - fixed jump code so holding down the button doesn't cause flying when trying to jump or vice versa Index: course_render.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_render.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** course_render.c 2000/08/31 15:47:43 1.13 --- course_render.c 2000/09/01 00:12:05 1.14 *************** *** 345,355 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( -1, -1, -1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( 1, 1, -1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( -1, 1, -1); glEnd(); --- 345,355 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1, -1, -1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1, 1, -1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1, 1, -1); glEnd(); *************** *** 359,369 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( -1, 1, -1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( 1, 1, -1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( 1, 1, 1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( -1, 1, 1); glEnd(); --- 359,369 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1, 1, -1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1, 1, -1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1, 1, 1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1, 1, 1); glEnd(); *************** *** 373,383 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( -1, -1, -1); glEnd(); --- 373,383 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1, -1, -1); glEnd(); *************** *** 388,398 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( -1, -1, -1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( -1, 1, -1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( -1, 1, 1); glEnd(); --- 388,398 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( -1, -1, -1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( -1, 1, -1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1, 1, 1); glEnd(); *************** *** 403,413 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( 1, 1, 1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( 1, 1, -1); glEnd(); --- 403,413 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( 1, -1, -1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1, 1, 1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( 1, 1, -1); glEnd(); *************** *** 418,428 **** glBegin(GL_QUADS); ! glTexCoord2f( 0.01, 0.01 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 0.99, 0.01 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 0.99, 0.99 ); glVertex3f( -1, 1, 1); ! glTexCoord2f( 0.01, 0.99 ); glVertex3f( 1, 1, 1); glEnd(); --- 418,428 ---- glBegin(GL_QUADS); ! glTexCoord2f( 0.0, 0.0 ); glVertex3f( 1, -1, 1); ! glTexCoord2f( 1.0, 0.0 ); glVertex3f( -1, -1, 1); ! glTexCoord2f( 1.0, 1.0 ); glVertex3f( -1, 1, 1); ! glTexCoord2f( 0.0, 1.0 ); glVertex3f( 1, 1, 1); glEnd(); Index: racing.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/racing.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** racing.c 2000/08/31 15:48:56 1.15 --- racing.c 2000/09/01 00:12:05 1.16 *************** *** 57,60 **** --- 57,61 ---- static bool_t charging; static bool_t jumping; + static bool_t flying; void racing_init() *************** *** 89,93 **** left_roll = right_roll = False; roll_modifier = False; ! charging = jumping = False; plyr->control.is_paddling = False; plyr->control.jumping = False; --- 90,94 ---- left_roll = right_roll = False; roll_modifier = False; ! charging = jumping = flying = False; plyr->control.is_paddling = False; plyr->control.jumping = False; *************** *** 189,215 **** JUMP_MAX_START_HEIGHT ) { if ( charging ) { ! if ( !plyr->control.flying ) { ! plyr->control.jump_start_time = g_game.time; ! plyr->control.jumping = True; ! plyr->control.flying = True; } } - jumping = False; - plyr->control.jump_charging = False; } else { ! if ( charging ) { ! if ( !plyr->control.jump_charging ) { ! plyr->control.jump_charging = True; ! plyr->control.jump_charge_start_time = g_game.time; } ! } ! if ( jumping ) { ! jumping = False; ! plyr->control.jump_start_time = g_game.time; ! plyr->control.jump_charging = False; ! plyr->control.flying = False; ! plyr->control.jumping = True; ! calc_jump_amt(); } } --- 190,226 ---- JUMP_MAX_START_HEIGHT ) { if ( charging ) { ! if ( !plyr->control.jump_charging ) { ! if ( !plyr->control.flying ) { ! plyr->control.jump_start_time = g_game.time; ! plyr->control.jumping = True; ! plyr->control.flying = True; ! flying = True; ! } ! jumping = False; ! plyr->control.jump_charging = False; } } } else { ! if ( !flying ) { ! if ( charging ) { ! if ( !plyr->control.jump_charging ) { ! plyr->control.jump_charging = True; ! plyr->control.jump_charge_start_time = g_game.time; ! } } ! if ( jumping ) { ! plyr->control.jump_start_time = g_game.time; ! plyr->control.jump_charging = False; ! plyr->control.flying = False; ! plyr->control.jumping = True; ! calc_jump_amt(); ! } ! } else { ! plyr->control.flying = !jumping; } + } + if ( jumping ) { + flying = False; + jumping = False; } Index: textures.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/textures.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** textures.c 2000/08/15 03:08:12 1.3 --- textures.c 2000/09/01 00:12:05 1.4 *************** *** 42,46 **** bool_t load_and_bind_texture( char *binding, char *filename ) { ! return load_texture( binding, filename ) && bind_texture( binding, binding ); } --- 42,46 ---- bool_t load_and_bind_texture( char *binding, char *filename ) { ! return load_texture( binding, filename, 1 ) && bind_texture( binding, binding ); } *************** *** 75,79 **** } ! bool_t load_texture( char *texname, char *filename ) { IMAGE *texImage; --- 75,79 ---- } ! bool_t load_texture( char *texname, char *filename, int repeatable ) { IMAGE *texImage; *************** *** 96,99 **** --- 96,100 ---- } + tex->repeatable = repeatable; glGenTextures( 1, &(tex->texture_id) ); glBindTexture( GL_TEXTURE_2D, tex->texture_id ); *************** *** 113,118 **** GL_UNSIGNED_BYTE, texImage->data ); ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, --- 114,124 ---- GL_UNSIGNED_BYTE, texImage->data ); ! if ( repeatable ) { ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); ! } else { ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); ! glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); ! } glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, *************** *** 225,236 **** char *argv[]) { ! if ( argc != 3 ) { Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", "Usage: ", argv[0], "<texture name> <image file>", ! (char *)0 ); return TCL_ERROR; } ! if (!load_texture(argv[1], argv[2])) { Tcl_AppendResult(ip, argv[0], ": Could not load texture ", argv[2], (char*)0); --- 231,250 ---- char *argv[]) { ! int repeatable = 1; ! ! if ( ( argc != 3 ) && (argc != 4) ) { Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", "Usage: ", argv[0], "<texture name> <image file>", ! " [repeatable]", (char *)0 ); return TCL_ERROR; } ! if ( ( argc == 4 ) && ( Tcl_GetInt( ip, argv[3], &repeatable ) != TCL_OK ) ) { ! Tcl_AppendResult(ip, argv[0], ": invalid repeatable flag", ! (char *)0 ); ! return TCL_ERROR; ! } ! ! if (!load_texture(argv[1], argv[2], repeatable)) { Tcl_AppendResult(ip, argv[0], ": Could not load texture ", argv[2], (char*)0); Index: textures.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/textures.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** textures.h 2000/08/15 03:08:12 1.4 --- textures.h 2000/09/01 00:12:05 1.5 *************** *** 29,34 **** typedef struct { ! GLuint texture_id; ! int ref_count; } texture_node_t; --- 29,35 ---- typedef struct { ! GLuint texture_id; ! int repeatable; ! int ref_count; } texture_node_t; *************** *** 37,41 **** bool_t load_and_bind_texture( char *binding, char *filename ); ! bool_t load_texture( char *texname, char *filename ); bool_t get_texture( char *texname, texture_node_t **tex ); bool_t del_texture( char *texname ); --- 38,42 ---- bool_t load_and_bind_texture( char *binding, char *filename ); ! bool_t load_texture( char *texname, char *filename, int repeatable ); bool_t get_texture( char *texname, texture_node_t **tex ); bool_t del_texture( char *texname ); |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:45
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/4 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/4 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/4/course.tcl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** course.tcl 2000/04/02 04:46:06 1.3 --- course.tcl 2000/08/31 22:53:42 1.4 *************** *** 26,30 **** tux_friction 0.25 0.9 0.35 source ../common/tux_walk.tcl ! source ../common/standard_light.tcl source ../common/tree_polyhedron.tcl --- 26,36 ---- tux_friction 0.25 0.9 0.35 + tux_course_light 0 -on -position { 1 1 0 0 } -diffuse { 1.0 0.9 1.0 1 } \ + -specular { 0.0 0.0 0.0 1 } -ambient { 0.45 0.53 0.75 1.0 } + + # This light is to get a nice highlight on tux + tux_course_light 1 -on -position { 1 1 2 0 } -specular { 0.8 0.8 0.8 1 } + source ../common/tux_walk.tcl ! #source ../common/standard_light.tcl source ../common/tree_polyhedron.tcl |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:45
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/13 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/13 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/13/course.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** course.tcl 2000/08/15 02:46:56 1.1 --- course.tcl 2000/08/31 22:53:42 1.2 *************** *** 37,48 **** # - # Fog - # These settings correspond to the default fog settings - # Note that in exp or exp2 mode, -start and -end have no effect - # (they are used in linear mode; see course #2) - # - tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 - - # # Particle colour # --- 37,40 ---- |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:45
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/11 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/11 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/11/course.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** course.tcl 2000/04/18 02:18:07 1.1 --- course.tcl 2000/08/31 22:53:41 1.2 *************** *** 38,50 **** # - # Fog - # These settings correspond to the default fog settings - # Note that in exp or exp2 mode, -start and -end have no effect - # (they are used in linear mode; see course #2) - # - tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 - - - # # Particle colour # --- 38,41 ---- |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:45
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/9 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/9 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/9/course.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** course.tcl 2000/04/02 04:55:44 1.1 --- course.tcl 2000/08/31 22:53:42 1.2 *************** *** 36,46 **** source ../common/standard_light.tcl - # - # Fog - # These settings correspond to the default fog settings - # Note that in exp or exp2 mode, -start and -end have no effect - # (they are used in linear mode; see course #2) - # - tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 # --- 36,39 ---- |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:44
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/12 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/12 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/12/course.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** course.tcl 2000/08/15 02:46:18 1.1 --- course.tcl 2000/08/31 22:53:41 1.2 *************** *** 36,47 **** source ../common/standard_light.tcl - # - # Fog - # These settings correspond to the default fog settings - # Note that in exp or exp2 mode, -start and -end have no effect - # (they are used in linear mode; see course #2) - # - tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 - # --- 36,39 ---- |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:44
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/10 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/10 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/10/course.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** course.tcl 2000/04/02 18:10:05 1.1 --- course.tcl 2000/08/31 22:53:41 1.2 *************** *** 36,46 **** source ../common/standard_light.tcl - # - # Fog - # These settings correspond to the default fog settings - # Note that in exp or exp2 mode, -start and -end have no effect - # (they are used in linear mode; see course #2) - # - tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 # --- 36,39 ---- |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:53:44
|
Update of /cvsroot/tuxracer/tuxracer-data/courses/1 In directory slayer.i.sourceforge.net:/tmp/cvs-serv18594/courses/1 Modified Files: course.tcl Log Message: Tweaked for settings to work better with fog plane Index: course.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/courses/1/course.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** course.tcl 2000/03/06 14:35:43 1.1.1.1 --- course.tcl 2000/08/31 22:53:41 1.2 *************** *** 39,43 **** # (they are used in linear mode; see course #2) # ! tux_fog -on -mode exp -density 0.005 -colour { 1 1 1 1 } -start 0 -end 1 # --- 39,44 ---- # (they are used in linear mode; see course #2) # ! tux_fog -on -mode linear -density 0.005 -colour { 1 1 1 1 } -start 0 \ ! -end [tux_get_param forward_clip_distance] # |
From: Jasmin P. <jf...@us...> - 2000-08-31 22:52:12
|
Update of /cvsroot/tuxracer/tuxracer-data In directory slayer.i.sourceforge.net:/tmp/cvs-serv17110 Modified Files: tuxracer_init.tcl Log Message: Fixed loop value for game_over music, added default sky cube. Index: tuxracer_init.tcl =================================================================== RCS file: /cvsroot/tuxracer/tuxracer-data/tuxracer_init.tcl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** tuxracer_init.tcl 2000/08/15 02:45:44 1.1 --- tuxracer_init.tcl 2000/08/31 22:52:09 1.2 *************** *** 20,24 **** # Game Over screen tux_load_music game_over music/wonrace1-jt.it ! tux_bind_music game_over game_over 0 --- 20,24 ---- # Game Over screen tux_load_music game_over music/wonrace1-jt.it ! tux_bind_music game_over game_over 1 *************** *** 48,49 **** --- 48,66 ---- tux_load_sound lookout2 sounds/lookout2-jb.wav tux_bind_sounds going_to_collide lookout1 lookout2 + + # Sky Cube + tux_load_texture alpine1-front courses/common/alpine1-front.rgb + tux_load_texture alpine1-right courses/common/alpine1-right.rgb + tux_load_texture alpine1-left courses/common/alpine1-left.rgb + tux_load_texture alpine1-back courses/common/alpine1-back.rgb + tux_load_texture alpine1-top courses/common/alpine1-top.rgb + tux_load_texture alpine1-bottom courses/common/alpine1-bottom.rgb + + tux_bind_texture sky_front alpine1-front + tux_bind_texture sky_right alpine1-right + tux_bind_texture sky_left alpine1-left + tux_bind_texture sky_back alpine1-back + tux_bind_texture sky_top alpine1-top + tux_bind_texture sky_bottom alpine1-bottom + + |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:53:25
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv3517 Modified Files: start_screen.c Log Message: Added call to reshape() in start_screen_init() so that far clip plane is moved back before any rendering occures. Index: start_screen.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/start_screen.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** start_screen.c 2000/08/14 22:22:01 1.8 --- start_screen.c 2000/08/31 15:53:22 1.9 *************** *** 68,71 **** --- 68,73 ---- play_music( "start_screen" ); + + reshape( getparam_x_resolution(), getparam_y_resolution() ); } |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:48:59
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv3144 Modified Files: game_over.c intro.c paused.c racing.c Log Message: Added calls to draw_fog_plane(). Index: game_over.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/game_over.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** game_over.c 2000/08/26 23:50:17 1.9 --- game_over.c 2000/08/31 15:48:56 1.10 *************** *** 71,75 **** getparam_forward_clip_distance() ); ! draw_sky(plyr->view.pos); set_course_clipping( True ); --- 71,77 ---- getparam_forward_clip_distance() ); ! draw_sky(plyr->view.pos); ! ! draw_fog_plane( plyr->view ); set_course_clipping( True ); Index: intro.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/intro.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** intro.c 2000/08/26 23:35:00 1.9 --- intro.c 2000/08/31 15:48:56 1.10 *************** *** 82,85 **** --- 82,87 ---- draw_sky( plyr->view.pos ); + draw_fog_plane( plyr->view ); + set_course_clipping( True ); set_course_eye_point( plyr->view.pos ); Index: paused.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/paused.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** paused.c 2000/08/26 23:50:17 1.5 --- paused.c 2000/08/31 15:48:56 1.6 *************** *** 73,76 **** --- 73,77 ---- draw_sky( plyr->view.pos ); + draw_fog_plane( plyr->view ); set_course_clipping( True ); Index: racing.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/racing.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** racing.c 2000/08/28 00:53:07 1.14 --- racing.c 2000/08/31 15:48:56 1.15 *************** *** 223,226 **** --- 223,228 ---- draw_sky(plyr->view.pos); + draw_fog_plane( plyr->view ); + set_course_clipping( True ); set_course_eye_point( plyr->view.pos ); *************** *** 229,234 **** --- 231,238 ---- draw_trees(); + draw_tux(); draw_tux_shadow(); + if ( getparam_draw_particles() ) { |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:47:47
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv2917 Modified Files: course_render.c course_render.h Log Message: - Added routine to draw the fog plane - Cleaned up the rest of the code a bit Index: course_render.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_render.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** course_render.c 2000/08/26 23:29:31 1.12 --- course_render.c 2000/08/31 15:47:43 1.13 *************** *** 29,32 **** --- 29,33 ---- #include "fog.h" #include "course_quad.h" + #include "viewfrustum.h" /* *************** *** 299,308 **** setup_course_lighting(); - - glShadeModel( GL_SMOOTH ); } else { glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); set_material( white, black, 0.0 ); - glShadeModel( GL_FLAT ); } --- 300,306 ---- *************** *** 524,533 **** setup_course_lighting(); - - glShadeModel( GL_SMOOTH ); } else { glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); set_material( white, black, 0.0 ); - glShadeModel( GL_FLAT ); } --- 522,528 ---- *************** *** 585,594 **** setup_course_lighting(); - - glShadeModel( GL_SMOOTH ); } else { glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); set_material( white, black, 0.0 ); - glShadeModel( GL_FLAT ); } --- 580,586 ---- *************** *** 625,643 **** glVertex3f( -treeRadius, treeHeight, 0.0 ); ! if ( clip_course ) { ! if ( eye_pt.z - treeLocs[i].ray.pt.z > fwd_tree_detail_limit ) ! goto End_Quads; } - glTexCoord2f( 0., 0. ); - glVertex3f( 0.0, 0.0, -treeRadius ); - glTexCoord2f( 1., 0. ); - glVertex3f( 0.0, 0.0, treeRadius ); - glTexCoord2f( 1., 1. ); - glVertex3f( 0.0, treeHeight, treeRadius ); - glTexCoord2f( 0., 1. ); - glVertex3f( 0.0, treeHeight, -treeRadius ); - - End_Quads: glEnd(); glPopMatrix(); --- 617,633 ---- glVertex3f( -treeRadius, treeHeight, 0.0 ); ! if ( !clip_course || ! eye_pt.z - treeLocs[i].ray.pt.z < fwd_tree_detail_limit ) ! { ! glTexCoord2f( 0., 0. ); ! glVertex3f( 0.0, 0.0, -treeRadius ); ! glTexCoord2f( 1., 0. ); ! glVertex3f( 0.0, 0.0, treeRadius ); ! glTexCoord2f( 1., 1. ); ! glVertex3f( 0.0, treeHeight, treeRadius ); ! glTexCoord2f( 0., 1. ); ! glVertex3f( 0.0, treeHeight, -treeRadius ); } glEnd(); glPopMatrix(); *************** *** 645,646 **** --- 635,776 ---- } + + + /*! + Draws a fog plane at the far clipping plane to mask out clipping of terrain. + + \return none + \author jfpatry + \date Created: 2000-08-31 + \date Modified: 2000-08-31 + */ + void draw_fog_plane() + { + plane_t left_edge_plane, right_edge_plane; + plane_t left_clip_plane, right_clip_plane; + plane_t far_clip_plane; + plane_t bottom_clip_plane; + plane_t bottom_plane, top_plane; + + scalar_t course_width, course_length; + scalar_t course_angle, slope; + + point_t left_pt, right_pt, pt; + point_t top_left_pt, top_right_pt; + point_t bottom_left_pt, bottom_right_pt; + vector_t left_vec, right_vec; + scalar_t height; + + GLfloat *fog_colour; + + if ( is_fog_on() == False ) { + return; + } + + set_gl_options( FOG_PLANE ); + + get_course_dimensions( &course_width, &course_length ); + course_angle = get_course_angle(); + slope = tan( course_angle * M_PI / 180.0 ); + + left_edge_plane = make_plane( 1.0, 0.0, 0.0, 0.0 ); + + right_edge_plane = make_plane( -1.0, 0.0, 0.0, course_width ); + + far_clip_plane = get_far_clip_plane(); + left_clip_plane = get_left_clip_plane(); + right_clip_plane = get_right_clip_plane(); + bottom_clip_plane = get_bottom_clip_plane(); + + + /* Find the bottom plane */ + bottom_plane.nml = make_vector( 0.0, 1, -slope ); + height = get_terrain_base_height( 0 ); + + /* Unoptimized version + pt = make_point( 0, height, 0 ); + bottom_plane.d = -( pt.x * bottom_plane.nml.x + + pt.y * bottom_plane.nml.y + + pt.z * bottom_plane.nml.z ); + */ + bottom_plane.d = -height * bottom_plane.nml.y; + + /* Find the top plane */ + top_plane.nml = bottom_plane.nml; + height = get_terrain_max_height( 0 ); + top_plane.d = -height * top_plane.nml.y; + + /* Now find the bottom left and right points of the fog plane */ + if ( !intersect_planes( bottom_plane, far_clip_plane, left_clip_plane, + &left_pt ) ) + { + return; + } + + if ( !intersect_planes( bottom_plane, far_clip_plane, right_clip_plane, + &right_pt ) ) + { + return; + } + + if ( !intersect_planes( top_plane, far_clip_plane, left_clip_plane, + &top_left_pt ) ) + { + return; + } + + if ( !intersect_planes( top_plane, far_clip_plane, right_clip_plane, + &top_right_pt ) ) + { + return; + } + + if ( !intersect_planes( bottom_clip_plane, far_clip_plane, + left_clip_plane, &bottom_left_pt ) ) + { + return; + } + + if ( !intersect_planes( bottom_clip_plane, far_clip_plane, + right_clip_plane, &bottom_right_pt ) ) + { + return; + } + + left_vec = subtract_points( top_left_pt, left_pt ); + right_vec = subtract_points( top_right_pt, right_pt ); + + + /* Now draw the fog plane */ + + set_gl_options( FOG_PLANE ); + + fog_colour = get_fog_colour(); + + glColor4fv( fog_colour ); + + glBegin( GL_QUAD_STRIP ); + + glVertex3f( bottom_left_pt.x, bottom_left_pt.y, bottom_left_pt.z ); + glVertex3f( bottom_right_pt.x, bottom_right_pt.y, bottom_right_pt.z ); + glVertex3f( left_pt.x, left_pt.y, left_pt.z ); + glVertex3f( right_pt.x, right_pt.y, right_pt.z ); + + glColor4f( fog_colour[0], fog_colour[1], fog_colour[2], 0.9 ); + glVertex3f( top_left_pt.x, top_left_pt.y, top_left_pt.z ); + glVertex3f( top_right_pt.x, top_right_pt.y, top_right_pt.z ); + + glColor4f( fog_colour[0], fog_colour[1], fog_colour[2], 0.3 ); + pt = move_point( top_left_pt, left_vec ); + glVertex3f( pt.x, pt.y, pt.z ); + pt = move_point( top_right_pt, right_vec ); + glVertex3f( pt.x, pt.y, pt.z ); + + glColor4f( fog_colour[0], fog_colour[1], fog_colour[2], 0.0 ); + pt = move_point( top_left_pt, scale_vector( 3.0, left_vec ) ); + glVertex3f( pt.x, pt.y, pt.z ); + pt = move_point( top_right_pt, scale_vector( 3.0, right_vec ) ); + glVertex3f( pt.x, pt.y, pt.z ); + + glEnd(); + } Index: course_render.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/course_render.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** course_render.h 2000/08/15 03:08:12 1.5 --- course_render.h 2000/08/31 15:47:43 1.6 *************** *** 40,43 **** --- 40,44 ---- void set_course_lighting( bool_t state ); bool_t get_course_lighting(); + void draw_fog_plane(); #endif |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:45:30
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv2665 Modified Files: viewfrustum.c viewfrustum.h Log Message: Added functions to access the far, left, right, and bottom VFC planes. Index: viewfrustum.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/viewfrustum.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** viewfrustum.c 2000/08/09 15:01:54 1.3 --- viewfrustum.c 2000/08/31 15:45:27 1.4 *************** *** 170,171 **** --- 170,191 ---- return NoClip; } + + plane_t get_far_clip_plane() + { + return frustum_planes[1]; + } + + plane_t get_left_clip_plane() + { + return frustum_planes[2]; + } + + plane_t get_right_clip_plane() + { + return frustum_planes[3]; + } + + plane_t get_bottom_clip_plane() + { + return frustum_planes[5]; + } Index: viewfrustum.h =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/viewfrustum.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** viewfrustum.h 2000/03/14 04:12:31 1.2 --- viewfrustum.h 2000/08/31 15:45:28 1.3 *************** *** 38,41 **** --- 38,46 ---- clip_result_t clip_aabb_to_view_frustum( point_t min, point_t max ); + plane_t get_far_clip_plane(); + plane_t get_left_clip_plane(); + plane_t get_right_clip_plane(); + plane_t get_bottom_clip_plane(); + #endif /* _VIEWFRUSTUM_H_ */ |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:44:46
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv2588 Modified Files: view.c Log Message: Placed a limit on the camera interpolation speed to try to minimize camera "jumps" during the occaisonal long frame. Index: view.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/view.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** view.c 2000/08/28 03:48:28 1.4 --- view.c 2000/08/31 15:44:43 1.5 *************** *** 58,61 **** --- 58,65 ---- #define FOLLOW_ORIENT_TIME_CONSTANT 0.08 + /* This places an upper limit on the interpolation, which prevent excessive + "jumping" of the camera during the occaisonal slow frame */ + #define MAX_INTERPOLATION_VALUE 0.3 + /* Speed above which interpolation is "normal" (m/s) */ #define BASELINE_INTERPOLATION_SPEED 4.5 *************** *** 171,175 **** q2 = make_rotation_quaternion( y_vec, vec2 ); ! alpha = 1.0 - exp ( -dt / time_constant ); q2 = interpolate_quaternions( q1, q2, alpha ); --- 175,180 ---- q2 = make_rotation_quaternion( y_vec, vec2 ); ! alpha = min( MAX_INTERPOLATION_VALUE, ! 1.0 - exp ( -dt / time_constant ) ); q2 = interpolate_quaternions( q1, q2, alpha ); *************** *** 253,257 **** q2 = make_quaternion_from_matrix( cob_mat2 ); ! alpha = 1.0 - exp( -dt / time_constant ); q2 = interpolate_quaternions( q1, q2, alpha ); --- 258,263 ---- q2 = make_quaternion_from_matrix( cob_mat2 ); ! alpha = min( MAX_INTERPOLATION_VALUE, ! 1.0 - exp( -dt / time_constant ) ); q2 = interpolate_quaternions( q1, q2, alpha ); |
From: Jasmin P. <jf...@us...> - 2000-08-31 15:43:43
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv2513 Modified Files: gl_util.c part_sys.c tux.c Log Message: Centralized setting of glShadeModel in gl_util.c Index: gl_util.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/gl_util.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** gl_util.c 2000/08/31 15:32:05 1.6 --- gl_util.c 2000/08/31 15:43:40 1.7 *************** *** 39,42 **** --- 39,43 ---- Other Functions: glDepthMask + glShadeModel */ *************** *** 60,63 **** --- 61,65 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_FLAT ); break; *************** *** 74,77 **** --- 76,80 ---- glEnable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); *************** *** 91,94 **** --- 94,98 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); glAlphaFunc( GL_GEQUAL, 0.9 ); *************** *** 107,110 **** --- 111,115 ---- glEnable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); *************** *** 125,128 **** --- 130,134 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); break; *************** *** 140,143 **** --- 146,150 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); break; *************** *** 154,157 **** --- 161,165 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_FALSE ); + glShadeModel( GL_SMOOTH ); break; *************** *** 168,171 **** --- 176,180 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); break; *************** *** 182,185 **** --- 191,195 ---- glDisable( GL_TEXTURE_GEN_T ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); break; *************** *** 196,199 **** --- 206,210 ---- glEnable( GL_STENCIL_TEST ); glDepthMask( GL_FALSE ); + glShadeModel( GL_SMOOTH ); glStencilFunc( GL_EQUAL, 0, ~0 ); *************** *** 209,212 **** --- 220,224 ---- glDisable( GL_STENCIL_TEST ); glDepthMask( GL_TRUE ); + glShadeModel( GL_SMOOTH ); #endif break; Index: part_sys.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/part_sys.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** part_sys.c 2000/08/15 03:08:12 1.5 --- part_sys.c 2000/08/31 15:43:40 1.6 *************** *** 200,207 **** setup_course_lighting(); - glShadeModel( GL_SMOOTH ); } else { glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); - glShadeModel( GL_FLAT ); } --- 200,205 ---- Index: tux.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/tux.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** tux.c 2000/08/28 00:53:07 1.7 --- tux.c 2000/08/31 15:43:40 1.8 *************** *** 158,166 **** setup_course_lighting(); - glShadeModel( GL_SMOOTH ); - draw_scene_graph( tuxRootNode ); - - glShadeModel( GL_FLAT ); } --- 158,162 ---- |