Revision: 2752
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2752&view=rev
Author:   rorthomas
Date:     2012-05-29 03:31:49 +0000 (Tue, 29 May 2012)
Log Message:
-----------
fixed last big problems with the new terrain, working now :D

Modified Paths:
--------------
    trunk/source/main/gameplay/Character.h
    trunk/source/main/gameplay/RoRFrameListener.cpp
    trunk/source/main/gameplay/RoRFrameListener.h
    trunk/source/main/physics/collision/Collisions.cpp
    trunk/source/main/physics/collision/Collisions.h
    trunk/source/main/terrain/TerrainManager.cpp
    trunk/source/main/terrain/TerrainManager.h

Modified: trunk/source/main/gameplay/Character.h
===================================================================
--- trunk/source/main/gameplay/Character.h      2012-05-29 02:47:32 UTC (rev 
2751)
+++ trunk/source/main/gameplay/Character.h      2012-05-29 03:31:49 UTC (rev 
2752)
@@ -45,7 +45,6 @@
 
        void setBeamCoupling(bool enabled, Beam *truck = 0);
        void setColour(int color) { this->colourNumber = color; };
-       void setHFinder(HeightFinder *hFinder);
        void setPhysicsEnabled(bool enabled) { physicsEnabled = enabled; };
        void setPosition(Ogre::Vector3 position);
        void setRotation(Ogre::Radian rotation);

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-29 02:47:32 UTC 
(rev 2751)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-29 03:31:49 UTC 
(rev 2752)
@@ -2845,40 +2845,11 @@
        if (loadmanual)
        {
                Beam *b = 0;
-               Vector3 spawnpos = Vector3(truckx, trucky, truckz);
+               Vector3 spawnpos = gEnv->terrainManager->getSpawnPos();
                Quaternion spawnrot = Quaternion::ZERO;
 
-               if (net)
-               {
-                       if (selectedExtension.size() > 0)
-                       {
-                               String nsp = SSETTING("net spawn location", "");
-                               if (!nsp.empty())
-                               {
-                                       // override-able by cmd line
-                                       spawnpos = 
StringConverter::parseVector3(nsp);
-                                       spawnrot = Quaternion::ZERO;
-                               } else
-                               {
-                                       // classical, search start points
-                                       try
-                                       {
-                                               //spawnpos = 
netSpawnPos[selectedExtension].pos;
-                                               //spawnrot = 
netSpawnPos[selectedExtension].rot;
-                                       } catch(...)
-                                       {
-                                               spawnpos = Vector3(truckx, 
trucky, truckz);
-                                               spawnrot = Quaternion::ZERO;
-                                       }
-                               }
-                       }
-               }
+               b = BeamFactory::getSingleton().createLocal(spawnpos, spawnrot, 
selectedchr, 0, false, flaresMode, truckconfig, skin);
 
-               if (net)
-                       b = BeamFactory::getSingleton().createLocal(spawnpos, 
spawnrot, selectedchr, 0, false, flaresMode, truckconfig, skin);
-               else
-                       b = 
BeamFactory::getSingleton().createLocal(Vector3(truckx, trucky, truckz), 
Quaternion::ZERO, selectedchr, 0, false, flaresMode, truckconfig, skin);
-
                if (enterTruck)
                {
                        if (b)
@@ -2890,6 +2861,8 @@
 #ifdef USE_MYGUI
                if (b && surveyMap)
                {
+                       /*
+                       // TODO: FIX
                        MapEntity *e = 
surveyMap->createNamedMapEntity("Truck"+TOSTRING(b->trucknum), 
MapControl::getTypeByDriveable(b->driveable));
                        if (e)
                        {
@@ -2898,6 +2871,7 @@
                                e->setPosition(truckx, truckz);
                                
e->setRotation(-Radian(b->getHeadingDirectionAngle()));
                        }
+                       */
                }
 #endif //USE_MYGUI
 

Modified: trunk/source/main/gameplay/RoRFrameListener.h
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.h       2012-05-29 02:47:32 UTC 
(rev 2751)
+++ trunk/source/main/gameplay/RoRFrameListener.h       2012-05-29 03:31:49 UTC 
(rev 2752)
@@ -155,7 +155,7 @@
        float mouseGrabForce;
        float terrainxsize;
        float terrainzsize;
-       float truckx, trucky, truckz;
+       //float truckx, trucky, truckz;
 
        int flaresMode;
        int free_localizer;

Modified: trunk/source/main/physics/collision/Collisions.cpp
===================================================================
--- trunk/source/main/physics/collision/Collisions.cpp  2012-05-29 02:47:32 UTC 
(rev 2751)
+++ trunk/source/main/physics/collision/Collisions.cpp  2012-05-29 03:31:49 UTC 
(rev 2752)
@@ -116,13 +116,14 @@
        , free_collision_tri(0)
        , free_eventsource(0)
        , hashmask(0)
-       , hFinder(0)
        , landuse(0)
        , largest_cellcount(0)
        , last_called_cbox(0)
        , last_used_ground_model(0)
        , max_col_tris(MAX_COLLISION_TRIS)
 {
+       hFinder = gEnv->terrainManager->getHeightFinder();
+
        debugMode = BSETTING("Collision Debug Mode", false);
        for (int i=0; i < HASH_POWER; i++)
        {
@@ -370,11 +371,6 @@
        return &ground_models[name];
 }
 
-void Collisions::setHfinder(IHeightFinder *hFinder)
-{
-       hFinder = hFinder;
-}
-
 unsigned int Collisions::hashfunc(unsigned int cellid)
 {
        unsigned int hash = 0;

Modified: trunk/source/main/physics/collision/Collisions.h
===================================================================
--- trunk/source/main/physics/collision/Collisions.h    2012-05-29 02:47:32 UTC 
(rev 2751)
+++ trunk/source/main/physics/collision/Collisions.h    2012-05-29 03:31:49 UTC 
(rev 2752)
@@ -152,8 +152,6 @@
        Ogre::Quaternion getDirection(char* instance, char* box);
        collision_box_t *getBox(char* instance, char* box);
 
-       void setHfinder(IHeightFinder *hf);
-
        eventsource_t *isTruckInEventBox(Beam *truck);
 
        bool collisionCorrect(Ogre::Vector3 *refpos);

Modified: trunk/source/main/terrain/TerrainManager.cpp
===================================================================
--- trunk/source/main/terrain/TerrainManager.cpp        2012-05-29 02:47:32 UTC 
(rev 2751)
+++ trunk/source/main/terrain/TerrainManager.cpp        2012-05-29 03:31:49 UTC 
(rev 2752)
@@ -46,7 +46,7 @@
 TerrainManager::TerrainManager() :
          loading_state(NONE_LOADED)
 {
-
+       gravity = DEFAULT_GRAVITY;
 }
 
 TerrainManager::~TerrainManager()

Modified: trunk/source/main/terrain/TerrainManager.h
===================================================================
--- trunk/source/main/terrain/TerrainManager.h  2012-05-29 02:47:32 UTC (rev 
2751)
+++ trunk/source/main/terrain/TerrainManager.h  2012-05-29 03:31:49 UTC (rev 
2752)
@@ -51,6 +51,7 @@
        SkyManager *getSkyManager() { return sky_manager; };
        Water *getWater() { return water; };
        Ogre::Light *getMainLight() { return main_light; };
+       Ogre::Vector3 getSpawnPos() { return start_position; };
 
 protected:
        // members

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to