![]() |
torcs - 1.2.2 | ![]() |
00001 /*************************************************************************** 00002 00003 file : susp.h 00004 created : Sun Mar 19 00:08:53 CET 2000 00005 copyright : (C) 2000 by Eric Espie 00006 email : torcs@free.fr 00007 version : $Id: susp.h,v 1.5 2004/01/15 09:54:06 olethros Exp $ 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 ***************************************************************************/ 00019 00020 #ifndef _SUSP_H__ 00021 #define _SUSP_H__ 00022 00023 00024 typedef struct 00025 { 00026 tdble C1, b1, v1; /* coefs for slow */ 00027 tdble C2, b2; /* coefs for fast */ 00028 } tDamperDef; 00029 00030 typedef struct 00031 { 00032 tDamperDef bump; 00033 tDamperDef rebound; 00034 } tDamper; 00035 00036 typedef struct 00037 { 00038 tdble K; /* spring coef */ 00039 tdble F0; /* initial force */ 00040 tdble x0; /* initial suspension travel */ 00041 tdble xMax; /* maxi suspension travel */ 00042 tdble bellcrank; /* ratio of movement between wheel and suspension */ 00043 tdble packers; /* packer size (min susp. travel) */ 00044 } tSpring; 00045 00046 00047 typedef enum SuspensionType { 00048 Ideal, Simple, Wishbone 00049 } eSuspensionType; 00050 00051 00052 typedef struct Suspension 00053 { 00054 tSpring spring; 00055 tDamper damper; 00056 00057 tdble x; /* suspension travel */ 00058 tdble v; /* suspension travel speed */ 00059 tdble fx; // pure elastic collision 00060 tdble fy; // pure elastic collision 00061 eSuspensionType type; 00062 t3Dd dynamic_angles; 00063 t3Dd link; 00064 tdble force; /* generated force */ 00065 int state; /* indicate the state of the suspension */ 00066 #define SIM_SUSP_COMP 1 /* the suspension is fully compressed */ 00067 #define SIM_SUSP_EXT 2 /* the suspension is fully extended */ 00068 00069 } tSuspension; 00070 00071 00072 #endif /* _SUSP_H__ */ 00073 00074 00075