dmitrysenkovich

Untitled

Aug 21st, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: Header/Avionics/Sensors/avSimpleRadar.h
  2. ===================================================================
  3. --- Header/Avionics/Sensors/avSimpleRadar.h (revision 91428)
  4. +++ 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: Header/Avionics/Sensors/avTVSensor.h
  28. ===================================================================
  29. --- Header/Avionics/Sensors/avTVSensor.h    (revision 91428)
  30. +++ 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::PointOnSurfaceAdapter _terrain_visibility_check_pnt_;
  47. +#endif
  48.     public:
  49.         avTVSensor();
  50.        ~avTVSensor();
  51. Index: Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h
  52. ===================================================================
  53. --- Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h  (revision 91428)
  54. +++ 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::PointOnSurfaceAdapter surfInfo;
  71. +#endif
  72.     };
  73.  }
  74. Index: SConscript
  75. ===================================================================
  76. --- SConscript  (revision 91428)
  77. +++ 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,11 @@
  87.     'renderer',
  88.  ]
  89.  
  90. +if not env.has_key('TERRAIN4'):
  91. +   libs += [
  92. +       'edTerrain',
  93. +   ]
  94. +
  95.  if not env.getUserVariable('FINAL_VERSION'):
  96.     libs.append('JConfigurator')
  97.  
  98. Index: Source/Avionics/Sensors/avSimpleRadar.cpp
  99. ===================================================================
  100. --- Source/Avionics/Sensors/avSimpleRadar.cpp   (revision 91428)
  101. +++ Source/Avionics/Sensors/avSimpleRadar.cpp   (working copy)
  102. @@ -7,7 +7,6 @@
  103.  #include "viObjectManager.h"
  104.  #include "wsType_Level4.h"
  105.  #include "wConst.h"
  106. -#include "wTerrain.h"
  107.  #include "wsInitData.h"
  108.  #include "IwInfo.h"
  109.  #include "Math\_math.h"
  110. @@ -20,6 +19,7 @@
  111.  #include "Utilities/ccTriggerSystem.h"
  112.  #include "woSpot.h"
  113.  #include "wDetectable.h"
  114. +#include "wTerrain.h"
  115.  
  116.  using namespace cockpit;
  117.  
  118. @@ -643,6 +643,7 @@
  119.         dVector end_   = antenna_pos.p + antenna_pos.x * d
  120.                                        + antenna_pos.y * 0.5 * h * d *rnd_y
  121.                                        + antenna_pos.z * 0.5 * w * d *rnd_z;
  122. +
  123.         if (surf_info.intersectSurface(start_,end_,&res_))
  124.             make_ground_spot(res_);
  125.     }
  126. Index: Source/Avionics/Sensors/avTVSensor.cpp
  127. ===================================================================
  128. --- Source/Avionics/Sensors/avTVSensor.cpp  (revision 91428)
  129. +++ Source/Avionics/Sensors/avTVSensor.cpp  (working copy)
  130. @@ -14,6 +14,7 @@
  131.  #include "Modeler/Utility.h"
  132.  #include "Registry/RegisterManager.h"
  133.  #include "Avionics/Sensors/avSensorRoutines.h"
  134. +#include "wTerrain.h"
  135.  
  136.  using namespace cockpit;
  137.  
  138. @@ -408,7 +409,7 @@
  139.          cVector start_ = getPlatformPosition().p;
  140.          cVector dir_   = getPlatformPosition().x;
  141.          cVector end_   = start_ + dir_ * max_dist;
  142. -        // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе      
  143. +        // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе
  144.          if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res))
  145.          {
  146.              gyro_stabilize_point = res;
  147. @@ -494,11 +495,10 @@
  148.  
  149.      dVector p = pos.p;
  150.      // РёР· Рђ РІ Р‘, PointOnSurface перемещается РІ Рђ, тогда правильней проверять РѕС‚ цели РІ себе
  151. -   if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0))
  152. +   if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,(cPoint*)NULL))
  153.     {
  154.         return false;
  155.     }
  156. -  
  157.         if (!checkTargetTVvisibility(p,maxdistance))
  158.     {
  159.         return false;
  160. Index: Source/Avionics/Weapon/avWeaponsBombSight.cpp
  161. ===================================================================
  162. --- Source/Avionics/Weapon/avWeaponsBombSight.cpp   (revision 91428)
  163. +++ Source/Avionics/Weapon/avWeaponsBombSight.cpp   (working copy)
  164. @@ -15,6 +15,7 @@
  165.  #include "Utilities/ccTriggerSystem.h"
  166.  #include "mathDebug.h"
  167.  #include "unit_converter.h"
  168. +#include "wTerrain.h"
  169.  
  170.  using namespace cockpit;
  171.  
  172. @@ -403,9 +404,13 @@
  173.      {
  174.          if (!ElevationIsFixed)
  175.          {
  176. +#ifndef USE_TERRAIN4
  177.              static landscape::lPointOnSurface surfInfo;
  178.              surfInfo.set(out.p.x, out.p.z);
  179.              lead_target_level = surfInfo.getHeight();
  180. +#else
  181. +           lead_target_level = globalLand->heightSurface(out.p.x, out.p.z);
  182. +#endif
  183.          }
  184.          else
  185.              lead_target_level = target_level;
  186. @@ -456,9 +461,13 @@
  187.      {
  188.          if (!ElevationIsFixed)
  189.          {
  190. +#ifndef USE_TERRAIN4
  191.              static landscape::lPointOnSurface surfInfo;
  192.              surfInfo.set(lead_human_position.p.x, lead_human_position.p.z);
  193.              lead_target_level = surfInfo.getHeight();
  194. +#else
  195. +           lead_target_level = globalLand->heightSurface(lead_human_position.p.x, lead_human_position.p.z);
  196. +#endif
  197.          }
  198.          else
  199.              lead_target_level = target_level;
  200. Index: Source/Utilities/ccLuaLoader.cpp
  201. ===================================================================
  202. --- Source/Utilities/ccLuaLoader.cpp    (revision 91428)
  203. +++ Source/Utilities/ccLuaLoader.cpp    (working copy)
  204. @@ -37,6 +37,7 @@
  205.  #include "smSceneManager.h"
  206.  #include "Oculus.h"
  207.  #include "IwWorld.h"
  208. +#include "wTerrain.h"
  209.  
  210.  using namespace cockpit;
  211.  using namespace Common;
  212. @@ -307,7 +308,12 @@
  213.     }
  214.     const char * data_name     = lua_tostring(L,1);
  215.  
  216. +#ifndef USE_TERRAIN4
  217.     lua_State  * terrain_state =  GetTerraDispatch()->getTerrainCfg();
  218. +#else
  219. +   lua_State  * terrain_state =  globalLand->getTerrainCfg();
  220. +#endif
  221. +
  222.     lua_getglobal(terrain_state,data_name);
  223.     {
  224.         ED_lua_copyindex (L,terrain_state,-1);
Advertisement
Add Comment
Please, Sign In to add comment