View difference between Paste ID: Y3itkahN and FxA4qrP4
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,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: 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
 
121
 	dVector start_ = antenna_pos.p;
122
+#ifndef USE_TERRAIN4
123
 	dVector res_;
124
+#else
125
+	cPoint res_;
126
+#endif
127
 
128
 	static float rays_density = 0.5f; // ray per square degree
129
 	float w = get_width_of_scan_beam();
130-
@@ -643,7 +647,12 @@
130+
@@ -643,7 +647,8 @@
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
+
136-
+		bool intersectSurface = surf_info.intersectSurface(start_,end_,&res_);
136+
+		if (surf_info.intersectSurface(start_,end_,(cPoint*)&res_)))
137
 			make_ground_spot(res_);
138-
+		bool intersectSurface = globalLand->groundIntersection(start_,end_,res_);
138+
139
 }
140-
+		if (intersectSurface)
140+
141
===================================================================
142
--- Base/Source/Avionics/Sensors/avTVSensor.cpp	(revision 91428)
143
+++ Base/Source/Avionics/Sensors/avTVSensor.cpp	(working copy)
144
@@ -14,6 +14,7 @@
145
 #include "Modeler/Utility.h"
146
 #include "Registry/RegisterManager.h"
147
 #include "Avionics/Sensors/avSensorRoutines.h"
148
+#include "wTerrain.h"
149
 
150
 using namespace cockpit;
151
 
152
@@ -404,12 +405,16 @@
153
     if (with_objects)
154
     {
155
         max_dist = 50000;
156-
@@ -404,12 +405,21 @@
156+
157
         dVector res;
158
+#else
159
+		cPoint res;
160
+#endif
161
         cVector start_ = getPlatformPosition().p;
162
         cVector dir_   = getPlatformPosition().x;
163
         cVector end_   = start_ + dir_ * max_dist;
164
-        // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе      
165
-        if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res))
166
+        // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе
167
+        if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,(cPoint*)&res))
168
         {
169
             gyro_stabilize_point = res;
170
             end_                 = res;
171
@@ -494,11 +499,10 @@
172-
+		bool intersectSurface = _terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res);
172+
173
     dVector p = pos.p;
174-
+		bool intersectSurface = globalLand->groundIntersection(end_,start_,res);
174+
175
-	if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0))
176-
+        if (intersectSurface)
176+
+	if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,(cPoint*)&NULL))
177
 	{
178
 		return false;
179
 	}
180-
@@ -494,11 +504,16 @@
180+
181
    	if (!checkTargetTVvisibility(p,maxdistance))
182
 	{
183
 		return false;
184
Index: Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp
185
===================================================================
186-
+	bool intersectSurface = _terrain_visibility_check_pnt_.intersectSurface(p,self_p,0);
186+
187
+++ Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp	(working copy)
188-
+	cPoint ncPoint;
188+
189-
+	bool intersectSurface = globalLand->groundIntersection(p,self_p,ncPoint);
189+
190
 #include "mathDebug.h"
191-
+	if (intersectSurface)
191+
192
+#include "wTerrain.h"
193
 
194
 using namespace cockpit;
195
 
196
@@ -403,9 +404,13 @@
197
     {
198
         if (!ElevationIsFixed)
199
         {
200
+#ifndef USE_TERRAIN4
201
             static landscape::lPointOnSurface surfInfo;
202
             surfInfo.set(out.p.x, out.p.z);
203
             lead_target_level = surfInfo.getHeight();
204
+#else
205
+			lead_target_level = surfInfo->height();
206
+#endif
207
         }
208
         else
209
             lead_target_level = target_level;
210
@@ -456,9 +461,13 @@
211
     {
212
         if (!ElevationIsFixed)
213
         {
214
+#ifndef USE_TERRAIN4
215
             static landscape::lPointOnSurface surfInfo;
216
             surfInfo.set(lead_human_position.p.x, lead_human_position.p.z);
217
             lead_target_level = surfInfo.getHeight();
218
+#else
219
+			lead_target_level = surfInfo.height();
220-
+			lead_target_level = globalLand->heightSurface(out.p.x, out.p.z);
220+
221
         }
222
         else
223
             lead_target_level = target_level;
224
Index: Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp
225
===================================================================
226
--- Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp	(revision 91428)
227
+++ Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp	(working copy)
228
@@ -714,10 +714,14 @@
229
 double eqTVGuidedWeapon::get_real_distance_to_terrain() const
230
 {
231
 	const float max_distance = 120000.0f;
232
+#ifndef USE_TERRAIN4
233
 	dVector res;
234-
+			lead_target_level = globalLand->heightSurface(lead_human_position.p.x, lead_human_position.p.z);
234+
235
+	cPoint res;
236
+#endif
237
 	const dPosition& platform_position = getPlatformPosition();
238
 
239
-	if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, &res))
240
+	if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, (cPoint*)&res))
241
 	{
242
 		return (res - platform_position.p).length();
243-
@@ -714,13 +714,24 @@
243+
244
Index: Base/Source/Utilities/ccLuaLoader.cpp
245
===================================================================
246
--- Base/Source/Utilities/ccLuaLoader.cpp	(revision 91428)
247
+++ Base/Source/Utilities/ccLuaLoader.cpp	(working copy)
248
@@ -37,6 +37,7 @@
249
 #include "smSceneManager.h"
250
 #include "Oculus.h"
251
 #include "IwWorld.h"
252
+#include "wTerrain.h"
253
 
254
 using namespace cockpit;
255-
 	if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, &res))
255+
256
@@ -307,7 +308,12 @@
257
 	}
258
 	const char * data_name     = lua_tostring(L,1);
259
 
260-
+	if (globalLand->groundIntersection(platform_position.p, platform_position.p + platform_position.x * max_distance, res))
260+
261-
+	{
261+
262-
+		return (res - platform_position.p).length();
262+
263-
+	}
263+
264
+#endif
265
+
266-
 	return 0.0;
266+
267
 	{
268
 		ED_lua_copyindex (L,terrain_state,-1);