1 /* 2 * Tux Racer 3 * Copyright (C) 1999-2001 Jasmin F. Patry 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 19 20 #ifdef __cplusplus 21 extern "C" 22 { 23 #endif 24 25 #ifndef _PHYS_SIM_H_ 26 #define _PHYS_SIM_H_ 27 28 #include "course_load.h" 29 30 /* Acceleration due to gravity m/s^2 */ 31 #define EARTH_GRAV 9.81 32 33 #define M_PER_SEC_TO_KM_PER_H 3.6 34 35 #define KM_PER_H_TO_M_PER_SEC ( 1.0 / M_PER_SEC_TO_KM_PER_H ) 36 37 /* Speed at which paddling ceases to be effective (m/s) */ 38 #define MAX_PADDLING_SPEED ( 60.0 * KM_PER_H_TO_M_PER_SEC ) 39 40 /* Time over which constant jump force is applied */ 41 #define JUMP_FORCE_DURATION 0.20 42 43 44 void increment_turn_fact( player_data_t *plyr, scalar_t amt ); 45 void set_gravity( bool_t low ); 46 void set_friction_coeff( scalar_t fric[3] ); 47 void set_friction( bool_t useFriction ); 48 scalar_t get_min_y_coord(); 49 vector_t find_course_normal( scalar_t x, scalar_t z ); 50 scalar_t find_y_coord( scalar_t x, scalar_t z ); 51 void get_surface_type( scalar_t x, scalar_t z, scalar_t weights[] ); 52 plane_t get_local_course_plane( point_t pt ); 53 scalar_t get_compression_depth( terrain_t surf_type ); 54 void set_tux_pos( player_data_t *plyr, point_t newPos ); 55 void update_player_pos( player_data_t *plyr, scalar_t dtime ); 56 void init_physical_simulation(); 57 58 #endif /* _PHYS_SIM_H_ */ 59 60 #ifdef __cplusplus 61 } /* extern "C" */ 62 #endif 63