forked from speed-dreams/speed-dreams-code
- Update Sky (OsgGraph)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5964 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 262a52a218ec9001a3e927e31e184558d8fc455d Former-commit-id: a438052e74473f21f37f2142c1feddf27afc5b8a
This commit is contained in:
parent
869c9ca19e
commit
546639cd4e
11 changed files with 26 additions and 24 deletions
|
@ -583,7 +583,7 @@ void TDriver::NewRace( tCarElt* pCar, tSituation* pS )
|
||||||
char* pTrackName = strrchr(m_track.GetTrack()->filename, '/') + 1;
|
char* pTrackName = strrchr(m_track.GetTrack()->filename, '/') + 1;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
sprintf( buf, "drivers/%s/%s.spr", robot_name, pTrackName );
|
snprintf( buf, 256, "drivers/%s/%s.spr", robot_name, pTrackName );
|
||||||
|
|
||||||
initCw();
|
initCw();
|
||||||
LogSHADOW.debug(" CW = %.3f\n", m_cm.CD_BODY);
|
LogSHADOW.debug(" CW = %.3f\n", m_cm.CD_BODY);
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
#define NBR_BRAKECOEFF 50 // Number of brake coeffs
|
#define NBR_BRAKECOEFF 50 // Number of brake coeffs
|
||||||
|
|
||||||
const double SPD_MIN = 0;
|
const double SPD_MIN = 0;
|
||||||
const double SPD_MAX = 112;
|
const double SPD_MAX = 120;
|
||||||
const int SPD_N = 20;
|
const int SPD_N = 20;
|
||||||
const double SPD_STEP = (SPD_MAX - SPD_MIN) / SPD_N;
|
const double SPD_STEP = (SPD_MAX - SPD_MIN) / SPD_N;
|
||||||
const double K_MIN = -0.1;
|
const double K_MIN = -0.1;
|
||||||
|
@ -129,8 +129,7 @@ public:
|
||||||
~TDriver(); // Destructor
|
~TDriver(); // Destructor
|
||||||
|
|
||||||
void SetShared( Shared* pShared );
|
void SetShared( Shared* pShared );
|
||||||
void InitTrack(tTrack* track, void* carHandle,
|
void InitTrack(tTrack* track, void* carHandle, void** carParmHandle, tSituation* s);
|
||||||
void** carParmHandle, tSituation* s);
|
|
||||||
void NewRace(tCarElt* car, tSituation* s );
|
void NewRace(tCarElt* car, tSituation* s );
|
||||||
|
|
||||||
void GetPtInfo( int path, double pos, PtInfo& pi ) const;
|
void GetPtInfo( int path, double pos, PtInfo& pi ) const;
|
||||||
|
@ -148,7 +147,8 @@ public:
|
||||||
double filterTrk(double accel);
|
double filterTrk(double accel);
|
||||||
|
|
||||||
void initCa();
|
void initCa();
|
||||||
void initCa_MPA1();
|
//void initCa_MPA1();
|
||||||
|
//void initCa_MPA11();
|
||||||
void initCw();
|
void initCw();
|
||||||
void initCR();
|
void initCR();
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ INCLUDE(../../../../cmake/macros.cmake)
|
||||||
|
|
||||||
SET(OSGGRAPH_HEADERS Utils/OsgVectorArrayAdapter.h
|
SET(OSGGRAPH_HEADERS Utils/OsgVectorArrayAdapter.h
|
||||||
Utils/OsgColor.h
|
Utils/OsgColor.h
|
||||||
Utils/OsgAtomic.h
|
#Utils/OsgAtomic.h
|
||||||
Utils/OsgReferenced.h
|
#Utils/OsgReferenced.h
|
||||||
Utils/OsgMath.h
|
Utils/OsgMath.h
|
||||||
Utils/OsgOptions.h
|
Utils/OsgOptions.h
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ using std::string;
|
||||||
|
|
||||||
//class SDCloudField;
|
//class SDCloudField;
|
||||||
|
|
||||||
class SDCloudLayer
|
class SDCloudLayer : public osg::Referenced
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ bool SDSkyDome::repaint( const Vec3f& sky_color,
|
||||||
const float middleVisFactor = 1.0 - vis_factor * (0.1 + 0.85 * cvf/45000);
|
const float middleVisFactor = 1.0 - vis_factor * (0.1 + 0.85 * cvf/45000);
|
||||||
|
|
||||||
(*dome_cl)[0] = sky_color;
|
(*dome_cl)[0] = sky_color;
|
||||||
SDVectorArrayAdapter<Vec3Array> colors(*dome_cl, numBands, 1);
|
osggraph::SDVectorArrayAdapter<Vec3Array> colors(*dome_cl, numBands, 1);
|
||||||
const double saif = sun_angle / SD_PI;
|
const double saif = sun_angle / SD_PI;
|
||||||
static const osg::Vec3f blueShift(0.8, 1.0, 1.2);
|
static const osg::Vec3f blueShift(0.8, 1.0, 1.2);
|
||||||
const osg::Vec3f skyFogDelta = sky_color - fog_color;
|
const osg::Vec3f skyFogDelta = sky_color - fog_color;
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace osg
|
||||||
class DrawElementsUShort;
|
class DrawElementsUShort;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SDSkyDome
|
class SDSkyDome : public osg::Referenced
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::MatrixTransform> dome_transform;
|
osg::ref_ptr<osg::MatrixTransform> dome_transform;
|
||||||
double asl;
|
double asl;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <osg/MatrixTransform>
|
#include <osg/MatrixTransform>
|
||||||
#include <osg/Material>
|
#include <osg/Material>
|
||||||
|
|
||||||
class SDMoon
|
class SDMoon : public osg::Referenced
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::MatrixTransform> moon_transform;
|
osg::ref_ptr<osg::MatrixTransform> moon_transform;
|
||||||
osg::ref_ptr<osg::Material> orb_material;
|
osg::ref_ptr<osg::Material> orb_material;
|
||||||
|
|
|
@ -74,16 +74,18 @@ SDSky::SDSky( void )
|
||||||
// Destructor
|
// Destructor
|
||||||
SDSky::~SDSky( void )
|
SDSky::~SDSky( void )
|
||||||
{
|
{
|
||||||
delete dome;
|
//delete dome;
|
||||||
delete sun;
|
//delete sun;
|
||||||
delete moon;
|
//delete moon;
|
||||||
delete planets;
|
//delete planets;
|
||||||
delete stars;
|
//delete stars;
|
||||||
pre_root->removeChild(0, pre_root->getNumChildren());
|
|
||||||
for(unsigned i=0;i<cloud_layers.size();i++)
|
for(unsigned i=0;i<cloud_layers.size();i++)
|
||||||
{
|
{
|
||||||
delete cloud_layers[i];
|
delete cloud_layers[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre_root->removeChild(0, pre_root->getNumChildren());
|
||||||
//delete pre_transform;
|
//delete pre_transform;
|
||||||
//delete post_root;
|
//delete post_root;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,11 @@ private:
|
||||||
typedef layer_list_type::const_iterator layer_list_const_iterator;
|
typedef layer_list_type::const_iterator layer_list_const_iterator;
|
||||||
|
|
||||||
// components of the sky
|
// components of the sky
|
||||||
SDSkyDome* dome;
|
osg::ref_ptr<SDSkyDome> dome;
|
||||||
SDSun* sun;
|
osg::ref_ptr<SDSun> sun;
|
||||||
SDMoon* moon;
|
osg::ref_ptr<SDMoon> moon;
|
||||||
SDStars* planets;
|
osg::ref_ptr<SDStars> planets;
|
||||||
SDStars* stars;
|
osg::ref_ptr<SDStars> stars;
|
||||||
layer_list_type cloud_layers;
|
layer_list_type cloud_layers;
|
||||||
|
|
||||||
osg::ref_ptr<osg::Group> pre_root, cloud_root;
|
osg::ref_ptr<osg::Group> pre_root, cloud_root;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <osg/Array>
|
#include <osg/Array>
|
||||||
|
|
||||||
class SDStars
|
class SDStars : public osg::Referenced
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Vec4Array> stars_cl;
|
osg::ref_ptr<osg::Vec4Array> stars_cl;
|
||||||
int old_phase;
|
int old_phase;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <osg/Node>
|
#include <osg/Node>
|
||||||
#include <osg/MatrixTransform>
|
#include <osg/MatrixTransform>
|
||||||
|
|
||||||
class SDSun
|
class SDSun : public osg::Referenced
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::MatrixTransform> sun_transform;
|
osg::ref_ptr<osg::MatrixTransform> sun_transform;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue