Back to index

extremetuxracer  0.5beta
phys_sim.h
Go to the documentation of this file.
00001 /* 
00002  * PPRacer 
00003  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00004  * 
00005  * Copyright (C) 1999-2001 Jasmin F. Patry
00006  * 
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020  */
00021 
00022 #ifndef _PHYS_SIM_H_
00023 #define _PHYS_SIM_H_
00024 
00025 #include "course_load.h"
00026 
00027 #include "player.h"
00028 
00029 #include "ppgltk/alg/plane.h"
00030 
00031 /* Acceleration due to gravity m/s^2 */
00032 #define EARTH_GRAV 9.81
00033 
00034 #define M_PER_SEC_TO_KM_PER_H 3.6
00035 
00036 #define KM_PER_H_TO_M_PER_SEC ( 1.0 / M_PER_SEC_TO_KM_PER_H )
00037 
00038 /* Speed at which paddling ceases to be effective (m/s) */
00039 #define MAX_PADDLING_SPEED ( 60.0 * KM_PER_H_TO_M_PER_SEC ) 
00040 
00041 /* Time over which constant jump force is applied */
00042 #define JUMP_FORCE_DURATION 0.20
00043 
00044 void   set_wind_velocity(pp::Vec3d velocity, float scale);
00045 void      increment_turn_fact( Player& plyr, float amt );
00046 //void      set_gravity( bool low );
00047 void      set_friction_coeff( const float fric[3] ); 
00048 //void      set_friction( const bool useFriction );
00049 float  get_min_y_coord();
00050 pp::Vec3d  find_course_normal( const float x, const float z );
00051 float  find_y_coord( float x, float z );
00052 void      get_surface_type( float x, float z, float weights[] );
00053 pp::Plane   get_local_course_plane( pp::Vec3d pt );
00054 float  get_compression_depth( const int terrain ); 
00055 void      set_tux_pos( Player& plyr, pp::Vec3d newPos );
00056 void      update_player_pos( Player& plyr, float dtime );
00057 void      init_physical_simulation();
00058 
00059 #endif // _PHYS_SIM_H_