ssgraph - now can have separate models for front & back wheels

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@1044 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ba41261608ed4ea0b2ad5cd88c6c399b5646faef
Former-commit-id: 4e0e29b47c62d83b274640fe1d10df4aad347340
This commit is contained in:
andrewsumner 2009-07-02 22:57:06 +00:00
parent a8d931637a
commit 0b9f0c3d9f
2 changed files with 31 additions and 5 deletions

View file

@ -596,9 +596,11 @@ typedef struct CarElt
#define PRM_SPEEDO_MAXVAL "speedometer max value"
#define PRM_SPEEDO_MINANG "speedometer min angle"
#define PRM_SPEEDO_MAXANG "speedometer max angle"
#define PRM_SPEEDO_DIGITAL "speedometer digital"
#define PRM_SPEEDO_DIGITAL "speedometer digital"
#define PRM_WHEEL_3D "3d wheel"
#define PRM_WHEEL_3D "3d wheel"
#define PRM_FRONT_WHEEL_3D "3d front wheel"
#define PRM_REAR_WHEEL_3D "3d rear wheel"
/* Lights */
#define VAL_LIGHT_HEAD1 "head1"

View file

@ -682,16 +682,40 @@ grInitCar(tCarElt *car)
/*if (grCarInfo[grCarIndex].wheelTexture->getRef() > 0)
grCarInfo[grCarIndex].wheelTexture->deRef();*/
grCarInfo[index].wheelTexture = 0;
const char *wheelFront3DModFileNamePrfx =
GfParmGetStr(handle, SECT_GROBJECTS, PRM_FRONT_WHEEL_3D, "");
const char *wheelRear3DModFileNamePrfx =
GfParmGetStr(handle, SECT_GROBJECTS, PRM_REAR_WHEEL_3D, "");
const char *wheel3DModFileNamePrfx =
GfParmGetStr(handle, SECT_GROBJECTS, PRM_WHEEL_3D, "wheel");
grGammaValue = 1.8;
grMipMap = 0;
for (i = 0; i < 4; i++){
wheel[i] = initWheel(car, i, wheel3DModFileNamePrfx);
carBody->addKid(wheel[i]);
if (*wheelFront3DModFileNamePrfx)
{
wheel[FRNT_RGT] = initWheel(car, FRNT_RGT, wheelFront3DModFileNamePrfx);
wheel[FRNT_LFT] = initWheel(car, FRNT_LFT, wheelFront3DModFileNamePrfx);
}
else
{
wheel[FRNT_RGT] = initWheel(car, FRNT_RGT, wheel3DModFileNamePrfx);
wheel[FRNT_LFT] = initWheel(car, FRNT_LFT, wheel3DModFileNamePrfx);
}
if (*wheelRear3DModFileNamePrfx)
{
wheel[REAR_RGT] = initWheel(car, REAR_RGT, wheelRear3DModFileNamePrfx);
wheel[REAR_LFT] = initWheel(car, REAR_LFT, wheelRear3DModFileNamePrfx);
}
else
{
wheel[REAR_RGT] = initWheel(car, REAR_RGT, wheel3DModFileNamePrfx);
wheel[REAR_LFT] = initWheel(car, REAR_LFT, wheel3DModFileNamePrfx);
}
for (i = 0; i < 4; i++)
carBody->addKid(wheel[i]);
grCarInfo[index].LODSelectMask[0] = 1 << selIndex; /* car mask */
selIndex++;