update class SDCars for buil with gcc < 4.7

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

Former-commit-id: 05ee495cb9cc8b0e1351c75356e1afd276128c5c
Former-commit-id: 757072d92a175f12b8401ea2f9bc8c2885efaa65
This commit is contained in:
torcs-ng 2012-11-14 16:17:32 +00:00
parent ba3edc6e83
commit 2361add693
2 changed files with 11 additions and 7 deletions

View file

@ -1,12 +1,9 @@
#include <osg/MatrixTransform> #include <osg/MatrixTransform>
#include "OsgLoader.h" #include "OsgLoader.h"
#include "OsgCar.h" #include "OsgCar.h"
#include "OsgMath.h" #include "OsgMath.h"
/*float * flatten(float mat[4][4]){ /*float * flatten(float mat[4][4]){
float res[16]; float res[16];
for(int i=0;i<16;i++){ for(int i=0;i<16;i++){
@ -20,8 +17,6 @@
}*/ }*/
osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *car) osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *car)
{ {
this->car = car; this->car = car;
@ -177,6 +172,14 @@ void SDCar::updateCar()
//this->car_branch->setMatrix(osg::Matrix(flatten(car->pub.posMat))); //this->car_branch->setMatrix(osg::Matrix(flatten(car->pub.posMat)));
} }
SDCars::SDCars(void)
{
cars_branch = new osg::Group;
}
SDCars::~SDCars(void)
{
}
void SDCars::addSDCar(SDCar * car) void SDCars::addSDCar(SDCar * car)
{ {

View file

@ -19,14 +19,15 @@ class SDCars
{ {
private : private :
std::vector<SDCar *> the_cars; std::vector<SDCar *> the_cars;
osg::ref_ptr<osg::Group> cars_branch = new osg::Group; osg::ref_ptr<osg::Group> cars_branch;
tSituation * situation; tSituation * situation;
void addSDCar(SDCar * car); void addSDCar(SDCar * car);
public : public :
SDCars(void);
~SDCars(void);
osg::ref_ptr<osg::Node> loadCars(tSituation * pSituation); osg::ref_ptr<osg::Node> loadCars(tSituation * pSituation);
void updateCars(); void updateCars();