Revision: 280
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=280&view=rev
Author:   rorthomas
Date:     2009-05-19 13:19:49 +0000 (Tue, 19 May 2009)

Log Message:
-----------
merged flypiper's inertia patch :)

Modified Paths:
--------------
    trunk/build/main/source/Beam.cpp
    trunk/build/main/source/Beam.h
    trunk/build/main/source/pstdint.h

Added Paths:
-----------
    trunk/build/main/source/CmdKeyInertia.cpp
    trunk/build/main/source/CmdKeyInertia.h
    trunk/build/skeleton/config/inertia_models.cfg

Modified: trunk/build/main/source/Beam.cpp
===================================================================
--- trunk/build/main/source/Beam.cpp    2009-05-19 12:49:48 UTC (rev 279)
+++ trunk/build/main/source/Beam.cpp    2009-05-19 13:19:49 UTC (rev 280)
@@ -51,7 +51,7 @@
 #include "BeamStats.h"
 #endif
 #include "Skidmark.h"
-
+#include "CmdKeyInertia.h"
 #include "ColoredTextAreaOverlayElement.h"
 
 float mrtime;
@@ -207,6 +207,9 @@
 
        ssm=SoundScriptManager::getSingleton();
        materialFunctionMapper = new MaterialFunctionMapper();
+       cmdInertia=new CmdKeyInertia(MAX_COMMANDS);
+       hydroInertia=new CmdKeyInertia(MAX_HYDROS);
+       rotaInertia=new CmdKeyInertia(MAX_ROTATORS);
        free_soundsource=0;
        nodedebugstate=-1;
        debugVisuals=0;
@@ -388,6 +391,7 @@
        slowed=1;
        hydrodircommand=0;
        hydrodirstate=0;
+       hydrodirwheeldisplay=0.0;
        hydroaileroncommand=0;
        hydroaileronstate=0;
        hydroruddercommand=0;
@@ -1743,8 +1747,14 @@
                        int id1, id2;
                        float ratio;
                        char options[50] = "n";
-                       int result = sscanf(line,"%i, %i, %f, 
%s",&id1,&id2,&ratio, options);
-                       if (result < 3 || result == EOF) {
+                       Real startDelay=0;
+                       Real stopDelay=0;
+                       char startFunction[50]="";
+                       char stopFunction[50]="";
+
+                       int result = sscanf(line,"%i, %i, %f, %s %f, %f, %s 
%s",&id1,&id2,&ratio,options,&startDelay,&stopDelay,startFunction,stopFunction);
+                       if (result < 3 || result == EOF)
+                       {
                                LogManager::getSingleton().logMessage("Error 
parsing File (Hydro) " + String(fname) +" line " + 
StringConverter::toString(linecounter) + ". trying to continue ...");
                                continue;
                        }
@@ -1782,6 +1792,10 @@
                                continue;
                        }
                        //            printf("beam : %i %i\n", id1, id2);
+
+                       if(hydroInertia)
+                               
hydroInertia->setCmdKeyDelay(free_hydro,startDelay,stopDelay,String 
(startFunction), String (stopFunction));
+
                        int pos=add_beam(&nodes[id1], &nodes[id2], manager, 
parent, htype, default_break, default_spring, default_damp);
                        hydro[free_hydro]=pos;free_hydro++;
                        beams[pos].Lhydro=beams[pos].L;
@@ -2037,11 +2051,15 @@
                        char options[250]="";
                        char descr[200] = "";
                        hascommands=1;
+                       Real startDelay=0;
+                       Real stopDelay=0;
+                       char startFunction[50]="";
+                       char stopFunction[50]="";
                        int result = 0;
                        if(mode == 12)
                        {
                                char opt='n';
-                               result = sscanf(line,"%i, %i, %f, %f, %f, %i, 
%i, %c, %s", &id1, &id2, &rateShort, &shortl, &longl, &keys, &keyl, &opt, 
descr);
+                               result = sscanf(line,"%i, %i, %f, %f, %f, %i, 
%i, %c, %s %f, %f, %s %s", &id1, &id2, &rateShort, &shortl, &longl, &keys, 
&keyl, &opt, descr, &startDelay, &stopDelay, startFunction, stopFunction);
                                if (result < 7 || result == EOF) {
                                        
LogManager::getSingleton().logMessage("Error parsing File (Command) " + 
String(fname) +" line " + StringConverter::toString(linecounter) + ". trying to 
continue ...");
                                        continue;
@@ -2052,7 +2070,7 @@
                        }
                        else if(mode == 120)
                        {
-                               result = sscanf(line,"%i, %i, %f, %f, %f, %f, 
%i, %i, %s %s", &id1, &id2, &rateShort, &rateLong, &shortl, &longl, &keys, 
&keyl, options, descr);
+                               result = sscanf(line,"%i, %i, %f, %f, %f, %f, 
%i, %i, %s %s %f,%f,%s %s", &id1, &id2, &rateShort, &rateLong, &shortl, &longl, 
&keys, &keyl, options, descr, &startDelay, &stopDelay, startFunction, 
stopFunction);
                                if (result < 8 || result == EOF) {
                                        
LogManager::getSingleton().logMessage("Error parsing File (Command) " + 
String(fname) +" line " + StringConverter::toString(linecounter) + ". trying to 
continue ...");
                                        continue;
@@ -2160,6 +2178,13 @@
                                beams[pos].centerLength = 
(beams[pos].commandLong-beams[pos].commandShort)/2 + beams[pos].commandShort;
                        else
                                beams[pos].centerLength = 
(beams[pos].commandShort-beams[pos].commandLong)/2 + beams[pos].commandLong;
+
+                       if(cmdInertia)
+                       {
+                               
cmdInertia->setCmdKeyDelay(keys,startDelay,stopDelay,String 
(startFunction),String (stopFunction));
+                               
cmdInertia->setCmdKeyDelay(keyl,startDelay,stopDelay,String 
(startFunction),String (stopFunction));
+                       }
+
                }
 
                else if (mode==13)
@@ -3060,7 +3085,11 @@
                        int p1[4], p2[4];
                        float rate;
                        hascommands=1;
-                       int result = sscanf(line,"%i, %i, %i, %i, %i, %i, %i, 
%i, %i, %i, %f, %i, %i", &axis1, &axis2, &p1[0], &p1[1], &p1[2], &p1[3], 
&p2[0], &p2[1], &p2[2], &p2[3], &rate, &keys, &keyl);
+                       Real startDelay=0;
+                       Real stopDelay=0;
+                       char startFunction[50]="";
+                       char stopFunction[50]="";
+                       int result = sscanf(line,"%i, %i, %i, %i, %i, %i, %i, 
%i, %i, %i, %f, %i, %i, %f, %f, %s %s", &axis1, &axis2, &p1[0], &p1[1], &p1[2], 
&p1[3], &p2[0], &p2[1], &p2[2], &p2[3], &rate, &keys, &keyl, &startDelay, 
&stopDelay, startFunction, stopFunction);
                        if (result < 13 || result == EOF) {
                                LogManager::getSingleton().logMessage("Error 
parsing File (Rotators) " + String(fname) +" line " + 
StringConverter::toString(linecounter) + ". trying to continue ...");
                                continue;
@@ -3087,6 +3116,12 @@
                        //add long key
                        commandkey[keyl].rotators.push_back(free_rotator+1);
                        commandkey[keyl].description = "Rotate Right";
+
+                       if(rotaInertia)
+                       {
+                               
rotaInertia->setCmdKeyDelay(keys,startDelay,stopDelay,String 
(startFunction),String (stopFunction));
+                               
rotaInertia->setCmdKeyDelay(keyl,startDelay,stopDelay,String 
(startFunction),String (stopFunction));
+                       }
                        free_rotator++;
                }
                else if (mode==28)
@@ -4821,6 +4856,8 @@
        hydroaileronstate=0.0;
        hydrorudderstate=0.0;
        hydroelevatorstate=0.0;
+       hydrodirwheeldisplay=0.0;
+       if(hydroInertia) hydroInertia->resetCmdKeyDelay(MAX_HYDROS);
        locked=UNLOCKED;
        tied=false;
        parkingbrake=0;
@@ -6323,6 +6360,12 @@
                if (div)
                {
                        cstate=cstate/(float)div;
+                       if(hydroInertia)
+                               
cstate=hydroInertia->calcCmdKeyDelay(cstate,i,dt);
+
+                       if (!(beams[hydro[i]].hydroFlags & HYDRO_FLAG_SPEED))
+                               hydrodirwheeldisplay=cstate;
+
                        
beams[hydro[i]].L=beams[hydro[i]].Lhydro*(1.0-cstate*beams[hydro[i]].hydroRatio);
                }
        }
@@ -6493,6 +6536,10 @@
                                                                        
beams[bbeam].autoMovingMode=0;
                                                                }
                                                        }
+
+                                                       if(cmdInertia)
+                                                               
v=cmdInertia->calcCmdKeyDelay(v,i,dt);
+
                                                        
if(beams[bbeam].autoMovingMode > 0)
                                                                v = 1;
 
@@ -6563,6 +6610,10 @@
                                                                        
beams[bbeam].autoMovingMode=0;
                                                                }
                                                        }
+
+                                                       if(cmdInertia)
+                                                               
v=cmdInertia->calcCmdKeyDelay(v,i,dt);
+
                                                        
if(beams[bbeam].autoMovingMode < 0)
                                                                v = 1;
 
@@ -6604,12 +6655,26 @@
                                if ((commandkey[i].rotators[j])>0)
                                {
                                        int rota = commandkey[i].rotators[j] - 
1;
-                                       rotators[rota].angle += 
rotators[rota].rate * commandkey[i].commandValue * crankfactor * dt;
+                                       float value=0;
+                                       if(rotaInertia)
+                                       {
+                                               
value=rotaInertia->calcCmdKeyDelay(commandkey[i].commandValue,i,dt);
+                                       }
+                                       if(value>0.5f)
+                                               requestpower=true;
+                                       rotators[rota].angle += 
rotators[rota].rate * value * crankfactor * dt;
                                }
                                else
                                {
                                        int rota =- (commandkey[i].rotators[j]) 
- 1;
-                                       rotators[rota].angle -= 
rotators[rota].rate * commandkey[i].commandValue * crankfactor * dt;
+                                       float value=0;
+                                       if(rotaInertia)
+                                       {
+                                               
value=rotaInertia->calcCmdKeyDelay(commandkey[i].commandValue,i,dt);
+                                       }
+                                       if(value>0.5f)
+                                               requestpower=true;
+                                       rotators[rota].angle -= 
rotators[rota].rate * value * crankfactor * dt;
                                }
                        }
                        if(requestpower)
@@ -7183,7 +7248,7 @@
                {
                        //display wheel
                        Quaternion brot=Quaternion(Degree(-59.0), 
Vector3::UNIT_X);
-                       
brot=brot*Quaternion(Degree(hydrodirstate*props[i].wheelrotdegree), 
Vector3::UNIT_Y);
+                       
brot=brot*Quaternion(Degree(hydrodirwheeldisplay*props[i].wheelrotdegree), 
Vector3::UNIT_Y);
                        
props[i].wheel->setPosition(mposition+normal*props[i].offsetz+orientation*props[i].wheelpos);
                        props[i].wheel->setOrientation(orientation*brot);
                }

Modified: trunk/build/main/source/Beam.h
===================================================================
--- trunk/build/main/source/Beam.h      2009-05-19 12:49:48 UTC (rev 279)
+++ trunk/build/main/source/Beam.h      2009-05-19 13:19:49 UTC (rev 280)
@@ -51,6 +51,7 @@
 #include "networkinfo.h"
 #include "CacheSystem.h"
 #include "aeroengine.h"
+#include "CmdKeyInertia.h"
 #include "skin.h"
 #include "approxmath.h"
 
@@ -277,6 +278,7 @@
 class Skidmark;
 class Autopilot;
 class MaterialFunctionMapper;
+class CmdKeyInertia;
 
 typedef struct _beam
 {
@@ -661,6 +663,7 @@
        //direction
        float hydrodircommand;
        float hydrodirstate;
+       Real hydrodirwheeldisplay;
        //extra airplane axises
        float hydroaileroncommand;
        float hydroaileronstate;
@@ -781,7 +784,7 @@
 
        static const float inverse_RAND_MAX;
        static const int half_RAND_MAX;
-    
+
        inline float randHalf()
        {
                return  ((float)(rand()-half_RAND_MAX))*inverse_RAND_MAX;
@@ -1036,6 +1039,10 @@
         */
        void autoBlinkReset();
        bool blinktreshpassed;
+
+       CmdKeyInertia *rotaInertia;
+       CmdKeyInertia *hydroInertia;
+       CmdKeyInertia *cmdInertia;
 #ifdef TIMING
        BeamThreadStats *statistics;
 #endif

Added: trunk/build/main/source/CmdKeyInertia.cpp
===================================================================
--- trunk/build/main/source/CmdKeyInertia.cpp                           (rev 0)
+++ trunk/build/main/source/CmdKeyInertia.cpp   2009-05-19 13:19:49 UTC (rev 
280)
@@ -0,0 +1,197 @@
+/*
+This source file is part of Rigs of Rods
+Copyright 2005,2006,2007,2008,2009 Pierre-Michel Ricordel
+Copyright 2007,2008,2009 Thomas Fischer
+
+For more information, see http://www.rigsofrods.com/
+
+Rigs of Rods is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3, as 
+published by the Free Software Foundation.
+
+Rigs of Rods is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "CmdKeyInertia.h"
+#include "Ogre.h"
+
+using namespace Ogre;
+using namespace std;
+
+CmdKeyInertia::CmdKeyInertia(int maxCmdKeys)
+{      
+       loadDefaultInertiaModels();
+
+       cmdKeyInertia=new cmdKeyInertia_struct[maxCmdKeys];
+       for (int i=0;i<maxCmdKeys;i++)
+       {
+               cmdKeyInertia[i].lastOutput=0.0f;
+               cmdKeyInertia[i].time=0.0f;
+               cmdKeyInertia[i].startSpline=0;
+               cmdKeyInertia[i].stopSpline=0;
+               //set "normal" values with nearly no delay
+               setCmdKeyDelay(i,10.0,10.0,"constant","constant");
+       }
+}
+CmdKeyInertia::~CmdKeyInertia()
+{
+       splines.clear();
+       delete cmdKeyInertia;
+}
+
+Real CmdKeyInertia::calcCmdKeyDelay(Real cmdInput,int cmdKey,Real dt)
+{
+       if (cmdKeyInertia[cmdKey].startSpline==0 || 
cmdKeyInertia[cmdKey].stopSpline==0)
+               return cmdInput;
+
+       Real calculatedOutput=cmdKeyInertia[cmdKey].lastOutput;
+       Real lastOutput=cmdKeyInertia[cmdKey].lastOutput;
+       //rel difference to calculate if we have to use start 
values(accelarating) or stop values
+       Real relDiff=fabs(cmdInput)-fabs(lastOutput);
+       // difference to calculate if were are on the negative side
+       Real absDiff=cmdInput-lastOutput;
+       //if the value is close to our input, reset the timer
+       if(fabs(absDiff)<0.002)
+               cmdKeyInertia[cmdKey].time=0;
+       //+dt after the timer had been set to zero prevents the motion to stop 
at 0.002
+       cmdKeyInertia[cmdKey].time+=dt;
+
+       Real 
startFactor=cmdKeyInertia[cmdKey].startDelay*cmdKeyInertia[cmdKey].time;
+       Real 
stopFactor=cmdKeyInertia[cmdKey].stopDelay*cmdKeyInertia[cmdKey].time;
+       //positive values between 0 and 1
+       if (absDiff>0)
+       {       //we have to accelerate our last outout to the new commanded 
input
+               if (relDiff>0)
+                       
calculatedOutput=lastOutput+calculateCmdOutput(startFactor,cmdKeyInertia[cmdKey].startSpline);
+               if (relDiff<0)
+                       //we have to deccelerate our last outout to the new 
commanded input
+                       
calculatedOutput=lastOutput+calculateCmdOutput(stopFactor,cmdKeyInertia[cmdKey].stopSpline);
+               if (calculatedOutput>cmdInput)
+                       //if the calculated value is bigger than input set to 
input to avoid overshooting
+                       calculatedOutput=cmdInput;
+       }
+       //negative values, mainly needed for hydros, between 0 and -1
+       if (absDiff<0)
+       {       
+               if (relDiff>0)
+                       
calculatedOutput=lastOutput-calculateCmdOutput(startFactor,cmdKeyInertia[cmdKey].startSpline);
+               if (relDiff<0)
+                       
calculatedOutput=lastOutput-calculateCmdOutput(stopFactor,cmdKeyInertia[cmdKey].stopSpline);
+               if (calculatedOutput<cmdInput)
+                       calculatedOutput=cmdInput;
+       }
+       cmdKeyInertia[cmdKey].lastOutput=calculatedOutput;
+       return calculatedOutput;
+}
+
+int CmdKeyInertia::setCmdKeyDelay(int cmdKey,Real startDelay,Real stopDelay, 
String startFunction, String stopFunction)
+{      //Delay values should always be greater than 0
+       if (startDelay>0)
+               cmdKeyInertia[cmdKey].startDelay=startDelay;
+       else
+               LogManager::getSingleton().logMessage("Start Delay should be 
>0");
+
+       if (stopDelay>0)
+               cmdKeyInertia[cmdKey].stopDelay=stopDelay;
+       else
+               LogManager::getSingleton().logMessage("Stop Delay should be 
>0");
+       //if we don't find the spline, we use the "constant" one
+       if (splines.find(startFunction) == splines.end())
+               LogManager::getSingleton().logMessage("Start Function 
"+startFunction +" not found");
+       else
+               
cmdKeyInertia[cmdKey].startSpline=&splines.find(startFunction)->second;
+       
+       if (splines.find(stopFunction) == splines.end())
+               LogManager::getSingleton().logMessage("Start Function 
"+stopFunction +" not found");
+       else
+               
cmdKeyInertia[cmdKey].stopSpline=&splines.find(stopFunction)->second;
+
+       return 0;
+}
+
+Real CmdKeyInertia::calculateCmdOutput(Real time,SimpleSpline *spline)
+{      
+       if (time>1.0)
+               time=1.0;
+       Vector3 output=spline->interpolate(time);
+       return output.y*0.001;
+}
+
+int CmdKeyInertia::loadDefaultInertiaModels()
+{
+       // check if we have a config file
+       String group = "";
+       try
+       {
+               group = 
ResourceGroupManager::getSingleton().findGroupContainingResource("inertia_models.cfg");
+       } catch(...)
+       {
+       }
+       // emit a warning if we did not found the file
+       if (group.empty())
+       {
+               LogManager::getSingleton().logMessage("inertia_models.cfg not 
found");
+               return 1;
+       }
+
+       // open the file for reading
+       DataStreamPtr ds = 
ResourceGroupManager::getSingleton().openResource("inertia_models.cfg", group);
+       String line = "";
+       String currentModel = "";
+
+       while (!ds->eof())
+       {       
+               line=ds->getLine();
+               StringUtil::trim(line);
+               
+               if (line.empty() || line[0]==';')
+                       continue;
+
+               std::vector< String > args = StringUtil::split(line, ",");
+               
+               if (args.size() == 1)
+               {
+                       currentModel = line;
+                       continue;
+               }
+               
+               // process the line if we got a model
+               if(!currentModel.empty())
+                       processLine(args, currentModel);
+       }
+       return 0;
+}
+
+int CmdKeyInertia::processLine(vector< String > args,  String model)
+{
+       // we only accept 2 arguments
+       if (args.size() != 2)
+               return 1;
+       // parse the data
+       float pointx = StringConverter::parseReal(args[0]);
+       float pointy = StringConverter::parseReal(args[1]);
+       Vector3 point = Vector3(pointx,pointy,0);
+       
+       // find the spline to attach the points
+       if(splines.find(model) == splines.end())
+               splines[model] = SimpleSpline();
+       
+       // attach the points to the spline
+       splines[model].addPoint(point);
+
+       return 0;
+}
+void CmdKeyInertia::resetCmdKeyDelay(int maxCmdKeys)
+{      //reset lastOutput and time, if we reset the truck
+       for (int i=0;i<maxCmdKeys;i++)
+       {
+               cmdKeyInertia[i].lastOutput=0.0;
+               cmdKeyInertia[i].time=0.0;
+       }
+}
Added: trunk/build/main/source/CmdKeyInertia.h
===================================================================
--- trunk/build/main/source/CmdKeyInertia.h                             (rev 0)
+++ trunk/build/main/source/CmdKeyInertia.h     2009-05-19 13:19:49 UTC (rev 
280)
@@ -0,0 +1,56 @@
+/*
+This source file is part of Rigs of Rods
+Copyright 2005,2006,2007,2008,2009 Pierre-Michel Ricordel
+Copyright 2007,2008,2009 Thomas Fischer
+
+For more information, see http://www.rigsofrods.com/
+
+Rigs of Rods is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 3, as 
+published by the Free Software Foundation.
+
+Rigs of Rods is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CmdKeyInertia_H__
+#define __CmdKeyInertia_H__
+#include "OgrePrerequisites.h"
+
+
+struct cmdKeyInertia_struct
+{
+       Ogre::Real startDelay;
+       Ogre::Real stopDelay;
+       Ogre::Real lastOutput;
+       Ogre::SimpleSpline *startSpline;
+       Ogre::SimpleSpline *stopSpline;
+       Ogre::Real time;
+};
+
+class CmdKeyInertia
+{
+       
+public:
+       CmdKeyInertia(int maxCmdKeys);
+       ~CmdKeyInertia();
+
+       Ogre::Real calcCmdKeyDelay(Ogre::Real cmdInput,int cmdKey, Ogre::Real 
dt);
+       int setCmdKeyDelay(int number,Ogre::Real startDelay,Ogre::Real 
stopDelay,Ogre::String startFunction, Ogre::String stopFunction);
+       void resetCmdKeyDelay(int maxCmdKeys);
+protected: 
+       
+       Ogre::Real calculateCmdOutput(Ogre::Real time,Ogre::SimpleSpline 
*spline);
+       int processLine(std::vector< Ogre::String > args,  Ogre::String model);
+
+       cmdKeyInertia_struct *cmdKeyInertia;
+       std::map < Ogre::String, Ogre::SimpleSpline > splines;
+       int loadDefaultInertiaModels();
+
+};
+#endif
Modified: trunk/build/main/source/pstdint.h
===================================================================
--- trunk/build/main/source/pstdint.h   2009-05-19 12:49:48 UTC (rev 279)
+++ trunk/build/main/source/pstdint.h   2009-05-19 13:19:49 UTC (rev 280)
@@ -5,11 +5,11 @@
  *
  *  Copyright (c) 2005-2007 Paul Hsieh
  *  All rights reserved.
- *  
+ *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
  *  are met:
- *  
+ *
  *  1. Redistributions of source code must retain the above copyright
  *     notice, this list of conditions and the following disclaimer.
  *  2. Redistributions in binary form must reproduce the above copyright
@@ -17,7 +17,7 @@
  *     documentation and/or other materials provided with the distribution.
  *  3. The name of the author may not be used to endorse or promote products
  *     derived from this software without specific prior written permission.
- *  
+ *
  *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -182,12 +182,12 @@
  */
 
 #include <OgrePrerequisites.h> // needed for OGRE_PLATFORM
- 
+
 #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
 //include the original linux stdint header. due to the precompiler guard it 
wull skip the rest of the file
 #include <stdint.h>
 #endif
- 
+
 #ifndef _STDINT_H
 
 #include <stddef.h>
@@ -738,15 +738,15 @@
 
 #if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
 
-/* 
+/*
  *  Please compile with the maximum warning settings to make sure macros are 
not
  *  defined more than once.
  */
- 
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
- 
+
 #define glue3_aux(x,y,z) x ## y ## z
 #define glue3(x,y,z) glue3_aux(x,y,z)
 
@@ -756,7 +756,7 @@
 #define DECL(us,bits) glue3(DECL,us,) (bits)
 
 #define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if 
(glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with 
UINT%d_MAX\n", bits)
- 
+
 int main () {
        DECL(I,8)
        DECL(U,8)
@@ -773,7 +773,7 @@
        char str0[256], str1[256];
 
        sprintf (str0, "%d %x\n", 0, ~0);
-       
+
        sprintf (str1, "%d %x\n",  i8, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", 
str1);
        sprintf (str1, "%u %x\n",  u8, ~0);
@@ -781,20 +781,20 @@
        sprintf (str1, "%d %x\n",  i16, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : 
%s\n", str1);
        sprintf (str1, "%u %x\n",  u16, ~0);
-       if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : 
%s\n", str1); 
+       if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : 
%s\n", str1);
        sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n",  i32, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : 
%s\n", str1);
        sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n",  u32, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : 
%s\n", str1);
-#ifdef INT64_MAX       
+#ifdef INT64_MAX
        sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n",  i64, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : 
%s\n", str1);
 #endif
        sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n",  imax, ~0);
        if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : 
%s\n", str1);
        sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n",  umax, ~0);
-       if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : 
%s\n", str1);        
-       
+       if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : 
%s\n", str1);
+
        TESTUMAX(8);
        TESTUMAX(16);
        TESTUMAX(32);
@@ -811,4 +811,4 @@
 # define _STDINT_H
 #endif
 
-#endif //_STDINT_H
\ No newline at end of file
+#endif //_STDINT_H

Added: trunk/build/skeleton/config/inertia_models.cfg
===================================================================
--- trunk/build/skeleton/config/inertia_models.cfg                              
(rev 0)
+++ trunk/build/skeleton/config/inertia_models.cfg      2009-05-19 13:19:49 UTC 
(rev 280)
@@ -0,0 +1,47 @@
+constant
+0,1
+1,1
+
+linear
+0,0.0
+1.0,1.0
+
+degressiv
+0,0.0
+0.25,0.5
+0.5,0.701
+0.75,0.866
+1.0,1.0
+
+progressiv
+0,0.0
+0.25,0.063
+0.5,0.25
+0.75,0.564
+1.0,1.0
+
+smooth
+0,0.0
+0.2,0.032
+0.4,0.256
+0.6,0.743
+0.8,0.968
+1.0,1.0
+
+revprogressiv
+0,1.0
+0.25,0.564
+0.5,0.25
+0.75,0.163
+1.0,0.1
+
+smoothcrane
+0,0.9
+0.05,0.9
+0.1,0.9
+0.15,0.1
+0.2,0.332
+0.4,0.556
+0.6,0.743
+0.8,0.968
+1.0,1.0


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to