dmitrysenkovich

Untitled

Aug 21st, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 9.33 KB | None | 0 0
  1. Index: Base/Header/Avionics/Sensors/avSimpleRadar.h
  2. ===================================================================
  3. --- Base/Header/Avionics/Sensors/avSimpleRadar.h    (revision 91428)
  4. +++ Base/Header/Avionics/Sensors/avSimpleRadar.h    (working copy)
  5. @@ -9,6 +9,7 @@
  6.  #include "Utilities/ccTriggerSystem.h"
  7.  #include "Utilities/ccUtilities.h"
  8.  #include "Avionics/avSimpleElectricSystem.h"
  9. +#include "edTerrain/ITerrain.h"
  10.  
  11.  class woSpot;
  12.  
  13. @@ -137,8 +138,13 @@
  14.  protected:
  15.     radar_capabilities         basic_capabilities;             
  16.  
  17. +#ifndef USE_TERRAIN4
  18.     landscape::lPointOnSurface surf_info;
  19.     landscape::lPointOnSurface surf_info_2;
  20. +#else
  21. +   edterrain::PointOnSurfaceAdapter surf_info;
  22. +   edterrain::PointOnSurfaceAdapter surf_info_2;
  23. +#endif
  24.  
  25.     woSpot              *spot;
  26.  
  27. Index: Base/Header/Avionics/Sensors/avTVSensor.h
  28. ===================================================================
  29. --- Base/Header/Avionics/Sensors/avTVSensor.h   (revision 91428)
  30. +++ Base/Header/Avionics/Sensors/avTVSensor.h   (working copy)
  31. @@ -3,6 +3,7 @@
  32.  #include "ICommandsCockpitDevice.h"
  33.  #include "viLight.h"
  34.  #include "Avionics/Sensors/avBasicSensor.h"
  35. +#include "edTerrain/ITerrain.h"
  36.  
  37.  #ifdef  _DEBUG
  38.  #include "Renderer/DbgGraph.h"
  39. @@ -125,7 +126,11 @@
  40.  
  41.     class COCKPITBASE_API avTVSensor : public avBasicSensor
  42.     {
  43. +#ifndef USE_TERRAIN4
  44.          mutable landscape::lPointOnSurface _terrain_visibility_check_pnt_;
  45. +#else
  46. +       mutable edterrain::PointOnSurface _terrain_visibility_check_pnt_;
  47. +#endif
  48.     public:
  49.         avTVSensor();
  50.        ~avTVSensor();
  51. Index: Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h
  52. ===================================================================
  53. --- Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h (revision 91428)
  54. +++ Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h (working copy)
  55. @@ -1,6 +1,7 @@
  56.  #pragma once
  57.  
  58.  #include "Avionics/Sensors/avTVSensor.h"
  59. +#include "edTerrain/ITerrain.h"
  60.  
  61.  namespace cockpit {
  62.  
  63. @@ -120,6 +121,10 @@
  64.         bool   forceCorrelateEnabled;
  65.          wModelTime forceCorrelateEnableTime;
  66.  
  67. +#ifndef USE_TERRAIN4
  68.         mutable landscape::lPointOnSurface surfInfo;
  69. +#else
  70. +       mutable edterrain::PointOnSurface surfInfo;
  71. +#endif
  72.     };
  73.  }
  74. Index: Base/SConscript
  75. ===================================================================
  76. --- Base/SConscript (revision 91428)
  77. +++ Base/SConscript (working copy)
  78. @@ -7,7 +7,6 @@
  79.     'edCore',
  80.     'edMath',
  81.     'edObjects',
  82. -   'edTerrain',
  83.     'World',
  84.     'WorldGeneral',
  85.     'Inter',
  86. @@ -30,6 +29,13 @@
  87.     'renderer',
  88.  ]
  89.  
  90. +if env.has_key('TERRAIN4'):
  91. +   CPPDEFINES += ['USE_TERRAIN4',]
  92. +else:
  93. +   libs += [
  94. +       'edTerrain',
  95. +   ]
  96. +
  97.  if not env.getUserVariable('FINAL_VERSION'):
  98.     libs.append('JConfigurator')
  99.  
  100. Index: Base/Source/Avionics/Sensors/avSimpleRadar.cpp
  101. ===================================================================
  102. --- Base/Source/Avionics/Sensors/avSimpleRadar.cpp  (revision 91428)
  103. +++ Base/Source/Avionics/Sensors/avSimpleRadar.cpp  (working copy)
  104. @@ -7,7 +7,6 @@
  105.  #include "viObjectManager.h"
  106.  #include "wsType_Level4.h"
  107.  #include "wConst.h"
  108. -#include "wTerrain.h"
  109.  #include "wsInitData.h"
  110.  #include "IwInfo.h"
  111.  #include "Math\_math.h"
  112. @@ -20,6 +19,7 @@
  113.  #include "Utilities/ccTriggerSystem.h"
  114.  #include "woSpot.h"
  115.  #include "wDetectable.h"
  116. +#include "wTerrain.h"
  117.  
  118.  using namespace cockpit;
  119.  
  120. @@ -643,8 +643,14 @@
  121.         dVector end_   = antenna_pos.p + antenna_pos.x * d
  122.                                        + antenna_pos.y * 0.5 * h * d *rnd_y
  123.                                        + antenna_pos.z * 0.5 * w * d *rnd_z;
  124. +#ifndef USE_TERRAIN4
  125.         if (surf_info.intersectSurface(start_,end_,&res_))
  126.             make_ground_spot(res_);
  127. +#else
  128. +       cPoint res;
  129. +       if (globalLand->groundIntersection(start_,end_,res))
  130. +           make_ground_spot(res_);
  131. +#endif
  132.     }
  133.  }
  134.  
  135. Index: Base/Source/Avionics/Sensors/avTVSensor.cpp
  136. ===================================================================
  137. --- Base/Source/Avionics/Sensors/avTVSensor.cpp (revision 91428)
  138. +++ Base/Source/Avionics/Sensors/avTVSensor.cpp (working copy)
  139. @@ -14,6 +14,7 @@
  140.  #include "Modeler/Utility.h"
  141.  #include "Registry/RegisterManager.h"
  142.  #include "Avionics/Sensors/avSensorRoutines.h"
  143. +#include "wTerrain.h"
  144.  
  145.  using namespace cockpit;
  146.  
  147. @@ -404,11 +405,16 @@
  148.      if (with_objects)
  149.      {
  150.          max_dist = 50000;
  151. +#ifndef USE_TERRAIN4
  152.          dVector res;
  153. +#else
  154. +       cPoint res;
  155. +#endif
  156.          cVector start_ = getPlatformPosition().p;
  157.          cVector dir_   = getPlatformPosition().x;
  158.          cVector end_   = start_ + dir_ * max_dist;
  159. -        // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе      
  160. +        // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе
  161. +#ifndef USE_TERRAIN4
  162.          if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res))
  163.          {
  164.              gyro_stabilize_point = res;
  165. @@ -415,6 +421,14 @@
  166.              end_                 = res;
  167.              max_dist             =(res - start_).length();
  168.          }
  169. +#else
  170. +       if (globalLand->groundIntersection(end_,start_,res))
  171. +        {
  172. +            gyro_stabilize_point = res;
  173. +            end_                 = res;
  174. +            max_dist             =(res - start_).length();
  175. +        }
  176. +#endif
  177.          unsigned stationary_object = viMapObject |
  178.                                       viMissionObject |
  179.                                       viMapMissionObject |
  180. @@ -494,11 +508,18 @@
  181.  
  182.      dVector p = pos.p;
  183.      // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе
  184. +#ifndef USE_TERRAIN4
  185.     if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0))
  186.     {
  187.         return false;
  188.     }
  189. -  
  190. +#else
  191. +   cPoint ncPoint;
  192. +   if (globalLand->groundIntersection(p,self_p,ncPoint))
  193. +   {
  194. +       return false;
  195. +   }
  196. +#endif
  197.         if (!checkTargetTVvisibility(p,maxdistance))
  198.     {
  199.         return false;
  200. Index: Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp
  201. ===================================================================
  202. --- Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp  (revision 91428)
  203. +++ Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp  (working copy)
  204. @@ -15,6 +15,7 @@
  205.  #include "Utilities/ccTriggerSystem.h"
  206.  #include "mathDebug.h"
  207.  #include "unit_converter.h"
  208. +#include "wTerrain.h"
  209.  
  210.  using namespace cockpit;
  211.  
  212. @@ -403,9 +404,13 @@
  213.      {
  214.          if (!ElevationIsFixed)
  215.          {
  216. +#ifndef USE_TERRAIN4
  217.              static landscape::lPointOnSurface surfInfo;
  218.              surfInfo.set(out.p.x, out.p.z);
  219.              lead_target_level = surfInfo.getHeight();
  220. +#else
  221. +           lead_target_level = globalLand->heightSurface(out.p.x, out.p.z);
  222. +#endif
  223.          }
  224.          else
  225.              lead_target_level = target_level;
  226. @@ -456,9 +461,13 @@
  227.      {
  228.          if (!ElevationIsFixed)
  229.          {
  230. +#ifndef USE_TERRAIN4
  231.              static landscape::lPointOnSurface surfInfo;
  232.              surfInfo.set(lead_human_position.p.x, lead_human_position.p.z);
  233.              lead_target_level = surfInfo.getHeight();
  234. +#else
  235. +           lead_target_level = globalLand->heightSurface(lead_human_position.p.x, lead_human_position.p.z);
  236. +#endif
  237.          }
  238.          else
  239.              lead_target_level = target_level;
  240. Index: Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp
  241. ===================================================================
  242. --- Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp   (revision 91428)
  243. +++ Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp   (working copy)
  244. @@ -714,13 +714,24 @@
  245.  double eqTVGuidedWeapon::get_real_distance_to_terrain() const
  246.  {
  247.     const float max_distance = 120000.0f;
  248. +#ifndef USE_TERRAIN4
  249.     dVector res;
  250. +#else
  251. +   cPoint res;
  252. +#endif
  253.     const dPosition& platform_position = getPlatformPosition();
  254.  
  255. +#ifndef USE_TERRAIN4
  256.     if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, &res))
  257.     {
  258.         return (res - platform_position.p).length();
  259.     }
  260. +#else
  261. +   if (globalLand->groundIntersection(platform_position.p, platform_position.p + platform_position.x * max_distance, res))
  262. +   {
  263. +       return (res - platform_position.p).length();
  264. +   }
  265. +#endif
  266.  
  267.     return 0.0;
  268.  }
  269. Index: Base/Source/Utilities/ccLuaLoader.cpp
  270. ===================================================================
  271. --- Base/Source/Utilities/ccLuaLoader.cpp   (revision 91428)
  272. +++ Base/Source/Utilities/ccLuaLoader.cpp   (working copy)
  273. @@ -37,6 +37,7 @@
  274.  #include "smSceneManager.h"
  275.  #include "Oculus.h"
  276.  #include "IwWorld.h"
  277. +#include "wTerrain.h"
  278.  
  279.  using namespace cockpit;
  280.  using namespace Common;
  281. @@ -307,7 +308,12 @@
  282.     }
  283.     const char * data_name     = lua_tostring(L,1);
  284.  
  285. +#ifndef USE_TERRAIN4
  286.     lua_State  * terrain_state =  GetTerraDispatch()->getTerrainCfg();
  287. +#else
  288. +   lua_State  * terrain_state =  globalLand->getTerrainCfg();
  289. +#endif
  290. +
  291.     lua_getglobal(terrain_state,data_name);
  292.     {
  293.         ED_lua_copyindex (L,terrain_state,-1);
Advertisement
Add Comment
Please, Sign In to add comment