Revision: 2711
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2711&view=rev
Author:   ulteq
Date:     2012-05-26 20:31:50 +0000 (Sat, 26 May 2012)
Log Message:
-----------
fixed using namespace Ogre; in header

Modified Paths:
--------------
    trunk/source/main/gfx/DustPool.cpp
    trunk/source/main/physics/Beam.cpp
    trunk/source/main/physics/water/buoyance.cpp
    trunk/source/main/physics/water/buoyance.h
    trunk/source/main/physics/water/screwprop.cpp
    trunk/source/main/physics/water/screwprop.h

Modified: trunk/source/main/gfx/DustPool.cpp
===================================================================
--- trunk/source/main/gfx/DustPool.cpp  2012-05-26 20:12:51 UTC (rev 2710)
+++ trunk/source/main/gfx/DustPool.cpp  2012-05-26 20:31:50 UTC (rev 2711)
@@ -19,9 +19,9 @@
 */
 #include "DustPool.h"
 
-#include "Water.h"
 #include "RoRPrerequisites.h"
 #include "TerrainManager.h"
+#include "Water.h"
 
 using namespace Ogre;
 

Modified: trunk/source/main/physics/Beam.cpp
===================================================================
--- trunk/source/main/physics/Beam.cpp  2012-05-26 20:12:51 UTC (rev 2710)
+++ trunk/source/main/physics/Beam.cpp  2012-05-26 20:31:50 UTC (rev 2711)
@@ -80,7 +80,7 @@
 int Beam::thread_mode = THREAD_SINGLE;
 int Beam::free_tb = 0;
 
-Beam::Beam(int tnum, Ogre::Vector3 pos, Quaternion rot, const char* fname, 
bool networked, bool networking, collision_box_t *spawnbox, bool ismachine, int 
_flaresMode, std::vector<String> *_truckconfig, Skin *skin, bool freeposition) :
+Beam::Beam(int tnum , Real pos , Quaternion rot , const char* fname , bool 
networked/* =false  */, bool networking/* =false  */, collision_box_t 
*spawnbox/* =NULL  */, bool ismachine/* =false  */, int flareMode/* =0  */, 
std::vector<String> *truckconfig/* =0  */, Skin *skin/* =0  */, bool 
freeposition/* =false */) :
          deleting(false)
        , abs_state(false)
        , abs_timer(0.0)
@@ -2809,7 +2809,7 @@
                Vector3 upv   = dirv.crossProduct(-rollv);
                float rollangle = asin(rollv.dotProduct(Vector3::UNIT_Y));
                // rad to deg
-               rollangle = Ogre::Math::RadiansToDegrees(rollangle);
+               rollangle = Math::RadiansToDegrees(rollangle);
                // flip to other side when upside down
                if (upv.y < 0) rollangle = 180.0f - rollangle;
                cstate = rollangle / 180.0f;
@@ -2825,7 +2825,7 @@
                Vector3 dirv  = (cam_pos - cam_dir ).normalisedCopy();
                float pitchangle = asin(dirv.dotProduct(Vector3::UNIT_Y));
                // radian to degrees with a max cstate of +/- 1.0
-               cstate = (Ogre::Math::RadiansToDegrees(pitchangle) / 90.0f);
+               cstate = (Math::RadiansToDegrees(pitchangle) / 90.0f);
                div++;
        }
 
@@ -5426,7 +5426,7 @@
                        // do work
                        beam->threadentry(id);
                }
-       } catch(Ogre::Exception& e)
+       } catch(Exception& e)
        {
                // try to shutdown input system upon an error
                if (InputEngine::getSingletonPtrNoCreation())

Modified: trunk/source/main/physics/water/buoyance.cpp
===================================================================
--- trunk/source/main/physics/water/buoyance.cpp        2012-05-26 20:12:51 UTC 
(rev 2710)
+++ trunk/source/main/physics/water/buoyance.cpp        2012-05-26 20:31:50 UTC 
(rev 2711)
@@ -21,8 +21,12 @@
 
 #include "BeamData.h"
 #include "DustManager.h"
-#include "IWater.h"
+#include "DustPool.h"
+#include "TerrainManager.h"
+#include "Water.h"
 
+using namespace Ogre;
+
 Buoyance::Buoyance()
 {
        update=0;
@@ -31,7 +35,6 @@
        ripplep = DustManager::getSingleton().getDustPool("ripple");
 }
 
-
 //compute tetrahedron volume
 inline float Buoyance::computeVolume(Vector3 o, Vector3 a, Vector3 b, Vector3 
c)
 {
@@ -51,9 +54,9 @@
        if (type!=BUOY_DRAGONLY)
        {
                //compute pression prism points
-               Vector3 ap=a+(w->getHeightWaves(a)-a.y)*9810*normal;
-               Vector3 bp=b+(w->getHeightWaves(b)-b.y)*9810*normal;
-               Vector3 cp=c+(w->getHeightWaves(c)-c.y)*9810*normal;
+               Vector3 
ap=a+(gEnv->terrainManager->getWater()->getHeightWaves(a)-a.y)*9810*normal;
+               Vector3 
bp=b+(gEnv->terrainManager->getWater()->getHeightWaves(b)-b.y)*9810*normal;
+               Vector3 
cp=c+(gEnv->terrainManager->getWater()->getHeightWaves(c)-c.y)*9810*normal;
                //find centroid
                Vector3 ctd=(a+b+c+ap+bp+cp)/6.0;
                //compute volume
@@ -73,7 +76,7 @@
                //take in account the wave speed
                //compute center
                Vector3 tc=(a+b+c)/3.0;
-               vel=vel-w->getVelocity(tc);
+               vel=vel-gEnv->terrainManager->getWater()->getVelocity(tc);
                float vell=vel.length();
                if (vell>0.01)
                {
@@ -88,9 +91,9 @@
                                {
                                        Vector3 fxdir=fxl*normal;
                                        if (fxdir.y<0) fxdir.y=-fxdir.y;
-                                       if (w->getHeightWaves(a)-a.y<0.1) 
splashp->malloc(a, fxdir);
-                                       else if (w->getHeightWaves(b)-b.y<0.1) 
splashp->malloc(b, fxdir);
-                                       else if (w->getHeightWaves(c)-c.y<0.1) 
splashp->malloc(c, fxdir);
+                                       if 
(gEnv->terrainManager->getWater()->getHeightWaves(a)-a.y<0.1) 
splashp->malloc(a, fxdir);
+                                       else if 
(gEnv->terrainManager->getWater()->getHeightWaves(b)-b.y<0.1) 
splashp->malloc(b, fxdir);
+                                       else if 
(gEnv->terrainManager->getWater()->getHeightWaves(c)-c.y<0.1) 
splashp->malloc(c, fxdir);
                                }
                        }
                }
@@ -103,7 +106,7 @@
 //compute pressure and drag forces on a random triangle
 Vector3 Buoyance::computePressureForce(Vector3 a, Vector3 b, Vector3 c, 
Vector3 vel, int type)
 {
-       float wha=w->getHeightWaves((a+b+c)/3.0);
+       float wha=gEnv->terrainManager->getWater()->getHeightWaves((a+b+c)/3.0);
        //check if fully emerged
        if (a.y>wha && b.y>wha && c.y>wha) return Vector3::ZERO;
        //check if semi emerged
@@ -155,7 +158,7 @@
 }
 void Buoyance::computeNodeForce(node_t *a, node_t *b, node_t *c, int doupdate, 
int type)
 {
-       if (a->AbsPosition.y>w->getHeightWaves(a->AbsPosition) && 
b->AbsPosition.y>w->getHeightWaves(b->AbsPosition) && 
c->AbsPosition.y>w->getHeightWaves(c->AbsPosition)) return;
+       if 
(a->AbsPosition.y>gEnv->terrainManager->getWater()->getHeightWaves(a->AbsPosition)
 && 
b->AbsPosition.y>gEnv->terrainManager->getWater()->getHeightWaves(b->AbsPosition)
 && 
c->AbsPosition.y>gEnv->terrainManager->getWater()->getHeightWaves(c->AbsPosition))
 return;
        //compute center
        Vector3 m=(a->AbsPosition+b->AbsPosition+c->AbsPosition)/3.0;
        //compute projected points

Modified: trunk/source/main/physics/water/buoyance.h
===================================================================
--- trunk/source/main/physics/water/buoyance.h  2012-05-26 20:12:51 UTC (rev 
2710)
+++ trunk/source/main/physics/water/buoyance.h  2012-05-26 20:31:50 UTC (rev 
2711)
@@ -22,15 +22,8 @@
 
 #include "RoRPrerequisites.h"
 
-#include "DustPool.h"
-
 class Buoyance
 {
-private:
-       int update;
-       int sink;
-       DustPool *splashp, *ripplep;
-
 public:
 
        Buoyance();
@@ -40,16 +33,22 @@
        inline float computeVolume(Ogre::Vector3 o, Ogre::Vector3 a, 
Ogre::Vector3 b, Ogre::Vector3 c);
 
        //compute pressure and drag force on a submerged triangle
-       Vector3 computePressureForceSub(Ogre::Vector3 a, Ogre::Vector3 b, 
Ogre::Vector3 c, Ogre::Vector3 vel, int type);
+       Ogre::Vector3 computePressureForceSub(Ogre::Vector3 a, Ogre::Vector3 b, 
Ogre::Vector3 c, Ogre::Vector3 vel, int type);
        
        //compute pressure and drag forces on a random triangle
-       Vector3 computePressureForce(Ogre::Vector3 a, Ogre::Vector3 b, 
Ogre::Vector3 c, Ogre::Vector3 vel, int type);
+       Ogre::Vector3 computePressureForce(Ogre::Vector3 a, Ogre::Vector3 b, 
Ogre::Vector3 c, Ogre::Vector3 vel, int type);
        
        void computeNodeForce(node_t *a, node_t *b, node_t *c, int doupdate, 
int type);
 
        void setsink(int v);
 
        enum { BUOY_NORMAL, BUOY_DRAGONLY, BUOY_DRAGLESS };
+
+private:
+
+       DustPool *splashp, *ripplep;
+       int sink;
+       int update;
 };
 
 #endif // __Buoyance_H_

Modified: trunk/source/main/physics/water/screwprop.cpp
===================================================================
--- trunk/source/main/physics/water/screwprop.cpp       2012-05-26 20:12:51 UTC 
(rev 2710)
+++ trunk/source/main/physics/water/screwprop.cpp       2012-05-26 20:31:50 UTC 
(rev 2711)
@@ -21,9 +21,13 @@
 
 #include "BeamData.h"
 #include "DustManager.h"
-#include "IWater.h"
+#include "DustPool.h"
 #include "SoundScriptManager.h"
+#include "TerrainManager.h"
+#include "Water.h"
 
+using namespace Ogre;
+
 Screwprop::Screwprop(node_t *nodes, int noderef, int nodeback, int nodeup, 
float fullpower, int trucknum) :
          nodes(nodes)
        , noderef(noderef)
@@ -40,7 +44,7 @@
 void Screwprop::updateForces(int update)
 {
        if (!water) return;
-       float 
depth=water->getHeightWaves(nodes[noderef].AbsPosition)-nodes[noderef].AbsPosition.y;
+       float 
depth=gEnv->terrainManager->getWater()->getHeightWaves(nodes[noderef].AbsPosition)-nodes[noderef].AbsPosition.y;
        if (depth<0) return; //out of water!
        Vector3 dir=nodes[nodeback].RelPosition-nodes[noderef].RelPosition;
        Vector3 rudaxis=nodes[noderef].RelPosition-nodes[nodeup].RelPosition;

Modified: trunk/source/main/physics/water/screwprop.h
===================================================================
--- trunk/source/main/physics/water/screwprop.h 2012-05-26 20:12:51 UTC (rev 
2710)
+++ trunk/source/main/physics/water/screwprop.h 2012-05-26 20:31:50 UTC (rev 
2711)
@@ -17,32 +17,17 @@
 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 __Screwprop_H_
-#define __Screwprop_H_
+#ifndef __ScrewProp_H_
+#define __ScrewProp_H_
 
 #include "RoRPrerequisites.h"
 
-#include "DustPool.h"
-
 class Screwprop
 {
-private:
-       node_t *nodes;
-       int nodeback;
-       int nodeup;
-       float fullpower; //in HP
-       Water* water;
-       int trucknum;
-       DustPool *splashp, *ripplep;
-
 public:
-       int noderef;
 
-       bool reverse;
-       float throtle;
-       float rudder;
+       Screwprop(node_t *nd, int nr, int nb, int nu, float power, int 
trucknum);
 
-       Screwprop(node_t *nd, int nr, int nb, int nu, float power, Water* w, 
int trucknum);
        void updateForces(int update);
        void setThrottle(float val);
        void setRudder(float val);
@@ -50,6 +35,21 @@
        float getRudder();
        void reset();
        void toggleReverse();
+
+private:
+
+       DustPool *splashp, *ripplep;
+       Water* water;
+       bool reverse;
+       float fullpower; //in HP
+       float rudder;
+       float throtle;
+       int nodeback;
+       int noderef;
+       int nodeup;
+       int trucknum;
+       node_t *nodes;
+
 };
 
-#endif // __Screwprop_H_
+#endif // __ScrewProp_H_

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to