Revision: 1520
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1520&view=rev
Author: rorthomas
Date: 2010-08-19 11:26:08 +0000 (Thu, 19 Aug 2010)
Log Message:
-----------
closes #366
also removes exception for non-existing .terrn.as file
disabled shadow debugging (stencil shadows working again)
Modified Paths:
--------------
trunk/source/main/Beam.cpp
trunk/source/main/CmdKeyInertia.cpp
trunk/source/main/InputEngine.cpp
trunk/source/main/RoRFrameListener.cpp
trunk/source/main/ShadowManager.cpp
Modified: trunk/source/main/Beam.cpp
===================================================================
--- trunk/source/main/Beam.cpp 2010-08-18 16:53:16 UTC (rev 1519)
+++ trunk/source/main/Beam.cpp 2010-08-19 11:26:08 UTC (rev 1520)
@@ -8616,18 +8616,20 @@
float rate=1;
if(hydroSpeedCoupling)
{
- rate=40.0/(10.0+fabs(wspeed/2.0));
-
+ //new rate value (30 instead of 40) to deal with the
changed cmdKeyInertia settings
+ rate=30.0/(10.0+fabs(wspeed/2.0));
// minimum rate: 20% --> enables to steer high velocity
trucks
if(rate<1.2) rate = 1.2;
}
- if (hydrodircommand!=0)
- {
- if (hydrodirstate > hydrodircommand)
- hydrodirstate -= dt * rate;
- else
- hydrodirstate += dt * rate;
- }
+ //need a maximum rate for analog devices, otherwise hydro beams
break
+ if (!hydroSpeedCoupling)
+ rate=100;
+
+ if (hydrodirstate > hydrodircommand)
+ hydrodirstate -= dt * rate;
+ else
+ hydrodirstate += dt * rate;
+
if(hydroSpeedCoupling)
{
float dirdelta=dt;
Modified: trunk/source/main/CmdKeyInertia.cpp
===================================================================
--- trunk/source/main/CmdKeyInertia.cpp 2010-08-18 16:53:16 UTC (rev 1519)
+++ trunk/source/main/CmdKeyInertia.cpp 2010-08-19 11:26:08 UTC (rev 1520)
@@ -35,8 +35,8 @@
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[i].startDelay=0;
+ cmdKeyInertia[i].stopDelay=0;
}
}
CmdKeyInertia::~CmdKeyInertia()
Modified: trunk/source/main/InputEngine.cpp
===================================================================
--- trunk/source/main/InputEngine.cpp 2010-08-18 16:53:16 UTC (rev 1519)
+++ trunk/source/main/InputEngine.cpp 2010-08-19 11:26:08 UTC (rev 1520)
@@ -2119,16 +2119,21 @@
std::vector<event_trigger_t> t_vec = events[eventID];
if(t_vec.size() > 0)
{
- if(t_vec[0].eventtype == ET_MouseAxisX \
- || t_vec[0].eventtype == ET_MouseAxisY \
- || t_vec[0].eventtype == ET_MouseAxisZ \
- || t_vec[0].eventtype == ET_JoystickAxisAbs \
- || t_vec[0].eventtype == ET_JoystickAxisRel \
- || t_vec[0].eventtype == ET_JoystickSliderX \
- || t_vec[0].eventtype == ET_JoystickSliderY)
- return true;
- else
- return false;
+ //loop through all eventtypes, because we want to find a analog
device wether it is the first device or not
+ //this means a analog device is always preferred over a digital
one
+ for (unsigned int i=0;i<t_vec.size();i++)
+ {
+ if(t_vec[i].eventtype == ET_MouseAxisX \
+ || t_vec[i].eventtype == ET_MouseAxisY \
+ || t_vec[i].eventtype == ET_MouseAxisZ \
+ || t_vec[i].eventtype == ET_JoystickAxisAbs \
+ || t_vec[i].eventtype == ET_JoystickAxisRel \
+ || t_vec[i].eventtype == ET_JoystickSliderX \
+ || t_vec[i].eventtype == ET_JoystickSliderY)
+ {
+ return true;
+ }
+ }
}
return false;
#if 0
Modified: trunk/source/main/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/RoRFrameListener.cpp 2010-08-18 16:53:16 UTC (rev
1519)
+++ trunk/source/main/RoRFrameListener.cpp 2010-08-19 11:26:08 UTC (rev
1520)
@@ -4544,7 +4544,8 @@
if(!netmode)
{
LogManager::getSingleton().logMessage("Loading Angelscript
Script engine." );
-
ScriptEngine::getSingleton().loadTerrainScript(terrainfile+".as");
+
if(ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(terrainfile+".as"))
+
ScriptEngine::getSingleton().loadTerrainScript(terrainfile+".as");
}
#endif
@@ -5885,24 +5886,6 @@
//no, not yet, Caelum is not ready!
//if (envmap) envmap->update(Vector3(terrainxsize/2.0,
hfinder->getHeightAt(terrainxsize/2.0, terrainzsize/2.0)+50.0,
terrainzsize/2.0));
-#if OGRE_VERSION>0x010602
-#if 0
- // disabled for now, to be cleaned up and moved into the shadowmanager
- if (SETTINGS.getSetting("Shadow technique")=="Parallel-split Shadow
Maps")
- {
- Ogre::ResourceManager::ResourceMapIterator RI =
Ogre::MaterialManager::getSingleton().getResourceIterator();
- while (RI.hasMoreElements())
- {
- Ogre::MaterialPtr mat = RI.getNext();
- if(mat.isNull()) continue;
- if(!mat->getNumTechniques()) continue;
- if (mat->getTechnique(0)->getPass("SkyLight") != NULL)
-
mat->getTechnique(0)->getPass("SkyLight")->getFragmentProgramParameters()->setNamedConstant("pssmSplitPoints",
splitPoints);
- }
- }
-#endif //0
-#endif //OGRE_VERSION
-
}
void RoRFrameListener::updateXFire()
Modified: trunk/source/main/ShadowManager.cpp
===================================================================
--- trunk/source/main/ShadowManager.cpp 2010-08-18 16:53:16 UTC (rev 1519)
+++ trunk/source/main/ShadowManager.cpp 2010-08-19 11:26:08 UTC (rev 1520)
@@ -65,7 +65,7 @@
mSceneMgr->setShadowTechnique(tech);
mSceneMgr->setShadowFarDistance(shadowFarDistance);
- mSceneMgr->setShowDebugShadows(true);
+ mSceneMgr->setShowDebugShadows(false);
if(tech == SHADOWTYPE_STENCIL_MODULATIVE)
{
@@ -114,7 +114,7 @@
}
mSceneMgr->setShadowCameraSetup(mPSSMSetup);
- bool depthShadows = false;
+ bool depthShadows = true;
if (depthShadows)
{
mSceneMgr->setShadowTextureCount(3);
@@ -149,6 +149,19 @@
matProfile->setReceiveDynamicShadowsDepth(depthShadows);
matProfile->setReceiveDynamicShadowsPSSM(static_cast<PSSMShadowCameraSetup*>(mPSSMSetup.get()));
}
+
+ /*
+ Ogre::ResourceManager::ResourceMapIterator RI =
Ogre::MaterialManager::getSingleton().getResourceIterator();
+ while (RI.hasMoreElements())
+ {
+ Ogre::MaterialPtr mat = RI.getNext();
+ if(mat.isNull()) continue;
+ if(!mat->getNumTechniques()) continue;
+ if (mat->getTechnique(0)->getPass("SkyLight") != NULL)
+
mat->getTechnique(0)->getPass("SkyLight")->getFragmentProgramParameters()->setNamedConstant("pssmSplitPoints",
splitPoints);
+ }
+ */
+
#else
showError("Parallel-split Shadow Maps as shadow technique is
only available when you build with Ogre 1.6 support.", "PSSM error");
exit(1);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel