TORCS  1.3.9
The Open Racing Car Simulator
grcar.cpp File Reference
#include <math.h>
#include <stdlib.h>
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <GL/glut.h>
#include <plib/ssg.h>
#include <tgfclient.h>
#include <track.h>
#include <car.h>
#include <graphic.h>
#include <robottools.h>
#include <portability.h>
#include "grmain.h"
#include "grshadow.h"
#include "grskidmarks.h"
#include "grsmoke.h"
#include "grcar.h"
#include "grcam.h"
#include "grscene.h"
#include "grboard.h"
#include "grssgext.h"
#include "grutil.h"
#include "grcarlight.h"
Include dependency graph for grcar.cpp:

Go to the source code of this file.

Macros

#define BRK_BRANCH   16
 
#define BRK_ANGLE   (2.0 * M_PI / (tdble)BRK_BRANCH)
 
#define BRK_OFFSET   0.2
 
#define MULT   1.1
 

Functions

ssgEntity * grssgLoadAC3D (const char *fname, const ssgLoaderOptions *options)
 
ssgEntity * grssgCarLoadAC3D (const char *fname, const ssgLoaderOptions *options, int index)
 
void grInitCommonState (void)
 
static ssgTransform * initWheel (tCarElt *car, int wheel_index)
 
void grInitShadow (tCarElt *car)
 
void grPropagateDamage (ssgEntity *l, sgVec3 poc, sgVec3 force, int cnt)
 
void grInitCar (tCarElt *car)
 
static void grDrawShadow (tCarElt *car, int visible)
 
tdble grGetDistToStart (tCarElt *car)
 
void grDrawCar (tCarElt *car, tCarElt *curCar, int dispCarFlag, int dispDrvFlag, double curTime, class cGrPerspCamera *curCam)
 

Variables

double carTrackRatioX
 
double carTrackRatioY
 
ssgBranch * CarsAnchorTmp = 0
 
static int grCarIndex
 
static ssgSimpleState * brakeState = NULL
 
static ssgSimpleState * commonState = NULL
 
static const int GR_SHADOW_POINTS = 6
 

Macro Definition Documentation

◆ BRK_ANGLE

#define BRK_ANGLE   (2.0 * M_PI / (tdble)BRK_BRANCH)

◆ BRK_BRANCH

#define BRK_BRANCH   16

◆ BRK_OFFSET

#define BRK_OFFSET   0.2

◆ MULT

#define MULT   1.1

Function Documentation

◆ grDrawCar()

void grDrawCar ( tCarElt car,
tCarElt curCar,
int  dispCarFlag,
int  dispDrvFlag,
double  curTime,
class cGrPerspCamera curCam 
)

Definition at line 761 of file grcar.cpp.

Here is the call graph for this function:

◆ grDrawShadow()

static void grDrawShadow ( tCarElt car,
int  visible 
)
static

Definition at line 709 of file grcar.cpp.

Here is the call graph for this function:

◆ grGetDistToStart()

tdble grGetDistToStart ( tCarElt car)

Definition at line 739 of file grcar.cpp.

◆ grInitCar()

void grInitCar ( tCarElt car)

Definition at line 513 of file grcar.cpp.

Here is the call graph for this function:

◆ grInitCommonState()

void grInitCommonState ( void  )

Definition at line 64 of file grcar.cpp.

◆ grInitShadow()

void grInitShadow ( tCarElt car)

Definition at line 416 of file grcar.cpp.

Here is the call graph for this function:

◆ grPropagateDamage()

void grPropagateDamage ( ssgEntity *  l,
sgVec3  poc,
sgVec3  force,
int  cnt 
)

Definition at line 477 of file grcar.cpp.

Here is the call graph for this function:

◆ grssgCarLoadAC3D()

ssgEntity* grssgCarLoadAC3D ( const char *  fname,
const ssgLoaderOptions *  options,
int  index 
)

Definition at line 1115 of file grloadac.cpp.

Here is the call graph for this function:

◆ grssgLoadAC3D()

ssgEntity* grssgLoadAC3D ( const char *  fname,
const ssgLoaderOptions *  options 
)

Definition at line 1149 of file grloadac.cpp.

◆ initWheel()

static ssgTransform* initWheel ( tCarElt car,
int  wheel_index 
)
static

Definition at line 86 of file grcar.cpp.

Here is the call graph for this function:

Variable Documentation

◆ brakeState

ssgSimpleState* brakeState = NULL
static

Definition at line 61 of file grcar.cpp.

◆ CarsAnchorTmp

ssgBranch* CarsAnchorTmp = 0

Definition at line 56 of file grcar.cpp.

◆ carTrackRatioX

double carTrackRatioX

Definition at line 49 of file grloadac.cpp.

◆ carTrackRatioY

double carTrackRatioY

Definition at line 50 of file grloadac.cpp.

◆ commonState

ssgSimpleState* commonState = NULL
static

Definition at line 62 of file grcar.cpp.

◆ GR_SHADOW_POINTS

const int GR_SHADOW_POINTS = 6
static

Definition at line 414 of file grcar.cpp.

◆ grCarIndex

int grCarIndex
static

Definition at line 59 of file grcar.cpp.