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