Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Base/Header/Avionics/Sensors/avSimpleRadar.h
- ===================================================================
- --- Base/Header/Avionics/Sensors/avSimpleRadar.h (revision 91428)
- +++ Base/Header/Avionics/Sensors/avSimpleRadar.h (working copy)
- @@ -9,6 +9,7 @@
- #include "Utilities/ccTriggerSystem.h"
- #include "Utilities/ccUtilities.h"
- #include "Avionics/avSimpleElectricSystem.h"
- +#include "edTerrain/ITerrain.h"
- class woSpot;
- @@ -137,8 +138,13 @@
- protected:
- radar_capabilities basic_capabilities;
- +#ifndef USE_TERRAIN4
- landscape::lPointOnSurface surf_info;
- landscape::lPointOnSurface surf_info_2;
- +#else
- + edterrain::PointOnSurfaceAdapter surf_info;
- + edterrain::PointOnSurfaceAdapter surf_info_2;
- +#endif
- woSpot *spot;
- Index: Base/Header/Avionics/Sensors/avTVSensor.h
- ===================================================================
- --- Base/Header/Avionics/Sensors/avTVSensor.h (revision 91428)
- +++ Base/Header/Avionics/Sensors/avTVSensor.h (working copy)
- @@ -3,6 +3,7 @@
- #include "ICommandsCockpitDevice.h"
- #include "viLight.h"
- #include "Avionics/Sensors/avBasicSensor.h"
- +#include "edTerrain/ITerrain.h"
- #ifdef _DEBUG
- #include "Renderer/DbgGraph.h"
- @@ -125,7 +126,11 @@
- class COCKPITBASE_API avTVSensor : public avBasicSensor
- {
- +#ifndef USE_TERRAIN4
- mutable landscape::lPointOnSurface _terrain_visibility_check_pnt_;
- +#else
- + mutable edterrain::PointOnSurface _terrain_visibility_check_pnt_;
- +#endif
- public:
- avTVSensor();
- ~avTVSensor();
- Index: Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h
- ===================================================================
- --- Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h (revision 91428)
- +++ Base/Header/LoadableEquipment/Weapon/eqTVGuidedWeapon.h (working copy)
- @@ -1,6 +1,7 @@
- #pragma once
- #include "Avionics/Sensors/avTVSensor.h"
- +#include "edTerrain/ITerrain.h"
- namespace cockpit {
- @@ -120,6 +121,10 @@
- bool forceCorrelateEnabled;
- wModelTime forceCorrelateEnableTime;
- +#ifndef USE_TERRAIN4
- mutable landscape::lPointOnSurface surfInfo;
- +#else
- + mutable edterrain::PointOnSurface surfInfo;
- +#endif
- };
- }
- Index: Base/SConscript
- ===================================================================
- --- Base/SConscript (revision 91428)
- +++ Base/SConscript (working copy)
- @@ -7,7 +7,6 @@
- 'edCore',
- 'edMath',
- 'edObjects',
- - 'edTerrain',
- 'World',
- 'WorldGeneral',
- 'Inter',
- @@ -30,6 +29,11 @@
- 'renderer',
- ]
- +if not env.has_key('TERRAIN4'):
- + libs += [
- + 'edTerrain',
- + ]
- +
- if not env.getUserVariable('FINAL_VERSION'):
- libs.append('JConfigurator')
- Index: Base/Source/Avionics/Sensors/avSimpleRadar.cpp
- ===================================================================
- --- Base/Source/Avionics/Sensors/avSimpleRadar.cpp (revision 91428)
- +++ Base/Source/Avionics/Sensors/avSimpleRadar.cpp (working copy)
- @@ -7,7 +7,6 @@
- #include "viObjectManager.h"
- #include "wsType_Level4.h"
- #include "wConst.h"
- -#include "wTerrain.h"
- #include "wsInitData.h"
- #include "IwInfo.h"
- #include "Math\_math.h"
- @@ -20,6 +19,7 @@
- #include "Utilities/ccTriggerSystem.h"
- #include "woSpot.h"
- #include "wDetectable.h"
- +#include "wTerrain.h"
- using namespace cockpit;
- @@ -627,7 +627,11 @@
- unsigned offset_z = antenna_pos.p.z * 10;
- dVector start_ = antenna_pos.p;
- +#ifndef USE_TERRAIN4
- dVector res_;
- +#else
- + cPoint res_;
- +#endif
- static float rays_density = 0.5f; // ray per square degree
- float w = get_width_of_scan_beam();
- @@ -643,7 +647,8 @@
- dVector end_ = antenna_pos.p + antenna_pos.x * d
- + antenna_pos.y * 0.5 * h * d *rnd_y
- + antenna_pos.z * 0.5 * w * d *rnd_z;
- - if (surf_info.intersectSurface(start_,end_,&res_))
- +
- + if (surf_info.intersectSurface(start_,end_,(cPoint*)&res_)))
- make_ground_spot(res_);
- }
- }
- Index: Base/Source/Avionics/Sensors/avTVSensor.cpp
- ===================================================================
- --- Base/Source/Avionics/Sensors/avTVSensor.cpp (revision 91428)
- +++ Base/Source/Avionics/Sensors/avTVSensor.cpp (working copy)
- @@ -14,6 +14,7 @@
- #include "Modeler/Utility.h"
- #include "Registry/RegisterManager.h"
- #include "Avionics/Sensors/avSensorRoutines.h"
- +#include "wTerrain.h"
- using namespace cockpit;
- @@ -404,12 +405,16 @@
- if (with_objects)
- {
- max_dist = 50000;
- +#ifndef USE_TERRAIN4
- dVector res;
- +#else
- + cPoint res;
- +#endif
- cVector start_ = getPlatformPosition().p;
- cVector dir_ = getPlatformPosition().x;
- cVector end_ = start_ + dir_ * max_dist;
- - // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе
- - if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,&res))
- + // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе
- + if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,(cPoint*)&res))
- {
- gyro_stabilize_point = res;
- end_ = res;
- @@ -494,11 +499,10 @@
- dVector p = pos.p;
- // из А в Б, PointOnSurface перемещается в А, тогда правильней проверять от цели в себе
- - if (_terrain_visibility_check_pnt_.intersectSurface(p,self_p,0))
- + if (_terrain_visibility_check_pnt_.intersectSurface(end_,start_,(cPoint*)&NULL))
- {
- return false;
- }
- -
- if (!checkTargetTVvisibility(p,maxdistance))
- {
- return false;
- Index: Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp
- ===================================================================
- --- Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp (revision 91428)
- +++ Base/Source/Avionics/Weapon/avWeaponsBombSight.cpp (working copy)
- @@ -15,6 +15,7 @@
- #include "Utilities/ccTriggerSystem.h"
- #include "mathDebug.h"
- #include "unit_converter.h"
- +#include "wTerrain.h"
- using namespace cockpit;
- @@ -403,9 +404,13 @@
- {
- if (!ElevationIsFixed)
- {
- +#ifndef USE_TERRAIN4
- static landscape::lPointOnSurface surfInfo;
- surfInfo.set(out.p.x, out.p.z);
- lead_target_level = surfInfo.getHeight();
- +#else
- + lead_target_level = surfInfo->height();
- +#endif
- }
- else
- lead_target_level = target_level;
- @@ -456,9 +461,13 @@
- {
- if (!ElevationIsFixed)
- {
- +#ifndef USE_TERRAIN4
- static landscape::lPointOnSurface surfInfo;
- surfInfo.set(lead_human_position.p.x, lead_human_position.p.z);
- lead_target_level = surfInfo.getHeight();
- +#else
- + lead_target_level = surfInfo.height();
- +#endif
- }
- else
- lead_target_level = target_level;
- Index: Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp
- ===================================================================
- --- Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp (revision 91428)
- +++ Base/Source/LoadableEquipment/Weapon/eqTVGuidedWeapon.cpp (working copy)
- @@ -714,10 +714,14 @@
- double eqTVGuidedWeapon::get_real_distance_to_terrain() const
- {
- const float max_distance = 120000.0f;
- +#ifndef USE_TERRAIN4
- dVector res;
- +#else
- + cPoint res;
- +#endif
- const dPosition& platform_position = getPlatformPosition();
- - if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, &res))
- + if (surfInfo.intersectSurface(platform_position.p, platform_position.p + platform_position.x * max_distance, (cPoint*)&res))
- {
- return (res - platform_position.p).length();
- }
- Index: Base/Source/Utilities/ccLuaLoader.cpp
- ===================================================================
- --- Base/Source/Utilities/ccLuaLoader.cpp (revision 91428)
- +++ Base/Source/Utilities/ccLuaLoader.cpp (working copy)
- @@ -37,6 +37,7 @@
- #include "smSceneManager.h"
- #include "Oculus.h"
- #include "IwWorld.h"
- +#include "wTerrain.h"
- using namespace cockpit;
- using namespace Common;
- @@ -307,7 +308,12 @@
- }
- const char * data_name = lua_tostring(L,1);
- +#ifndef USE_TERRAIN4
- lua_State * terrain_state = GetTerraDispatch()->getTerrainCfg();
- +#else
- + lua_State * terrain_state = globalLand->getTerrainCfg();
- +#endif
- +
- lua_getglobal(terrain_state,data_name);
- {
- ED_lua_copyindex (L,terrain_state,-1);
Advertisement
Add Comment
Please, Sign In to add comment