- fix bug with background-sky & sky (was not displayed with driver's view with transparent windshield)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6609 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 6506dc63ee246d4b2055fbe12d0dd91a3f1e9173 Former-commit-id: d1bccea57acbc77cfefe9a13f0e381e445e621d6
This commit is contained in:
parent
d0a3289fff
commit
285c462c4f
5 changed files with 503 additions and 524 deletions
|
@ -6,64 +6,37 @@ SET(ROBOT_NAME "shadow")
|
|||
# Official-only shadow interface.
|
||||
SET(ROBOT_INTERFACE LEGACY WELCOME)
|
||||
|
||||
SET(ROBOT_SOURCES src/Array.h
|
||||
src/AveragedData.cpp
|
||||
src/AveragedData.h
|
||||
src/Avoidance.cpp
|
||||
src/Avoidance.h
|
||||
src/CarModel.cpp
|
||||
src/CarModel.h
|
||||
src/ClothoidPath.cpp
|
||||
src/ClothoidPath.h
|
||||
src/Cubic.cpp
|
||||
src/Cubic.h
|
||||
src/CubicSpline.cpp
|
||||
src/CubicSpline.h
|
||||
src/GenericAvoidance.cpp
|
||||
src/GenericAvoidance.h
|
||||
src/LearnedGraph.cpp
|
||||
src/LearnedGraph.h
|
||||
src/LinearRegression.cpp
|
||||
src/LinearRegression.h
|
||||
src/LinePath.cpp
|
||||
src/LinePath.h
|
||||
src/Driver.cpp
|
||||
src/Driver.h
|
||||
src/MyTrack.cpp
|
||||
src/MyTrack.h
|
||||
src/Opponent.cpp
|
||||
src/Opponent.h
|
||||
src/OptimisedPath.cpp
|
||||
src/OptimisedPath.h
|
||||
src/ParametricCubic.cpp
|
||||
src/ParametricCubic.h
|
||||
src/Path.cpp
|
||||
src/Path.h
|
||||
src/PathRecord.cpp
|
||||
src/PathRecord.h
|
||||
src/PidController.cpp
|
||||
src/PidController.h
|
||||
src/PitPath.cpp
|
||||
src/PitPath.h
|
||||
src/PtInfo.cpp
|
||||
src/PtInfo.h
|
||||
src/Quadratic.cpp
|
||||
src/Quadratic.h
|
||||
src/Seg.cpp
|
||||
src/Seg.h
|
||||
src/Shadow.cpp
|
||||
src/Shared.cpp
|
||||
src/Shared.h
|
||||
src/Span.cpp
|
||||
src/Span.h
|
||||
src/Strategy.cpp
|
||||
src/Strategy.h
|
||||
src/TeamInfo.cpp
|
||||
src/TeamInfo.h
|
||||
src/Utils.cpp
|
||||
src/Utils.h
|
||||
src/Vec2d.h
|
||||
src/Vec3d.h)
|
||||
SET(ROBOT_SOURCES
|
||||
src/ClothoidPath.cpp
|
||||
src/ClothoidPath.h
|
||||
src/cubic.cpp
|
||||
src/cubic.h
|
||||
src/danpath.cpp
|
||||
src/danpath.h
|
||||
src/driver.cpp
|
||||
src/driver.h
|
||||
src/globaldefinitions.h
|
||||
src/LinePath.cpp
|
||||
src/LinePath.h
|
||||
src/MyTrack.cpp
|
||||
src/MyTrack.h
|
||||
src/opponent.cpp
|
||||
src/opponent.h
|
||||
src/pidcontroller.cpp
|
||||
src/pidcontroller.h
|
||||
src/pit.cpp
|
||||
src/pit.h
|
||||
src/Seg.h
|
||||
src/Shadow.cpp
|
||||
src/spline.cpp
|
||||
src/spline.h
|
||||
#src/Strategy.cpp
|
||||
#src/Strategy.h
|
||||
src/torcs_or_sd.h
|
||||
src/Utils.cpp
|
||||
src/Utils.h
|
||||
src/Vec2d.h
|
||||
src/Vec3d.h)
|
||||
|
||||
# Official-only shadow instances.
|
||||
SET(ROBOT_CLONES shadow_36GP shadow_67GP shadow_sc shadow_srw shadow_trb1 shadow_ls1 shadow_ls2 shadow_mp5
|
||||
|
|
|
@ -835,7 +835,7 @@ void grLoadBackgroundSky(void)
|
|||
sgCoord BackSkypos;
|
||||
sgSetCoord(&BackSkypos, grWrldX/2, grWrldY/2, 0, 0, 0, 0);
|
||||
BackSkyLoc->setTransform(&BackSkypos);
|
||||
BackSkyAnchor->addKid(BackSkyLoc);
|
||||
BackSkyAnchor->addKid(BackSkyLoc);
|
||||
}
|
||||
|
||||
void grLoadBackgroundLand(void)
|
||||
|
@ -857,25 +857,25 @@ void grLoadBackgroundLand(void)
|
|||
void
|
||||
grPreDrawBackgroundSky(class cGrCamera *cam)
|
||||
{
|
||||
sgMat4 T;
|
||||
sgMat4 T;
|
||||
|
||||
sgVec3 posview;
|
||||
memcpy(&posview, cam->getCenterv(), sizeof(posview));
|
||||
sgVec3 posview;
|
||||
memcpy(&posview, cam->getCenterv(), sizeof(posview));
|
||||
|
||||
sgMakeTransMat4( T, posview );
|
||||
sgMat4 TRANSFORM;
|
||||
sgMakeTransMat4( T, posview );
|
||||
sgMat4 TRANSFORM;
|
||||
|
||||
sgCopyMat4( TRANSFORM, T );
|
||||
sgCopyMat4( TRANSFORM, T );
|
||||
|
||||
sgCoord backgroundpos;
|
||||
sgSetCoord( &backgroundpos, TRANSFORM );
|
||||
BackSkyLoc->setTransform(&backgroundpos);
|
||||
sgCoord backgroundpos;
|
||||
sgSetCoord( &backgroundpos, TRANSFORM );
|
||||
BackSkyLoc->setTransform(&backgroundpos);
|
||||
}
|
||||
|
||||
void
|
||||
grDrawBackgroundSky(void)
|
||||
{
|
||||
ssgCullAndDraw(BackSkyAnchor);
|
||||
ssgCullAndDraw(BackSkyAnchor);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -883,7 +883,7 @@ grPreDrawSky(tSituation* s, float fogStart, float fogEnd, class cGrCamera *cam)
|
|||
{
|
||||
static const double m_log01 = -log( 0.01 );
|
||||
static const double sqrt_m_log01 = sqrt( m_log01 );
|
||||
GLbitfield clear_mask;
|
||||
GLbitfield clear_mask;
|
||||
|
||||
if (grSkyDomeDistance )
|
||||
{
|
||||
|
@ -898,12 +898,12 @@ grPreDrawSky(tSituation* s, float fogStart, float fogEnd, class cGrCamera *cam)
|
|||
glHint(GL_FOG_HINT, GL_DONT_CARE);
|
||||
|
||||
ssgGetLight(0)->setColour(GL_DIFFUSE, White);
|
||||
clear_mask |= GL_COLOR_BUFFER_BIT;
|
||||
glClear( clear_mask );
|
||||
clear_mask |= GL_COLOR_BUFFER_BIT;
|
||||
glClear( clear_mask );
|
||||
|
||||
sgVec3 posview;
|
||||
memcpy(&posview, cam->getCenterv(), sizeof(posview));
|
||||
TheSky->repositionFlat(posview, 0, 0);
|
||||
sgVec3 posview;
|
||||
memcpy(&posview, cam->getCenterv(), sizeof(posview));
|
||||
TheSky->repositionFlat(posview, 0, 0);
|
||||
|
||||
TheSky->preDraw();
|
||||
|
||||
|
@ -958,7 +958,7 @@ grUpdateSky(double currentTime, double accelTime)
|
|||
if (!bInitialized)
|
||||
{
|
||||
if (grSkyDomeDistance )
|
||||
{
|
||||
{
|
||||
// Ensure the sun and moon positions are reset
|
||||
const int timeOfDay = (int)grTrack->local.timeofday;
|
||||
GLfloat sunAscension = grTrack->local.sunascension;
|
||||
|
@ -1229,4 +1229,4 @@ void grUpdateFogColor(double sol_angle)
|
|||
// used by the rest of the program.
|
||||
//
|
||||
grGammaCorrectRGB( BaseFogColor );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ ssgRoot *TheScene = NULL;
|
|||
|
||||
// TheScene kids order (but some others in background.cpp)
|
||||
ssgBranch *LandAnchor = NULL;
|
||||
ssgBranch *BackSkyAnchor = NULL;
|
||||
ssgTransform *BackSkyLoc = NULL;
|
||||
ssgBranch *CarsAnchor = NULL;
|
||||
ssgBranch *ShadowAnchor = NULL;
|
||||
ssgBranch *PitsAnchor = NULL;
|
||||
|
@ -65,8 +67,7 @@ ssgBranch *SkidAnchor = NULL;
|
|||
ssgBranch *CarlightAnchor = NULL;
|
||||
ssgBranch *TrackLightAnchor = NULL;
|
||||
ssgBranch *ThePits = NULL;
|
||||
ssgRoot *BackSkyAnchor = NULL;
|
||||
ssgTransform *BackSkyLoc = NULL;
|
||||
|
||||
|
||||
// Must have (Question: What for ?)
|
||||
int preScene(ssgEntity *e)
|
||||
|
@ -150,10 +151,10 @@ grLoadScene(tTrack *track)
|
|||
TheScene = new ssgRoot;
|
||||
|
||||
/* Background Sky */
|
||||
BackSkyAnchor = new ssgRoot;
|
||||
BackSkyAnchor = new ssgBranch;
|
||||
BackSkyLoc = new ssgTransform;
|
||||
BackSkyAnchor->addKid(BackSkyLoc);
|
||||
//TheScene->addKid(BackSkyLoc);
|
||||
TheScene->addKid(BackSkyAnchor);
|
||||
|
||||
/* Landscape */
|
||||
LandAnchor = new ssgBranch;
|
||||
|
|
|
@ -40,6 +40,8 @@ extern tTrack *grTrack;
|
|||
|
||||
extern ssgRoot *TheScene;
|
||||
extern ssgBranch *LandAnchor;
|
||||
extern ssgBranch *BackSkyAnchor;
|
||||
extern ssgTransform *BackSkyLoc;
|
||||
extern ssgBranch *CarsAnchor;
|
||||
extern ssgBranch *ShadowAnchor;
|
||||
extern ssgBranch *PitsAnchor;
|
||||
|
@ -48,8 +50,8 @@ extern ssgBranch *SkidAnchor;
|
|||
extern ssgBranch *CarlightAnchor;
|
||||
extern ssgBranch *TrackLightAnchor;
|
||||
extern ssgBranch *ThePits;
|
||||
extern ssgRoot *BackSkyAnchor;
|
||||
extern ssgTransform *BackSkyLoc;
|
||||
|
||||
|
||||
|
||||
extern ssgStateSelector *grEnvSelector;
|
||||
extern cgrMultiTexState *grEnvState;
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue