SHOW:
|
|
- or go back to the newest paste.
| 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 @@ |
| 86 | + | @@ -30,6 +29,11 @@ |
| 87 | 'renderer', | |
| 88 | ] | |
| 89 | ||
| 90 | - | +if env.has_key('TERRAIN4'):
|
| 90 | + | +if not env.has_key('TERRAIN4'):
|
| 91 | - | + CPPDEFINES += ['USE_TERRAIN4',] |
| 91 | + | |
| 92 | - | +else: |
| 92 | + | |
| 93 | + ] | |
| 94 | + | |
| 95 | if not env.getUserVariable('FINAL_VERSION'):
| |
| 96 | libs.append('JConfigurator')
| |
| 97 | ||
| 98 | Index: Base/Source/Avionics/Sensors/avSimpleRadar.cpp | |
| 99 | =================================================================== | |
| 100 | --- Base/Source/Avionics/Sensors/avSimpleRadar.cpp (revision 91428) | |
| 101 | +++ Base/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 | @@ -627,7 +627,11 @@ | |
| 119 | unsigned offset_z = antenna_pos.p.z * 10; | |
| 120 | - | @@ -643,8 +643,14 @@ |
| 120 | + | |
| 121 | dVector start_ = antenna_pos.p; | |
| 122 | +#ifndef USE_TERRAIN4 | |
| 123 | dVector res_; | |
| 124 | +#else | |
| 125 | - | if (surf_info.intersectSurface(start_,end_,&res_)) |
| 125 | + | + cPoint res_; |
| 126 | +#endif | |
| 127 | ||
| 128 | static float rays_density = 0.5f; // ray per square degree | |
| 129 | - | + if (globalLand->groundIntersection(start_,end_,res)) |
| 129 | + | float w = get_width_of_scan_beam(); |
| 130 | - | + make_ground_spot(res_); |
| 130 | + | @@ -643,7 +647,12 @@ |
| 131 | dVector end_ = antenna_pos.p + antenna_pos.x * d | |
| 132 | + antenna_pos.y * 0.5 * h * d *rnd_y | |
| 133 | + antenna_pos.z * 0.5 * w * d *rnd_z; | |
| 134 | - if (surf_info.intersectSurface(start_,end_,&res_)) | |
| 135 | +#ifndef USE_TERRAIN4 | |
| 136 | + bool intersectSurface = surf_info.intersectSurface(start_,end_,&res_); | |
| 137 | +#else | |
| 138 | + bool intersectSurface = globalLand->groundIntersection(start_,end_,res_); | |
| 139 | +#endif | |
| 140 | + if (intersectSurface) | |
| 141 | make_ground_spot(res_); | |
| 142 | } | |
| 143 | } | |
| 144 | Index: Base/Source/Avionics/Sensors/avTVSensor.cpp | |
| 145 | =================================================================== | |
| 146 | --- Base/Source/Avionics/Sensors/avTVSensor.cpp (revision 91428) | |
| 147 | - | @@ -404,11 +405,16 @@ |
| 147 | + | |
| 148 | @@ -14,6 +14,7 @@ | |
| 149 | #include "Modeler/Utility.h" | |
| 150 | #include "Registry/RegisterManager.h" | |
| 151 | #include "Avionics/Sensors/avSensorRoutines.h" | |
| 152 | +#include "wTerrain.h" | |
| 153 | ||
| 154 | using namespace cockpit; | |
| 155 | ||
| 156 | @@ -404,12 +405,21 @@ | |
| 157 | if (with_objects) | |
| 158 | {
| |
| 159 | max_dist = 50000; | |
| 160 | +#ifndef USE_TERRAIN4 | |
| 161 | dVector res; | |
| 162 | - | if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res)) |
| 162 | + | |
| 163 | + cPoint res; | |
| 164 | +#endif | |
| 165 | - | @@ -415,6 +421,14 @@ |
| 165 | + | |
| 166 | cVector dir_ = getPlatformPosition().x; | |
| 167 | - | max_dist =(res - start_).length(); |
| 167 | + | |
| 168 | - // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе | |
| 169 | - if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res)) | |
| 170 | - | + if (globalLand->groundIntersection(end_,start_,res)) |
| 170 | + | |
| 171 | - | + {
|
| 171 | + | |
| 172 | - | + gyro_stabilize_point = res; |
| 172 | + | + bool intersectSurface = _terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res); |
| 173 | - | + end_ = res; |
| 173 | + | |
| 174 | - | + max_dist =(res - start_).length(); |
| 174 | + | + bool intersectSurface = globalLand->groundIntersection(end_,start_,res); |
| 175 | - | + } |
| 175 | + | |
| 176 | + if (intersectSurface) | |
| 177 | - | unsigned stationary_object = viMapObject | |
| 177 | + | |
| 178 | - | viMissionObject | |
| 178 | + | |
| 179 | - | viMapMissionObject | |
| 179 | + | |
| 180 | - | @@ -494,11 +508,18 @@ |
| 180 | + | @@ -494,11 +504,16 @@ |
| 181 | ||
| 182 | dVector p = pos.p; | |
| 183 | // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе | |
| 184 | - if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0)) | |
| 185 | - | if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0)) |
| 185 | + | |
| 186 | + bool intersectSurface = _terrain_visibility_check_pnt_.intersectSurface(p,self_p,0); | |
| 187 | +#else | |
| 188 | + cPoint ncPoint; | |
| 189 | + bool intersectSurface = globalLand->groundIntersection(p,self_p,ncPoint); | |
| 190 | +#endif | |
| 191 | + if (intersectSurface) | |
| 192 | - | + if (globalLand->groundIntersection(p,self_p,ncPoint)) |
| 192 | + | |
| 193 | return false; | |
| 194 | - | + return false; |
| 194 | + | |
| 195 | - | |
| 196 | if (!checkTargetTVvisibility(p,maxdistance)) | |
| 197 | {
| |
| 198 | return false; | |
| 199 | Index: Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp | |
| 200 | =================================================================== | |
| 201 | --- Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp (revision 91428) | |
| 202 | +++ Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp (working copy) | |
| 203 | @@ -15,6 +15,7 @@ | |
| 204 | #include "Utilities/ccTriggerSystem.h" | |
| 205 | #include "mathDebug.h" | |
| 206 | #include "unit_converter.h" | |
| 207 | +#include "wTerrain.h" | |
| 208 | ||
| 209 | using namespace cockpit; | |
| 210 | ||
| 211 | @@ -403,9 +404,13 @@ | |
| 212 | {
| |
| 213 | if (!ElevationIsFixed) | |
| 214 | {
| |
| 215 | +#ifndef USE_TERRAIN4 | |
| 216 | static landscape::lPointOnSurface surfInfo; | |
| 217 | surfInfo.set(out.p.x, out.p.z); | |
| 218 | lead_target_level = surfInfo.getHeight(); | |
| 219 | +#else | |
| 220 | + lead_target_level = globalLand->heightSurface(out.p.x, out.p.z); | |
| 221 | +#endif | |
| 222 | } | |
| 223 | else | |
| 224 | lead_target_level = target_level; | |
| 225 | @@ -456,9 +461,13 @@ | |
| 226 | {
| |
| 227 | if (!ElevationIsFixed) | |
| 228 | {
| |
| 229 | +#ifndef USE_TERRAIN4 | |
| 230 | static landscape::lPointOnSurface surfInfo; | |
| 231 | surfInfo.set(lead_human_position.p.x, lead_human_position.p.z); | |
| 232 | lead_target_level = surfInfo.getHeight(); | |
| 233 | +#else | |
| 234 | + lead_target_level = globalLand->heightSurface(lead_human_position.p.x, lead_human_position.p.z); | |
| 235 | +#endif | |
| 236 | } | |
| 237 | else | |
| 238 | lead_target_level = target_level; | |
| 239 | Index: Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp | |
| 240 | =================================================================== | |
| 241 | --- Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp (revision 91428) | |
| 242 | +++ Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp (working copy) | |
| 243 | @@ -714,13 +714,24 @@ | |
| 244 | double eqTVGuidedWeapon::get_real_distance_to_terrain() const | |
| 245 | {
| |
| 246 | const float max_distance = 120000.0f; | |
| 247 | +#ifndef USE_TERRAIN4 | |
| 248 | dVector res; | |
| 249 | +#else | |
| 250 | + cPoint res; | |
| 251 | +#endif | |
| 252 | const dPosition& platform_position = getPlatformPosition(); | |
| 253 | ||
| 254 | +#ifndef USE_TERRAIN4 | |
| 255 | if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, &res)) | |
| 256 | {
| |
| 257 | return (res - platform_position.p).length(); | |
| 258 | } | |
| 259 | +#else | |
| 260 | + if (globalLand->groundIntersection(platform_position.p, platform_position.p + platform_position.x * max_distance, res)) | |
| 261 | + {
| |
| 262 | + return (res - platform_position.p).length(); | |
| 263 | + } | |
| 264 | +#endif | |
| 265 | ||
| 266 | return 0.0; | |
| 267 | } | |
| 268 | Index: Base/Source/Utilities/ccLuaLoader.cpp | |
| 269 | =================================================================== | |
| 270 | --- Base/Source/Utilities/ccLuaLoader.cpp (revision 91428) | |
| 271 | +++ Base/Source/Utilities/ccLuaLoader.cpp (working copy) | |
| 272 | @@ -37,6 +37,7 @@ | |
| 273 | #include "smSceneManager.h" | |
| 274 | #include "Oculus.h" | |
| 275 | #include "IwWorld.h" | |
| 276 | +#include "wTerrain.h" | |
| 277 | ||
| 278 | using namespace cockpit; | |
| 279 | using namespace Common; | |
| 280 | @@ -307,7 +308,12 @@ | |
| 281 | } | |
| 282 | const char * data_name = lua_tostring(L,1); | |
| 283 | ||
| 284 | +#ifndef USE_TERRAIN4 | |
| 285 | lua_State * terrain_state = GetTerraDispatch()->getTerrainCfg(); | |
| 286 | +#else | |
| 287 | + lua_State * terrain_state = globalLand->getTerrainCfg(); | |
| 288 | +#endif | |
| 289 | + | |
| 290 | lua_getglobal(terrain_state,data_name); | |
| 291 | {
| |
| 292 | ED_lua_copyindex (L,terrain_state,-1); |