- delete files not used
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7634 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 6ce61b847ea9d857c2afbcfd63b43096c833f42a Former-commit-id: d9973d7ea8e2968051ad635efbf42a3fe7f6075f
This commit is contained in:
parent
f707ad648f
commit
87c71eac0a
4 changed files with 0 additions and 288 deletions
|
@ -1,104 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
|
|
||||||
file : OsgCockpit.cpp
|
|
||||||
created : Thu Dec 2 18:24:02 CEST 2014
|
|
||||||
copyright : (C) 2014 by Xavier Bertaux
|
|
||||||
email : bertauxx@yahoo.fr
|
|
||||||
version : $Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
|
||||||
* (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/* Portability don't build with MingW 4.8 */
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <portability.h>
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
#include "OsgLoader.h"
|
|
||||||
#include "OsgCockpit.h"
|
|
||||||
#include "OsgNodeMask.h"
|
|
||||||
|
|
||||||
#include <osgDB/WriteFile>
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> SDCockpit::initCockpit(tCarElt *car, void *handle)
|
|
||||||
{
|
|
||||||
this->car = car;
|
|
||||||
|
|
||||||
const char *param;
|
|
||||||
char path[256];
|
|
||||||
|
|
||||||
GfLogInfo("Cockpit Loaded\n");
|
|
||||||
|
|
||||||
snprintf(path, 256, "%s/%s", SECT_GROBJECTS, SECT_COCKPIT);
|
|
||||||
param = GfParmGetStr(handle, path, PRM_MODELCOCKPIT, NULL);
|
|
||||||
|
|
||||||
|
|
||||||
_cockpit = new osg::Group;
|
|
||||||
osg::ref_ptr<osg::Node> cock = new osg::Node;
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
if (param)
|
|
||||||
{
|
|
||||||
osgLoader loader;
|
|
||||||
char buf[4096];
|
|
||||||
|
|
||||||
std::string TmpPath = GetDataDir();
|
|
||||||
std::string strTPath;
|
|
||||||
std::string strPath;
|
|
||||||
snprintf(buf, 4096, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
|
||||||
strTPath = TmpPath+buf;
|
|
||||||
loader.AddSearchPath(strTPath);
|
|
||||||
|
|
||||||
snprintf(buf, 4096, "cars/models/%s/", car->_carName);
|
|
||||||
strTPath = TmpPath+buf;
|
|
||||||
loader.AddSearchPath(strTPath);
|
|
||||||
GfOut("Chemin Textures : %s\n", strTPath.c_str());
|
|
||||||
|
|
||||||
// Load speed-dependant 3D cockpit model if available
|
|
||||||
sprintf(buf, "cars/models/%s/cockpit.acc", car->_carName);
|
|
||||||
strPath +=buf;
|
|
||||||
cock= loader.Load3dFile(strPath, true);
|
|
||||||
_cockpit->addChild(cock);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
std::string pCockpit_path = GetLocalDir();
|
|
||||||
pCockpit_path = pCockpit_path+"cockpit.osg";
|
|
||||||
osgDB::writeNodeFile( *cock, pCockpit_path );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
char buf[4096];
|
|
||||||
|
|
||||||
std::string LocalPath = GetDataDir();
|
|
||||||
|
|
||||||
osg::ref_ptr<osgDB::Options> options = new::osgDB::ReaderWriter::Options();
|
|
||||||
options->CACHE_NONE;
|
|
||||||
//options = new osgDB::ReaderWriter::Options;
|
|
||||||
|
|
||||||
snprintf(buf, 4096, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
|
||||||
options->getDatabasePathList().push_back(LocalPath+buf);
|
|
||||||
|
|
||||||
snprintf(buf, 4096, "cars/models/%s/", car->_carName);
|
|
||||||
options->getDatabasePathList().push_back(LocalPath+buf);
|
|
||||||
|
|
||||||
options->getDatabasePathList().push_back(LocalPath+"data/textures/");
|
|
||||||
options->getDatabasePathList().push_back(LocalPath+"data/objects/");
|
|
||||||
|
|
||||||
_cockpit->addChild( osgDB::readNodeFile("cockpit.osg", options));
|
|
||||||
|
|
||||||
options->getDatabasePathList().clear();
|
|
||||||
options = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_cockpit->setNodeMask(NODE_MASK_SHADOW_CAST);
|
|
||||||
|
|
||||||
return _cockpit.get();
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
|
|
||||||
file : OsgCockpit.h
|
|
||||||
created : Thu Dec 2 18:24:02 CEST 2014
|
|
||||||
copyright : (C) 2014 by Xavier Bertaux
|
|
||||||
email : bertauxx@yahoo.fr
|
|
||||||
version : $Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
|
||||||
* (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _OSGCOCKPIT_H_
|
|
||||||
#define _OSGCOCKPIT_H_
|
|
||||||
|
|
||||||
#include <car.h>
|
|
||||||
#include <raceman.h>
|
|
||||||
#include <osg/Group>
|
|
||||||
#include <osg/Node>
|
|
||||||
#include <osg/MatrixTransform>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
class SDCockpit
|
|
||||||
{
|
|
||||||
private :
|
|
||||||
tCarElt *car;
|
|
||||||
osg::ref_ptr<osg::Group> _cockpit;
|
|
||||||
|
|
||||||
public :
|
|
||||||
osg::ref_ptr<osg::Node> initCockpit(tCarElt *car,void * handle);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* _OSGCOCKPIT_H_ */
|
|
|
@ -1,103 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
|
|
||||||
file : OsgSteer.cpp
|
|
||||||
created : Mon Dec 1 18:24:02 CEST 2014
|
|
||||||
copyright : (C) 2014 by Xavier Bertaux
|
|
||||||
email : bertauxx@yahoo.fr
|
|
||||||
version : $Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
|
||||||
* (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/* Portability don't build with MingW 4.8 */
|
|
||||||
//#include <portability.h>
|
|
||||||
#include <osgDB/WriteFile>
|
|
||||||
|
|
||||||
#include "OsgLoader.h"
|
|
||||||
#include "OsgSteer.h"
|
|
||||||
|
|
||||||
SDSteer::SDSteer(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SDSteer::~SDSteer(void)
|
|
||||||
{
|
|
||||||
//delete loader;
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> SDSteer::initSteer(tCarElt *car, void *handle, bool tracktype)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/*this->car = car;
|
|
||||||
|
|
||||||
const char *param;
|
|
||||||
char path[256];
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Switch> pWing = new osg::Switch;
|
|
||||||
osg::ref_ptr<osg::Node> pWin1 = new osg::Node;
|
|
||||||
osg::ref_ptr<osg::Node> pWin2 = new osg::Node;
|
|
||||||
|
|
||||||
snprintf(path, 256, "%s/%s", SECT_GROBJECTS, SECT_WING_MODEL);
|
|
||||||
param = GfParmGetStr(handle, path, PRM_WING_1, NULL);
|
|
||||||
|
|
||||||
if (param)
|
|
||||||
{
|
|
||||||
osgLoader loader;
|
|
||||||
char buf[4096];
|
|
||||||
|
|
||||||
std::string TmpPath = GetDataDir();
|
|
||||||
std::string strTPath;
|
|
||||||
std::string strPath;
|
|
||||||
|
|
||||||
snprintf(buf, 4096, "drivers/%s/%d/", car->_modName, car->_driverIndex);
|
|
||||||
strTPath = TmpPath+buf;
|
|
||||||
loader.AddSearchPath(strTPath);
|
|
||||||
|
|
||||||
snprintf(buf, 4096, "cars/models/%s/", car->_carName);
|
|
||||||
strTPath = TmpPath+buf;
|
|
||||||
loader.AddSearchPath(strTPath);
|
|
||||||
GfOut("Chemin Textures : %s\n", strTPath.c_str());
|
|
||||||
|
|
||||||
strPath = GetDataDir();
|
|
||||||
|
|
||||||
sprintf(buf, "cars/models/%s/wingR1-src.ac", car->_carName);
|
|
||||||
strPath+=buf;
|
|
||||||
|
|
||||||
pWin1 = loader.Load3dFile(strPath, true);
|
|
||||||
pWin1->setName("WING1");
|
|
||||||
GfLogInfo("Load Wing1 ACC !\n");
|
|
||||||
|
|
||||||
strPath = GetDataDir();
|
|
||||||
sprintf(buf, "cars/models/%s/wingR2-src.ac", car->_carName);
|
|
||||||
strPath+=buf;
|
|
||||||
pWin2 = loader.Load3dFile(strPath, true);
|
|
||||||
|
|
||||||
pWin2->setName("WING2");
|
|
||||||
GfLogInfo("Load Wing2 ACC !\n");
|
|
||||||
|
|
||||||
pWing->addChild(pWin1.get(), true);
|
|
||||||
pWing->addChild(pWin2.get(), false);
|
|
||||||
|
|
||||||
if (!tracktype)
|
|
||||||
pWing->setSingleChildOn(0);
|
|
||||||
else
|
|
||||||
pWing->setSingleChildOn(1);
|
|
||||||
#if 1
|
|
||||||
std::string pWing_path = GetLocalDir();
|
|
||||||
pWing_path = pWing_path+"wing.osg";
|
|
||||||
osgDB::writeNodeFile( *pWing, pWing_path );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return pWing.get();*/
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
|
|
||||||
file : OsgSteer.h
|
|
||||||
created : Mon Dec 1 18:24:02 CEST 2014
|
|
||||||
copyright : (C) 2014 by Xavier Bertaux
|
|
||||||
email : bertauxx@yahoo.fr
|
|
||||||
version : $Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
|
||||||
* (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _OSSTEER_H_
|
|
||||||
#define _OSSTEER_H_
|
|
||||||
|
|
||||||
#include <car.h>
|
|
||||||
#include <raceman.h>
|
|
||||||
#include <osg/Group>
|
|
||||||
#include <osg/Node>
|
|
||||||
#include <osg/Switch>
|
|
||||||
|
|
||||||
class SDSteer
|
|
||||||
{
|
|
||||||
private :
|
|
||||||
tCarElt *car;
|
|
||||||
|
|
||||||
public :
|
|
||||||
SDSteer();
|
|
||||||
~SDSteer();
|
|
||||||
osg::ref_ptr<osg::Node> initSteer(tCarElt *car,void * handle, bool tracktype);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* _OSGSTEER_H_ */
|
|
Loading…
Reference in a new issue