diff --git a/Assets/Editor/Presets/GeomCache/game.cbc b/Assets/Editor/Presets/GeomCache/game.cbc
deleted file mode 100644
index 9b98f3460f..0000000000
--- a/Assets/Editor/Presets/GeomCache/game.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/game_lz4hc.cbc b/Assets/Editor/Presets/GeomCache/game_lz4hc.cbc
deleted file mode 100644
index dbd0499175..0000000000
--- a/Assets/Editor/Presets/GeomCache/game_lz4hc.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/game_z_up.cbc b/Assets/Editor/Presets/GeomCache/game_z_up.cbc
deleted file mode 100644
index ec2555a3e3..0000000000
--- a/Assets/Editor/Presets/GeomCache/game_z_up.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/game_z_up_lz4hc.cbc b/Assets/Editor/Presets/GeomCache/game_z_up_lz4hc.cbc
deleted file mode 100644
index c2e30a6386..0000000000
--- a/Assets/Editor/Presets/GeomCache/game_z_up_lz4hc.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/prerendered.cbc b/Assets/Editor/Presets/GeomCache/prerendered.cbc
deleted file mode 100644
index c09785111d..0000000000
--- a/Assets/Editor/Presets/GeomCache/prerendered.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/prerendered_z_up.cbc b/Assets/Editor/Presets/GeomCache/prerendered_z_up.cbc
deleted file mode 100644
index e42a915e58..0000000000
--- a/Assets/Editor/Presets/GeomCache/prerendered_z_up.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/rigids_only.cbc b/Assets/Editor/Presets/GeomCache/rigids_only.cbc
deleted file mode 100644
index e8620bc11e..0000000000
--- a/Assets/Editor/Presets/GeomCache/rigids_only.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/rigids_only_z_up.cbc b/Assets/Editor/Presets/GeomCache/rigids_only_z_up.cbc
deleted file mode 100644
index d1f8bc2db3..0000000000
--- a/Assets/Editor/Presets/GeomCache/rigids_only_z_up.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/uncompressed.cbc b/Assets/Editor/Presets/GeomCache/uncompressed.cbc
deleted file mode 100644
index e21d52d9d1..0000000000
--- a/Assets/Editor/Presets/GeomCache/uncompressed.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Editor/Presets/GeomCache/uncompressed_z_up.cbc b/Assets/Editor/Presets/GeomCache/uncompressed_z_up.cbc
deleted file mode 100644
index 273ce1fbb1..0000000000
--- a/Assets/Editor/Presets/GeomCache/uncompressed_z_up.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.abc b/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.abc
deleted file mode 100644
index 8ca759d342..0000000000
--- a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.abc
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9c36d7bc993ddf616f478115a123efabda5b4b833a4e6524312f43c228ae0902
-size 487003
diff --git a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.cbc b/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.cbc
deleted file mode 100644
index 3c99ab1627..0000000000
--- a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.cbc
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.ma b/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.ma
deleted file mode 100644
index 65aade11a0..0000000000
--- a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.ma
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:96a21446422b834ea90a5d38eaaca309fdee31dc3cc03c0e9c094b39ec3a459d
-size 4715164
diff --git a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.mtl b/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.mtl
deleted file mode 100644
index 05dfe70b09..0000000000
--- a/Assets/Engine/EngineAssets/GeomCaches/defaultGeomCache.mtl
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
index 6d3727195e..42fe9ac4a1 100644
--- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
+++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt
@@ -181,12 +181,30 @@ include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED)
## DynVeg ##
+ # Temporarily moving all tests to periodic suite - SPEC-6553
+ #ly_add_pytest(
+ # NAME AutomatedTesting::DynamicVegetationTests_Main
+ # TEST_SERIAL
+ # TEST_SUITE main
+ # PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
+ # PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
+ # TIMEOUT 1500
+ # RUNTIME_DEPENDENCIES
+ # AZ::AssetProcessor
+ # Legacy::Editor
+ # AutomatedTesting.GameLauncher
+ # AutomatedTesting.Assets
+ # COMPONENT
+ # LargeWorlds
+ #)
+
+
ly_add_pytest(
- NAME AutomatedTesting::DynamicVegetationTests_Main
+ NAME AutomatedTesting::DynamicVegetationTests_Sandbox
TEST_SERIAL
- TEST_SUITE main
+ TEST_SUITE sandbox
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
- PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
+ PYTEST_MARKS "SUITE_sandbox"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
@@ -198,27 +216,26 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
)
ly_add_pytest(
- NAME AutomatedTesting::DynamicVegetationTests_Sandbox
+ NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic
TEST_SERIAL
- TEST_SUITE sandbox
+ TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
- PYTEST_MARKS "SUITE_sandbox"
+ PYTEST_MARKS "SUITE_periodic and dynveg_filter"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
Legacy::Editor
- AutomatedTesting.GameLauncher
AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
ly_add_pytest(
- NAME AutomatedTesting::DynamicVegetationTests_Periodic
+ NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic
TEST_SERIAL
TEST_SUITE periodic
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
- PYTEST_MARKS "SUITE_periodic"
+ PYTEST_MARKS "SUITE_periodic and dynveg_modifier"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
AZ::AssetProcessor
@@ -228,22 +245,82 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
LargeWorlds
)
-## LandscapeCanvas ##
ly_add_pytest(
- NAME AutomatedTesting::LandscapeCanvasTests_Main
+ NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic
TEST_SERIAL
- TEST_SUITE main
- PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
- PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
+ TEST_SUITE periodic
+ PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
+ PYTEST_MARKS "SUITE_periodic and dynveg_regression"
TIMEOUT 1500
RUNTIME_DEPENDENCIES
- AZ::AssetProcessor
- Legacy::Editor
- AutomatedTesting.Assets
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
COMPONENT
LargeWorlds
)
+ ly_add_pytest(
+ NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic
+ TEST_SERIAL
+ TEST_SUITE periodic
+ PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
+ PYTEST_MARKS "SUITE_periodic and dynveg_area"
+ TIMEOUT 1500
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
+ COMPONENT
+ LargeWorlds
+ )
+
+ ly_add_pytest(
+ NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic
+ TEST_SERIAL
+ TEST_SUITE periodic
+ PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
+ PYTEST_MARKS "SUITE_periodic and dynveg_misc"
+ TIMEOUT 1500
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
+ COMPONENT
+ LargeWorlds
+ )
+
+ ly_add_pytest(
+ NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic
+ TEST_SERIAL
+ TEST_SUITE periodic
+ PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
+ PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter"
+ TIMEOUT 1500
+ RUNTIME_DEPENDENCIES
+ AZ::AssetProcessor
+ Legacy::Editor
+ AutomatedTesting.Assets
+ COMPONENT
+ LargeWorlds
+ )
+## LandscapeCanvas ##
+ # Temporarily moving all tests to periodic suite - SPEC-6553
+ #ly_add_pytest(
+ # NAME AutomatedTesting::LandscapeCanvasTests_Main
+ # TEST_SERIAL
+ # TEST_SUITE main
+ # PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
+ # PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
+ # TIMEOUT 1500
+ # RUNTIME_DEPENDENCIES
+ # AZ::AssetProcessor
+ # Legacy::Editor
+ # AutomatedTesting.Assets
+ # COMPONENT
+ # LargeWorlds
+ #)
+
ly_add_pytest(
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
TEST_SERIAL
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py
index 0be220cad0..466cd610e4 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks.py
@@ -114,11 +114,8 @@ class TestDynamicSliceInstanceSpawner(EditorTestHelper):
# This should result in 400 instances, since our box is 16 m x 16 m and by default the veg system plants
# 20 instances per 16 meters
spawner_entity.get_set_test(0, 'Configuration|Allow Empty Assets', True)
- general.idle_wait(1.0)
num_expected_instances = 20 * 20
- box = azlmbr.shape.ShapeComponentRequestsBus(bus.Event, 'GetEncompassingAabb', spawner_entity.id)
- num_found = azlmbr.areasystem.AreaSystemRequestBus(bus.Broadcast, 'GetInstanceCountInAabb', box)
- property_tree_success = property_tree_success and (num_found == num_expected_instances)
+ property_tree_success = property_tree_success and self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = self.test_success and property_tree_success
self.log(f'Property Tree spawner type test: {property_tree_success}')
@@ -127,10 +124,8 @@ class TestDynamicSliceInstanceSpawner(EditorTestHelper):
# Since we have an empty slice path, we should have 0 instances once we disable 'Allow Empty Assets'
num_expected_instances = 0
allow_empty_assets_success = allow_empty_assets_success and spawner_entity.get_set_test(0, 'Configuration|Allow Empty Assets', False)
- general.idle_wait(1.0)
- num_found = azlmbr.areasystem.AreaSystemRequestBus(bus.Broadcast, 'GetInstanceCountInAabb', box)
- self.log(f'Allow Empty Assets test: Found {num_found} instances -- Expected {num_expected_instances} instances')
- allow_empty_assets_success = allow_empty_assets_success and (num_found == num_expected_instances)
+ self.log('Allow Empty Assets test:')
+ allow_empty_assets_success = allow_empty_assets_success and self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = self.test_success and allow_empty_assets_success
self.log(f'Allow Empty Assets test: {allow_empty_assets_success}')
@@ -143,10 +138,8 @@ class TestDynamicSliceInstanceSpawner(EditorTestHelper):
descriptor = hydra.get_component_property_value(spawner_entity.components[2], 'Configuration|Embedded Assets|[0]')
descriptor.spawner = dynamic_slice_spawner
spawns_slices_success = spawns_slices_success and spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]", descriptor)
- general.idle_wait(1.0)
- num_found = azlmbr.areasystem.AreaSystemRequestBus(bus.Broadcast, 'GetInstanceCountInAabb', box)
- self.log(f'Spawn dynamic slices test: Found {num_found} instances -- Expected {num_expected_instances} instances')
- spawns_slices_success = spawns_slices_success and (num_found == num_expected_instances)
+ self.log('Spawn dynamic slices test:')
+ spawns_slices_success = spawns_slices_success and self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = self.test_success and spawns_slices_success
self.log(f'Spawn dynamic slices test: {spawns_slices_success}')
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py
index 161ad038a5..dc353aca1a 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/EmptyInstanceSpawner_EmptySpawnerWorks.py
@@ -100,21 +100,15 @@ class TestEmptyInstanceSpawner(EditorTestHelper):
# This should result in 400 instances, since our box is 16 m x 16 m and by default the veg system plants
# 20 instances per 16 meters
- general.idle_wait(2.0)
num_expected_instances = 20 * 20
- box = azlmbr.shape.ShapeComponentRequestsBus(bus.Event, 'GetEncompassingAabb', spawner_entity.id)
- num_found = azlmbr.areasystem.AreaSystemRequestBus(bus.Broadcast, 'GetInstanceCountInAabb', box)
- property_tree_success = property_tree_success and (num_found == num_expected_instances)
+ property_tree_success = property_tree_success and self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = self.test_success and property_tree_success
- self.log(f'Found {num_found} instances -- Expected {num_expected_instances} instances')
self.log(f'Property Tree spawner type test: {property_tree_success}')
# 6) Validate that the "Allow Empty Assets" setting doesn't affect the EmptyInstanceSpawner
allow_empty_assets_success = True
spawner_entity.get_set_test(0, 'Configuration|Allow Empty Assets', False)
- general.idle_wait(2.0)
- num_found = azlmbr.areasystem.AreaSystemRequestBus(bus.Broadcast, 'GetInstanceCountInAabb', box)
- allow_empty_assets_success = allow_empty_assets_success and (num_found == num_expected_instances)
+ allow_empty_assets_success = allow_empty_assets_success and self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(spawner_entity.id, num_expected_instances), 5.0)
self.test_success = self.test_success and allow_empty_assets_success
self.log(f'Allow Empty Assets test: {allow_empty_assets_success}')
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AltitudeFilter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AltitudeFilter.py
index 2db8534696..17a5f72863 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AltitudeFilter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AltitudeFilter.py
@@ -37,6 +37,7 @@ class TestAltitudeFilter(object):
@pytest.mark.test_case_id('C4814463', 'C4847477')
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude(self, request, editor, level,
launcher_platform):
@@ -61,6 +62,7 @@ class TestAltitudeFilter(object):
@pytest.mark.test_case_id("C4847476")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude(self, request, editor, level,
launcher_platform):
@@ -85,6 +87,7 @@ class TestAltitudeFilter(object):
@pytest.mark.test_case_id("C4847478")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
@pytest.mark.xfail # LYN-3275
def test_AltitudeFilter_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AreaComponentSlices.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AreaComponentSlices.py
index 1353efbf2e..5f42fc6de0 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AreaComponentSlices.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AreaComponentSlices.py
@@ -52,6 +52,7 @@ class TestAreaComponents(object):
@pytest.mark.test_case_id("C2627900", "C2627905", "C2627904")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_AreaComponents_SliceCreationVisibilityToggleWorks(self, request, editor, level, workspace,
launcher_platform):
cfg_args = [level]
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetListCombiner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetListCombiner.py
index ad0917ca22..b40d99b100 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetListCombiner.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetListCombiner.py
@@ -38,6 +38,7 @@ class TestAssetListCombiner(object):
@pytest.mark.test_case_id("C4762374", "C4762373")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea(self, request, editor, level,
launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetWeightSelector.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetWeightSelector.py
index 65472df3bc..7b34a10d66 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetWeightSelector.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_AssetWeightSelector.py
@@ -42,6 +42,7 @@ class TestAssetWeightSelector(object):
@pytest.mark.test_case_id("C6269654", "C4762368")
@pytest.mark.SUITE_sandbox
+ @pytest.mark.dynveg_filter
def test_AssetWeightSelector_InstancesExpressBasedOnWeight(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_Debugger.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_Debugger.py
index 45518b71fc..7466089173 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_Debugger.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_Debugger.py
@@ -40,6 +40,7 @@ class TestDebugger(object):
@pytest.mark.test_case_id("C2789148")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_Debugger_DebugCVarsWork(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DistanceBetweenFilter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DistanceBetweenFilter.py
index 3171cc032f..191f27fca0 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DistanceBetweenFilter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DistanceBetweenFilter.py
@@ -38,6 +38,7 @@ class TestDistanceBetweenFilter(object):
@pytest.mark.test_case_id("C4851066")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -58,6 +59,7 @@ class TestDistanceBetweenFilter(object):
@pytest.mark.test_case_id("C4814458")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius(self, request, editor, level,
launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynVeg_Regressions.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynVeg_Regressions.py
index b3cf344b2b..5c6e034a12 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynVeg_Regressions.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynVeg_Regressions.py
@@ -40,6 +40,7 @@ class Test_DynVeg_Regressions(object):
@pytest.mark.test_case_id("C29470845")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_regression
def test_SurfaceDataRefreshes_RemainsStable(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py
index f0673a9438..9898570692 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py
@@ -41,7 +41,8 @@ class TestDynamicSliceInstanceSpawner(object):
return console
@pytest.mark.test_case_id("C28851763")
- @pytest.mark.SUITE_sandbox
+ @pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, editor, level, workspace, project,
launcher_platform):
@@ -66,6 +67,7 @@ class TestDynamicSliceInstanceSpawner(object):
@pytest.mark.test_case_id('C2574330')
@pytest.mark.BAT
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_Embedded_E2E_Editor(self, workspace, request, editor, level, project,
launcher_platform):
@@ -85,6 +87,7 @@ class TestDynamicSliceInstanceSpawner(object):
@pytest.mark.test_case_id('C2574330')
@pytest.mark.BAT
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows'])
@pytest.mark.skip # ATOM-14703
def test_DynamicSliceInstanceSpawner_Embedded_E2E_Launcher(self, workspace, launcher, level,
@@ -101,6 +104,7 @@ class TestDynamicSliceInstanceSpawner(object):
@pytest.mark.test_case_id('C4762367')
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_DynamicSliceInstanceSpawner_External_E2E_Editor(self, workspace, request, editor, level, project,
launcher_platform):
@@ -119,6 +123,7 @@ class TestDynamicSliceInstanceSpawner(object):
@pytest.mark.test_case_id('C4762367')
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows'])
@pytest.mark.skip # ATOM-14703
def test_DynamicSliceInstanceSpawner_External_E2E_Launcher(self, workspace, launcher, level,
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py
index fc8c31fc7b..7bd8484cf4 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py
@@ -36,13 +36,9 @@ class TestEmptyInstanceSpawner(object):
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
- # Main suite needs at least one test
- @pytest.mark.SUITE_main
- def test_EmptyInstanceSpawner_Dummy(self, request, editor, level, workspace, project, launcher_platform):
- pass
-
@pytest.mark.test_case_id("C28851762")
- @pytest.mark.SUITE_sandbox
+ @pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, editor, level, launcher_platform):
cfg_args = [level]
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_InstanceSpawnerPriority.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_InstanceSpawnerPriority.py
index d04b827985..53b5c3b760 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_InstanceSpawnerPriority.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_InstanceSpawnerPriority.py
@@ -43,6 +43,7 @@ class TestInstanceSpawnerPriority(object):
@pytest.mark.test_case_id("C5747383", "C4762382")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_InstanceSpawnerPriority_LayerAndSubPriority_HigherValuesPlantOverLower(self, request, editor, level,
launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py
index 2286238364..76b8b3cd3a 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py
@@ -20,17 +20,10 @@ import pytest
pytest.importorskip("ly_test_tools")
-import time as time
-
-import editor_python_test_tools.hydra_test_utils as hydra
-import ly_test_tools.launchers.launcher_helper as launcher_helper
+import ly_remote_console.remote_console_commands as remote_console_commands
import ly_test_tools.environment.waiter as waiter
import ly_test_tools.environment.file_system as file_system
-import ly_remote_console.remote_console_commands as remote_console_commands
-from ly_remote_console.remote_console_commands import send_command_and_expect_response as send_command_and_expect_response
-
-import automatedtesting_shared.screenshot_utils as screenshot_utils
-from automatedtesting_shared.network_utils import check_for_listening_port
+import editor_python_test_tools.hydra_test_utils as hydra
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
@@ -58,6 +51,7 @@ class TestLayerBlender(object):
@pytest.mark.test_case_id("C2627906")
@pytest.mark.BAT
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
def test_LayerBlender_E2E_Editor(self, workspace, request, editor, project, level, launcher_platform):
# Make sure temp level doesn't already exist
@@ -95,6 +89,7 @@ class TestLayerBlender(object):
@pytest.mark.test_case_id("C2627906")
@pytest.mark.BAT
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.xfail
@pytest.mark.parametrize("launcher_platform", ['windows'])
def test_LayerBlender_E2E_Launcher(self, workspace, project, launcher, level, remote_console_instance,
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlocker.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlocker.py
index 6da0cdd6db..308f4480c5 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlocker.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlocker.py
@@ -38,6 +38,7 @@ class TestLayerBlocker(object):
@pytest.mark.test_case_id("C2793772")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
def test_LayerBlocker_InstancesBlockedInConfiguredArea(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py
index 93149c9490..d206a962da 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py
@@ -40,6 +40,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C4762381")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_LayerSpawner_InheritBehaviorFlag(self, request, editor, level, workspace, launcher_platform):
expected_lines = [
@@ -60,6 +61,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C2802020")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_LayerSpawner_InstancesPlantInAllSupportedShapes(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -101,6 +103,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C4765973")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
@pytest.mark.xfail # LYN-3275
def test_LayerSpawner_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
@@ -122,6 +125,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C30000751")
@pytest.mark.SUITE_sandbox
+ @pytest.mark.dynveg_misc
@pytest.mark.skip # ATOM-14828
def test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(self, request, editor, level, launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshBlocker.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshBlocker.py
index c04390e647..7e1b416556 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshBlocker.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshBlocker.py
@@ -46,6 +46,7 @@ class TestMeshBlocker(object):
"""
@pytest.mark.test_case_id("C3980834")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.xfail # LYN-3273
def test_MeshBlocker_InstancesBlockedByMesh(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -70,6 +71,7 @@ class TestMeshBlocker(object):
"""
@pytest.mark.test_case_id("C4766030")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_area
@pytest.mark.xfail # LYN-3273
def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshSurfaceTagEmitter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshSurfaceTagEmitter.py
index 77638cb576..dcbffdf3b7 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshSurfaceTagEmitter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_MeshSurfaceTagEmitter.py
@@ -38,6 +38,7 @@ class TestMeshSurfaceTagEmitter(object):
@pytest.mark.test_case_id("C2908172")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_surfacetagemitter
def test_MeshSurfaceTagEmitter_DependentOnMeshComponent(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -66,6 +67,7 @@ class TestMeshSurfaceTagEmitter(object):
@pytest.mark.test_case_id("C2908174")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_surfacetagemitter
def test_MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PhysXColliderSurfaceTagEmitter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PhysXColliderSurfaceTagEmitter.py
index ca4e30a719..0f84e2caa2 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PhysXColliderSurfaceTagEmitter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PhysXColliderSurfaceTagEmitter.py
@@ -38,6 +38,7 @@ class TestPhysXColliderSurfaceTagEmitter(object):
@pytest.mark.test_case_id("C29053640")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_surfacetagemitter
def test_PhysXColliderSurfaceTagEmitter_E2E_Editor(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py
index ac3e0abb4f..2cf8db3b96 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_PositionModifier.py
@@ -38,6 +38,7 @@ class TestPositionModifier(object):
@pytest.mark.test_case_id("C4874099", "C4814461")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
def test_PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets(self, request, editor, level,
launcher_platform):
@@ -60,6 +61,7 @@ class TestPositionModifier(object):
@pytest.mark.test_case_id("C4874100")
@pytest.mark.SUITE_sandbox
+ @pytest.mark.dynveg_modifier
@pytest.mark.xfail # LYN-3275
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_RotationModifier.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_RotationModifier.py
index 518949c0c0..3b0c9b3947 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_RotationModifier.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_RotationModifier.py
@@ -42,6 +42,7 @@ class TestRotationModifier(object):
@pytest.mark.test_case_id("C4896922")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
def test_RotationModifier_InstancesRotateWithinRange(self, request, editor, level, launcher_platform) -> None:
"""
Launches editor and run test script to test that rotation modifier works for all axis.
@@ -71,6 +72,7 @@ class TestRotationModifier(object):
@pytest.mark.test_case_id("C4814460")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
def test_RotationModifierOverrides_InstancesRotateWithinRange(self, request, editor, level, launcher_platform) -> None:
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ScaleModifier.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ScaleModifier.py
index 6acd95e4f6..7fe7a4ece2 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ScaleModifier.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ScaleModifier.py
@@ -41,6 +41,7 @@ class TestScaleOverrideWorksSuccessfully(object):
@pytest.mark.test_case_id("C4814462")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
def test_ScaleModifierOverrides_InstancesProperlyScale(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -70,6 +71,7 @@ class TestScaleOverrideWorksSuccessfully(object):
@pytest.mark.test_case_id("C4896937")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
def test_ScaleModifier_InstancesProperlyScale(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ShapeIntersectionFilter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ShapeIntersectionFilter.py
index ea90b67a7f..8acdb1b644 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ShapeIntersectionFilter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_ShapeIntersectionFilter.py
@@ -38,6 +38,7 @@ class TestShapeIntersectionFilter(object):
@pytest.mark.test_case_id("C4874094")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeAlignmentModifier.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeAlignmentModifier.py
index 563ac1dcc5..6825686509 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeAlignmentModifier.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeAlignmentModifier.py
@@ -41,6 +41,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4896941")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
@@ -63,6 +64,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4814459")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeFilter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeFilter.py
index dc0f0e6514..48e532adcd 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeFilter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SlopeFilter.py
@@ -39,6 +39,7 @@ class TestSlopeFilter(object):
@pytest.mark.test_case_id("C4874097")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_SlopeFilter_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]
@@ -70,6 +71,7 @@ class TestSlopeFilter(object):
@pytest.mark.test_case_id("C4814464", "C4874096")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
@pytest.mark.skip # LYN-2211
def test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(self, request, editor, level,
launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SurfaceMaskFilter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SurfaceMaskFilter.py
index 20cab85293..952c000232 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SurfaceMaskFilter.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SurfaceMaskFilter.py
@@ -40,6 +40,7 @@ class TestSurfaceMaskFilter(object):
# Simple validation test to ensure that SurfaceTag can be created, set to a value, and compared to another SurfaceTag.
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_SurfaceMaskFilter_BasicSurfaceTagCreation(self, request, level, editor, launcher_platform):
expected_lines = [
@@ -61,6 +62,7 @@ class TestSurfaceMaskFilter(object):
@pytest.mark.test_case_id("C2561342")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_SurfaceMaskFilter_ExclusiveSurfaceTags_Function(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -93,6 +95,7 @@ class TestSurfaceMaskFilter(object):
@pytest.mark.test_case_id("C2561341")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_SurfaceMaskFilter_InclusiveSurfaceTags_Function(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -125,6 +128,7 @@ class TestSurfaceMaskFilter(object):
@pytest.mark.test_case_id("C3711666")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_filter
def test_SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected(self, request, editor, level,
launcher_platform):
diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SystemSettings.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SystemSettings.py
index adf9a90587..0b55d06ae4 100755
--- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SystemSettings.py
+++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_SystemSettings.py
@@ -38,6 +38,7 @@ class TestSystemSettings(object):
@pytest.mark.test_case_id("C2646869")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_SystemSettings_SectorPointDensity(self, request, editor, level, launcher_platform):
expected_lines = [
@@ -64,6 +65,7 @@ class TestSystemSettings(object):
@pytest.mark.test_case_id("C2646870")
@pytest.mark.SUITE_periodic
+ @pytest.mark.dynveg_misc
def test_SystemSettings_SectorSize(self, request, editor, level, launcher_platform):
expected_lines = [
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py b/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py
index e0277180ae..1284c234bd 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C100000_RigidBody_EnablingGravityWorksPoC.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C100000
# Test Case Title : Check that Gravity works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/100000
+
# fmt:off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py b/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py
index c7dd8debb9..725da5fb24 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C111111
# Test Case Title : Check that Gravity works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/111111
+
# fmt:off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py b/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py
index 216a75233f..380bb8a3c8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C12712452
# Test Case Title : Verify ScriptCanvas Collision Events
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/12712452
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py b/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py
index 2adf30e65e..b415688de7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12712453_ScriptCanvas_MultipleRaycastNode.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C12712453
# Test Case Title : Verify Raycast Multiple Node
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12712453
+
# fmt:off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py b/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py
index 94eed900ff..bcf980a710 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : 12712454
# Test Case Title : Verify overlap nodes in script canvas
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12712454
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py b/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py
index 61f26ebecb..668e8083c3 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C12712455
# Test Case Title : Verify shape cast nodes in SC
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12712455
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py b/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py
index 4745927e89..d2438110fe 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C12868578
# Test Case Title : Check that World space and local space force direction doesn't affect magnitude of force exerted
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12868578
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py b/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py
index 937fdd85a6..6372104fcf 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C12868580
# Test Case Title : Check that spline follow force works if transform components of entity are altered
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12868580
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py b/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py
index 0cb0a2f841..76578460d5 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C12905527
# Test Case Title : Check that deviation occurring in Force Magnitude due to Values in Force direction is not large
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12905527
+
# fmt: off
class Tests():
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py b/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py
index 42565333f7..38dc5488d2 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C12905528
Test Case Title : Check that user is warned if non-trigger collider component is used with force region
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/12905528
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py b/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py
index 828022ccf2..d5bd946d34 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C13351703
# Test Case Title : Check that Center of Mass calculations should not include trigger shapes
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/13351703
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py
index 77d93d9752..09b6956b06 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C13352089_RigidBodies_MaxAngularVelocity.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C13352089
# Test Case Title : Verify that maximum angular velocity interacts correctly with initial angular velocity
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/13352089
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py b/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py
index 1c580bfbfe..9c7a6e75e9 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C13508019_Terrain_TerrainTexturePainterWorks.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C13508019
# Test Case Title : Verify terrain materials are updated after using terrain texture layer painter.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/13508019
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py b/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py
index 61efe20dbd..66050565a4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C13895144
# Test Case Title : Run a level with multiple ragdolls and then switch levels
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/13895144
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py
index 5668082f78..1d0e1d5ac8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14195074
# Test Case Title : Verify Postsimulate Events
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14195074
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py b/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py
index fd5653b801..8fc58b4765 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14654881_CharacterController_SwitchLevels.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14654881
# Test Case Title : Switching levels from a level containing a character controller component
# should not lead to a crash
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14654881
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py b/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py
index 03c18a5f1a..33077f2607 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
Test case ID : C14654882
Test Case Title : Loading level with old PhysX Ragdoll component serialization should not produce asset processor errors
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14654882
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py b/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py
index e52bdb7574..dca831456d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14861498_ConfirmError_NoPxMesh.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14861498
# Test Case Title : Confirm that when a PhysXCollider has no physics asset, the physics asset collider \
# shape throw an error
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14861498
+
# fmt:off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py b/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py
index 7a65448dcd..c6a275d04d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C14861500
Test Case Title : Verify Default shape is Physics Asset
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14861500
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py
index 904b5b0189..e415687001 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C14861501
Test Case Title : Verify PxMesh is auto-assigned when Collider component is added after Rendering Mesh component
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14861501
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py
index 075c3f5b61..64820f7daf 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C14861502
Test Case Title : Verify PxMesh is auto-assigned in collider when Mesh is assigned in Rendering Mesh component
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14861502
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py b/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py
index bbaabf67f6..766a359397 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C14861504
Test Case Title : Verify if Rendering Mesh does not have a PhysX Collision Mesh fbx, then PxMesh is not auto-assigned
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14861504
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py
index 45557098f7..327f40ec38 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14902097
# Test Case Title : Verify Presimulate Events
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14902097
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py b/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py
index 19caaab4fe..f7c8be8804 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14902098
# Test Case Title : Check that force region simulation with Postsimulate works independently from rendering tick
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14902098
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py b/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py
index 342ac6bdbd..73137ac497 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C14976307
# Test Case Title : Check that Set Gravity Enabled works on an entity with gravity that starts as disabled
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/14976307
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py b/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py
index 815e922a76..c76c5cab80 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case
# ID : C14976308
# Title : Verify that SetKinematicTarget on PhysX rigid body updates transform for kinematic entities and vice versa
-# URL : https://testrail.agscollab.com/index.php?/cases/view/14976308
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py
index 76ea9475ff..bdfc9d19be 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15096732
# Test Case Title : Verify Default material library works across different levels
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15096732
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py
index 748052db56..d45423fe94 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15096732
# Test Case Title : Verify Default material library works across different levels
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15096732
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py b/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py
index 4c7949cc91..3dd49d4fe4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15096735
# Test Case Title : Verify that default material library works consistently across all systems that use it
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15096735
+
# fmt:off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py b/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py
index cc7dc3c5e2..c806cbb7d4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15096737_Materials_DefaultMaterialLibraryChanges.py
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case Title : Verify that a change in the default material library material information
# affects all the materials that reference it, even non-defaulted
# exactly like if the library was selected
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15096737
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py b/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py
index 0f33f0858b..bef98f6830 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C15096740
Test Case Title : Verify that clearing a material library on all systems that use it,
assigns the default material library
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15096740
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py b/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py
index 625a8bfb4a..dadfbd7a7e 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15308217
# Test Case Title : Verify that the Terrain texture layer doesn't crash when changing
# from on a level with a terrain component to another level without a terrain component
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15308217
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py b/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py
index 3f6457f15c..ebc7d3fadd 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C15308221
# Test Case Title : Verify that material library and slots are always in sync and work consistently through the different places of usage
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/15308221
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py b/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py
index 57a0e6a75e..dba14552c8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15425929_Undo_Redo.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15425929
# Test Case Title : Verify that undo - redo operations do not create any error
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15425929
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py b/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py
index f61886ccd0..8ff90fddaf 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15425935
# Test Case Title : Verify that the change in Material Library gets updated across levels
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15425935
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py b/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py
index 99e0dcc669..21f5952678 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15556261
# Test Case Title : Check that the material assignment works with Character Controller
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15556261
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py b/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py
index 4572dd322a..1e9b15fc90 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C15563573
# Test Case Title : Check that any change (Add/Delete/Modify) made to the material surface in the material library reflects immediately in the PhysX Character Controller
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/15563573
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py b/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py
index 52af7d8be5..6b31ffb13b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C15845879
# Test Case Title : Check that linear damping with high values do not make the object to quiver
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/15845879
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py
index 68efd452b2..32bd02ae26 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C17411467
Test Case Title : Check that Physx Ragdoll component can be added without errors/warnings
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/17411467
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py
index b13869ce12..c3a351ebea 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243580
# Test Case Title : Check that fixed joint constrains 2 bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243580
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py
index 19feee575b..00e9a5625f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243581
# Test Case Title : Check that fixed joint is breakable
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243581
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py
index c9c90d35a7..d34e3f67d3 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243582
# Test Case Title : Check that fixed joint allows lead-follower collision
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243582
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py
index 66343534a7..eafce6ceaf 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243583
# Test Case Title : Check that hinge joint constrains 2 bodies about X-axis
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243583
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py
index 3b335cc5c6..90027be2d7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243584
# Test Case Title : Check that hinge joint allows soft limit constraints on 2 bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243584
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py
index 289522fcac..0f677d94ae 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243585
# Test Case Title : Check that hinge joint allows no limit constraints on 2 bodies
-# URL of the test case :https://testrail.agscollab.com/index.php?/cases/view/18243585
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py
index 60b9189c83..7c973729d1 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243586
# Test Case Title : Check that hinge joint allows lead-follower collision
-# URL of the test case :https://testrail.agscollab.com/index.php?/cases/view/18243586
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py
index af6fa8cbac..4734328d70 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243587
# Test Case Title : Check that hinge joint is breakable
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243587
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py
index 074ca03000..b6acfd6dd8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243588
# Test Case Title : Check that ball joint constrains 2 bodies within cone limits
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243588
+
# fmt: off
class Tests:
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py
index e038b33043..1ca49035b5 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : 18243589
# Test Case Title : Check that ball joint allows soft limit constraints
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243589
+
# fmt: off
class Tests:
@@ -57,6 +57,7 @@ def C18243589_Joints_BallSoftLimitsConstrained():
"""
import os
import sys
+ import math
import ImportPathHelper as imports
@@ -95,13 +96,33 @@ def C18243589_Joints_BallSoftLimitsConstrained():
Report.info_vector3(follower.position, "follower initial position:")
leadInitialPosition = lead.position
followerInitialPosition = follower.position
-
- # 4) Wait for several seconds
- general.idle_wait(1.0) # wait for lead and follower to move
+
+ followerMovedAboveJoint = False
+ #calculate the start vector from follower and lead positions
+ normalizedStartPos = JointsHelper.getRelativeVector(lead.position, follower.position)
+ normalizedStartPos = normalizedStartPos.GetNormalizedSafe()
+ #the targeted angle to reach between the initial vector and the current follower-lead vector
+ TARGET_ANGLE_DEG = 45
+ targetAngle = math.radians(TARGET_ANGLE_DEG)
+ angleAchieved = 0.0
+
+ def checkAngleMet():
+ #calculate the current follower-lead vector
+ normalVec = JointsHelper.getRelativeVector(lead.position, follower.position)
+ normalVec = normalVec.GetNormalizedSafe()
+ #dot product + acos to get the angle
+ angleAchieved = math.acos(normalizedStartPos.Dot(normalVec))
+ #is it above target?
+ return angleAchieved > targetAngle
+
+ MAX_WAIT_TIME = 2.0 #seconds
+ followerMovedAboveJoint = helper.wait_for_condition(checkAngleMet, MAX_WAIT_TIME)
# 5) Check to see if lead and follower behaved as expected
- Report.info_vector3(lead.position, "lead position after 1 second:")
- Report.info_vector3(follower.position, "follower position after 1 second:")
+ Report.info_vector3(lead.position, "lead position:")
+ Report.info_vector3(follower.position, "follower position:")
+ angleAchievedDeg = math.degrees(angleAchieved)
+ Report.info(f"Angle achieved {angleAchievedDeg:.2f} Target {TARGET_ANGLE_DEG:.2f}")
leadPositionDelta = lead.position.Subtract(leadInitialPosition)
leadRemainedStill = JointsHelper.vector3SmallerThanScalar(leadPositionDelta, FLOAT_EPSILON)
@@ -111,7 +132,6 @@ def C18243589_Joints_BallSoftLimitsConstrained():
followerMovedinXYZ = JointsHelper.vector3LargerThanScalar(followerPositionDelta, FLOAT_EPSILON)
Report.critical_result(Tests.check_follower_position, followerMovedinXYZ)
- followerMovedAboveJoint = follower.position.z > (followerInitialPosition.z + 2.5) # (followerInitialPosition.z + 2.5) is the z position past the 45 degree limit. This is to show that the follower swinged past the 45 degree cone limit, above the joint position.
Report.critical_result(Tests.check_follower_above_joint, followerMovedAboveJoint)
# 6) Exit Game Mode
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py
index ede46fd5c5..1d5a213cd8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243590
# Test Case Title : Check that ball joint allows no limit constraints
-# URL of the test case :https://testrail.agscollab.com/index.php?/cases/view/18243590
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py
index c3e527956f..8f7b2d7823 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243591
# Test Case Title : Check that ball joint allows lead-follower collision
-# URL of the test case :https://testrail.agscollab.com/index.php?/cases/view/18243591
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py
index 350fccd125..0fa43cf9c8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243592
# Test Case Title : Check that ball joint is breakable
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243592
+
# fmt: off
class Tests:
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py
index 4580a229ea..37d659f181 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18243593
# Test Case Title : Check that fixed/hinge/ball joints allow constraints to global frame
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18243593
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py
index 57dfc0f349..b17b97a816 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18977601
# Test Case Title : Verify that when two objects with different materials collide, the friction combine priority works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18977601
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py
index 9b7fea1ab9..690d3d4d3f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C18981526
# Test Case Title : Verify when two objects with different materials collide, the restitution combine priority works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/18981526
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py b/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py
index 48c947aa1f..611b502019 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C19536274
Test Case Title : Verify that the Get Collision Layer Name node prints the name of the collision layer
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/19536274
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py b/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py
index 66e1302b5b..04d973cbb2 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C19536277
Test Case Title : Verify that when a group is modified using ToggleCollisionLayer node such that the new group is not in the pre-existing groups, GetCollisionGroupName node prints no value
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/19536277
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py
index 32ece8541c..23996934bc 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C19578018
Test Case Title : Verify that a shape collider component with no shape component indicates a missing service
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/19578018
+
"""
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py b/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py
index 0c42f5457d..1eb36e16f4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C19578021
Test Case Title : Verify that a shape collider component may be added to an entity along with one or more PhysX collider components
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/19578021
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py b/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py
index 769f08e3c4..f6584624c3 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C19723164
Test Case Title : Verify that if we had 512 shape colliders in the level, the level does not crash
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/19723164
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
index d8e0a6769c..101b96b99b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C24308873
# Test Case Title : Check that cylinder shape collider collides with terrain
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/24308873
+
# A cylinder is suspended slightly over PhysX Terrain to check that it collides when dropped
@@ -20,7 +20,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
class Tests():
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
find_cylinder = ("Cylinder entity found", "Cylinder entity not found")
- find_terrain = ("Terrain found", "Terrain not found")
+ create_terrain = ("Terrain entity created successfully", "Failed to create Terrain Entity")
+ find_terrain = ("Terrain entity found", "Terrain entity not found")
+ add_physx_shape_collider = ("Added PhysX Shape Collider", "Failed to add PhysX Shape Collider")
+ add_box_shape = ("Added Box Shape", "Failed to add Box Shape")
cylinder_above_terrain = ("Cylinder position above ground", "Cylinder is not above the ground")
time_out = ("No time out occurred", "A time out occurred, please validate level setup")
touched_ground = ("Touched ground before time out", "Did not touch ground before time out")
@@ -40,11 +43,12 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain():
Once game mode is entered, the cylinder should fall toward and collide with the terrain.
Steps:
- 1) Open level and enter game mode
- 2) Retrieve entities and positions
- 3) Wait for cylinder to collide with terrain OR time out
- 4) Exit game mode
- 5) Close the editor
+ 1) Open level and create terrain Entity.
+ 2) Enter Game Mode.
+ 3) Retrieve entities and positions
+ 4) Wait for cylinder to collide with terrain OR time out
+ 5) Exit game mode
+ 6) Close the editor
:return:
"""
@@ -54,29 +58,48 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain():
import ImportPathHelper as imports
imports.init()
-
+ from editor_python_test_tools.editor_entity_utils import EditorEntity
import azlmbr.legacy.general as general
import azlmbr.bus
+ import azlmbr.math as math
from editor_python_test_tools.utils import Report
from editor_python_test_tools.utils import TestHelper as helper
# Global time out
TIME_OUT = 1.0
- # 1) Open level / Enter game mode
+ # 1) Open level
helper.init_idle()
helper.open_level("Physics", "C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain")
+
+ # Create terrain entity
+ terrain = EditorEntity.create_editor_entity_at([30.0, 30.0, 33.96], "Terrain")
+ Report.result(Tests.create_terrain, terrain.id.IsValid())
+
+ terrain.add_component("PhysX Shape Collider")
+ Report.result(Tests.add_physx_shape_collider, terrain.has_component("PhysX Shape Collider"))
+
+ box_shape_component = terrain.add_component("Box Shape")
+ Report.result(Tests.add_box_shape, terrain.has_component("Box Shape"))
+
+ box_shape_component.set_component_property_value("Box Shape|Box Configuration|Dimensions",
+ math.Vector3(1024.0, 1024.0, 0.01))
+
+ # 2)Enter game mode
helper.enter_game_mode(Tests.enter_game_mode)
- # 2) Retrieve entities and positions
+ # 3) Retrieve entities and positions
cylinder_id = general.find_game_entity("PhysX_Cylinder")
Report.critical_result(Tests.find_cylinder, cylinder_id.IsValid())
+
+
+ terrain_id = general.find_game_entity("Terrain")
+ Report.critical_result(Tests.find_terrain, terrain_id.IsValid())
- terrain_id = general.find_game_entity("PhysX_Terrain")
- Report.critical_result(Tests.find_terrain, terrain_id.IsValid())
- cylinder_pos = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTM", cylinder_id).GetPosition()
- terrain_pos = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTM", terrain_id).GetPosition()
+ cylinder_pos = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", cylinder_id)
+ #Cylinder position is 64,84,35
+ terrain_pos = azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldTranslation", terrain_id)
Report.info_vector3(cylinder_pos, "Cylinder:")
Report.info_vector3(terrain_pos, "Terrain:")
Report.critical_result(
@@ -104,13 +127,13 @@ def C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain():
handler.connect(cylinder_id)
handler.add_callback("OnCollisionBegin", on_collision_begin)
- # 3) Wait for the cylinder to hit the ground OR time out
+ # 4) Wait for the cylinder to hit the ground OR time out
test_completed = helper.wait_for_condition((lambda: TouchGround.value), TIME_OUT)
Report.critical_result(Tests.time_out, test_completed)
Report.result(Tests.touched_ground, TouchGround.value)
- # 4) Exit game mode
+ # 5) Exit game mode
helper.exit_game_mode(Tests.exit_game_mode)
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py b/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py
index 8980e68250..052795318a 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C28978033_Ragdoll_WorldBodyBusTests.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C28978033
# Test Case Title : Check that WorldRequestBus works with PhysX ragdoll
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/28978033
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py b/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py
index be541e4bf9..4915d362f7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C29032500_EditorComponents_WorldBodyBusWorks.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C29032500
# Test Case Title : Check that WorldRequestBus works with editor components
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/29032500
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py
index 3e3770adb9..b671cd3754 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C3510642
# Test Case Title : Check that when no physX terrain component is added, collision of a PhysX object
# with terrain does not work. Consequently, PhysX material assignment to terrain cannot be tested.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/3510642
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py b/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py
index 5f2c40f11e..a7916129e8 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : 4044455
# Test Case Title : Verify that any change in any of the values including the name of the material,
# once saved, is immediately reflected in the component and functionality
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044455
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py
index b71c1e8ede..eced55fc76 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044456
# Test Case Title : Verify that when two objects with different materials collide, the friction combine works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044456
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py
index 1ed2e8086c..5969541a86 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044457
# Test Case Title : Verify that when two objects with different materials collide, the restitution combine works
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044457
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py b/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py
index c420250dfa..d414bc4813 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044459
# Test Case Title : Verify the functionality of dynamic friction
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044459
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py b/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py
index 4e330002ff..6e864c554b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044460
# Test Case Title : Verify the functionality of static friction
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044460
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py b/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py
index af8990d87f..a5219ed2c7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044461
# Test Case Title : Verify the functionality of restitution
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044461
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py b/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py
index a8375114d5..e9106d89eb 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4044694
# Test Case Title : Verify that if we add an empty Material library in Collider Component, the object continues to use Default material values
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4044694
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py b/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py
index 858e778f07..d65e9050bd 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4044695
Test Case Title : Verify that when you add a multiple surface fbx in PxMesh in PhysxCollider,
multiple number of Material Slots populate in the Materials Section
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044695
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py b/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py
index dba759015f..435e8242d5 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4044697
# Test Case Title : Verify that each surface picks up the material assigned to it and behaves accordingly.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4044697
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py b/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py
index 145a5e1b60..b7b3ed855f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4888315
# Test Case Title : Check that any change (Add/Delete/Modify) made to the material surface in the material library reflects immediately in the PhysX Collider component
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4888315
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py
index 59b6a3fdfc..7ebb62eaf3 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4925577
# Test Case Title : Verify that material can be assigned to PhysX terrain in Terrain Texture Layers
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4925577
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py
index e0425c35be..315cf9c3bd 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4925579
# Test Case Title : Check that any change (Add/Delete/Modify) made to the material surface in the material library reflects immediately in the PhysX Terrain layers
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4925579
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py b/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py
index 9944a033e3..5fae373f47 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4925580
# Test Case Title : Verify that Material can be assigned to Ragdoll Bones and they behave as per their material
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4925580
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py b/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py
index ed872ae99e..ca37be6ff0 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4925582
# Test Case Title : Check that any change (Add/Delete/Modify) made to the material surface in the material library reflects immediately in the ragdoll bones
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4925582
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py b/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py
index aa059eb224..8bb005711e 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976194
# Test Case Title : Verify that you can add PhysX Rigid Bodies Physics component to an Entity without any warning or Error.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976194
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py
index c5740b2798..3dbf26a0ac 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976195
# Test Case Title : Verify that when you assign an Initial Linear Velocity to an object,
# ... it moves with that linear velocity when we switch to game mode.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976195
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py
index 08e171269e..7a17eb5941 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976197
# Test Case Title : Verify that when you assign an Initial Angular Velocity to an object,
# it moves with that Angular velocity when we switch to game mode
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976197
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py b/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py
index 2e19b633c4..457cb18640 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976199_RigidBodies_LinearDampingObjectMotion.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976199
# Test Case Title : Verify that with higher linear damping, the object in motion comes to rest faster
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976199
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py b/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py
index b90b34be53..f423821757 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976200_RigidBody_AngularDampingObjectRotation.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976200
# Test Case Title : Verify that with higher angular damping, the object in rotation comes to rest faster
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976200
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py
index 7fb0ff84ce..fd15cbbb0f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976201
# Test Case Title : Verify that the value assigned to the Mass of the object, gets actually assigned to the object
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976201
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py b/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py
index 7d4cf1066e..c66f5cf7b6 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py
@@ -14,7 +14,7 @@ Test case ID : C4976202
Test Case Title : Verify that if the object is moving with Kinetic energy less than
the sleep threshold value, then physX will put it to stop after 0.4 secs (once the
wake counter goes to zero) if the KE is still below the threshold
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976202
+
"""
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py b/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py
index 29fc2ec2a3..6b29062adf 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976204
# Test Case Title : Verify that when Start Asleep is checked, the object in air does not fall down due to
# gravity or does not start moving with initial linear velocity assigned to it when switched to game mode
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976204
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py b/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py
index b97c590a93..934e546d65 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976206
# Test Case Title : VErify that when Gravity enables is checked, the object falls down due to gravity [sic]
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976206
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py b/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py
index 4481c00fc5..58193a1e9b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976207
# Test Case Title : Verify that when Kinematic is checked, the object behaves as a Kinematic object
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976207
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py b/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py
index 79ea6e5dc7..600b20d98d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976209
# Test Case Title : Verify that when Compute COM is enabled, the PhysX system computes the COM of the object on its own
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976209
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py b/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py
index 451081ba23..c53fb3508d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976210
# Test Case Title : Verify that when Compute COM is disabled, the user gets an option to add the co-ordinates of
# the COM and the COM gets implemented at those co-ordinates.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976210
+
import os
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py b/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py
index 63f0d382c3..dada67548b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976218_RigidBodies_InertiaObjectsNotComputed.py
@@ -9,7 +9,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
# Test case ID : C4976218
# Test Case Title: Verify that when compute inertia is checked, the physX engine does compute the inertia of the objects
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976218
+
# fmt: off
class Tests():
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py b/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py
index 8d9dc01396..78c031870d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976227
# Test Case Title : Validate that a Collision Group can be added
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976227
+
# Level has entity with custom collision group added.
# If level enters game mode, collision group addition is validated.
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py
index 72442601e4..fdb862005f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4976236
Test Case Title : Verify that you can add the physX collider component to an entity
without it throwing an error or warning
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976236
+
"""
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py b/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py
index bb6234b69e..ac14164f45 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976242
# Test Case Title : Assign same collision layer and same collision group to two entities and
# verify that they collide or not
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976242
+
# fmt: off
class Tests():
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py b/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py
index 949ebb2b2a..44a8b15169 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976243
# Test Case Title : Assign different collision layers and same collision group
# (such that this group has both these collision layers enabled) to two entities and verify that they collide
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976243
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py b/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py
index c35b9fab81..ca1e7f57f5 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976244
# Test Case Title : Checks that two entities of similar custom layer collide
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976244
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py
index dafb8d9014..5f8c0a8d67 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4976245
# Test Case Title : Check that two entities of collision group "None" do not collide,
# even though they have the same collision layer
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4976245
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py
index 8d985de402..126ebf48dc 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4982593
# Test Case Title : Check that two entities with different collision groups and layers do not collide.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982593
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py b/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py
index 8746996ca8..c50c517086 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case ID : C4982595
# Test Case Title : Verify that when the Trigger Checkbox is ticked, the object no longer collides with another object
# but simply passes through it
-# Test Case URL : https://testrail.agscollab.com/index.php?/cases/view/4982595
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py
index 2bd4fc5adc..29a3b7f89d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4982797
# Test Case Title : Check that collision offsets trigger collision events,
# not entity transform locations
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982797
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py
index f86890d8bf..6276c81871 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C4982798
# Test Case Title : Verify that when the x,y,z values are defined in the offset, the collider frame
# rotates from its original orientation in the direction defined by the x,y,z units
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982798
+
import os
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py
index c37ad2b2d2..1822a1efa7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4982800
Test Case Title : Verify that the shape Sphere can be selected from the drop downlist and the value for its radius can be set
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982800
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py
index 19a835da18..ef9b8171c4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4982801
Test Case Title : Verify that the shape Box can be selected from drop downlist and the value for its dimensions in x,y,z can be set after that
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982801
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py
index e1365d0887..642dea48de 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py
@@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4982802
Test Case Title : Verify that the shape capsule can be selected from drop downlist and the value for its height and radius can be set after that
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982802
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py b/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py
index 4ae177934a..99e93c26c9 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Test case ID : C4982803
Test Case Title : Verify that when the shape Physics Asset is selected,
PxMesh option gets enabled and a Px Mesh can be selected and assigned to the object
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/4982803
+
"""
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py b/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py
index 9d2a49ac70..b4af6ab506 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5296614
# Test Case Title : Check that unless you assign a shape to a physX collider component,
# the material assigned to it does not take affect
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5296614
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py b/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py
index 7617e41cad..838007436c 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5340400
# Test Case Title : Verify that when Compute inertia is disabled, the user gets to set the moment of inertia
# and physX engine work accordingly
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5340400
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py
index 0686adf15d..f17bf2492f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689518_PhysXTerrain_CollidesWithPhysXTerrain.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5689518
# Test Case Title : PhysX entities collide with PhysX Terrain
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689518
+
# A ball is suspended slightly over PhysX Terrain to check that it collides when dropped
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py b/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py
index ffafeaab34..61ef63c4ae 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5689522
# Test Case Title : Create an entity with PhysX terrain. Add another PhysX terrain and verify that
# you are able to add it without any crash or error.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689522
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py b/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py
index 2b1a73f1f3..c395507ea0 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5689524
# Test Case Title : Create multiple entities each with one or more terrain components and verify that you are
# able to successfully add the PhysX Terrain components to them.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689524
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py b/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py
index 265836489d..12f3955bf6 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5689528
# Test Case Title : Create multiple entities each with one PhysX terrain component and verify that a warning
# is thrown to the user
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689528
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py b/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py
index 138ae68408..c5342d7421 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test Case Title : Create an entity with PhysX Terrain component and add
# PhysX Rigid Body PhysX, PhysX Collider and Rendering Mesh to it and
# verify that it works in game mode
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689529
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py
index 7d60a61ec1..85a9037a36 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5689531
# Test Case Title : Check that when you add a spawner component to a level to spawn a
# terrain and also add a terrain component explicitly, no crash happens
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5689531
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py b/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py
index f01dd4582f..b1f9f8f934 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932040
# Test Case Title : Check that force region exerts world space force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932040
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py
index 095a669541..5fc07fdc67 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932041
# Test Case Title : Check that force region exerts local space force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932041
+
# Sphere drops and is acted upon in an upward and positive x-ward direction by a force
# with a magnitude close to the assigned force region magnitude when it reaches the force region.
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py b/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py
index 04cecd45b2..b55ce59d7a 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932042
# Test Case Title : Check that force region exerts linear damping force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932042
+
# fmt: off
@@ -135,7 +135,7 @@ def C5932042_PhysXForceRegion_LinearDamping():
# Constants
CLOSE_ENOUGH = 0.001
- TIME_OUT = 2.0
+ TIME_OUT = 3.0
INITIAL_VELOCITY = azmath.Vector3(0.0, 0.0, -10.0)
# 1) Open level / Enter game mode
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py
index 512698ce4b..b4d29f8065 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932043_ForceRegion_SimpleDragOnRigidBodies.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932043
# Test Case Title : Check that force region exerts simple drag force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932043
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py b/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py
index b7257b488b..6cfaf857a4 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932044
# Test Case Title : Check that force region exerts point force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932044
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py b/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py
index eca0679921..298265966c 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5932045
# Test Case Title : Check that force region exerts spline follow force on rigid bodies
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5932045
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py b/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py
index 6aff0a7145..a8ef614f75 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959759_RigidBody_ForceRegionSpherePointForce.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959759
# Test Case Title : Check that force region (sphere) exerts point force
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959759
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py b/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py
index 89eb1842be..4cb1cffd16 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959760
# Test Case Title : Check that force region (capsule) exerts point force
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959760
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py b/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py
index ba0475266b..27f9e41a7d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959761
# Test Case Title : Check that force region (physics asset) exerts point force
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959761
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py b/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py
index 76130d25eb..4b62f9a029 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959763_ForceRegion_ForceRegionImpulsesCube.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959764
# Test Case Title : Check that rigid body (Cube) gets impulse from force region
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959764
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py b/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py
index f314dae5b7..aadc07b09b 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959764_ForceRegion_ForceRegionImpulsesCapsule.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959764
# Test Case Title : Check that rigid body (Capsule) gets impulse from force region
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959764
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py b/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py
index ddcba5996b..ed007594c2 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959765_ForceRegion_AssetGetsImpulsed.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959765
# Test Case Title : Check that rigid body (asset) gets impulse from force region
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959765
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py
index 175f73a420..7c3f8a43aa 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959808_ForceRegion_PositionOffset.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959808
# Test Case Title : Verify Force Region Position Offset
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959808
+
# fmt:off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py
index 1ad53194d3..dc84be8798 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959809_ForceRegion_RotationalOffset.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959809
# Test Case Title : Verify Force Region Rotational Offset
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959809
+
# fmt:off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py b/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py
index 212f7cc86b..8efc3dc635 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5959810
# Test Case Title : Check that multiple forces in single force region create correct net force
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5959810
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py b/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py
index 4aa0fef642..948e172962 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5968759
# Test Case Title : Check nested force regions exert forces simultaneously on rigid body
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5968759
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py b/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py
index ba491c96a7..0897fcb0d7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C5968760
# Test Case Title : Check moving force region changes net force
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/5968760
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py b/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py
index 4543b0b8f6..00d53a2d6c 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6032082
# Test Case Title : Verify multiple terrain resolutions are supported
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6032082
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py b/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py
index 557b7e7ec5..2b427468b7 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6090546
# Test Case Title : Check that a force region slice can be saved and instantiated
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090546
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py b/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py
index a07fd1861b..84474f0226 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6090547
# Test Case Title : Check that force regions in parent and child entities work together.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090547
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py
index f8da62ebac..e2c55a024d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
Test case ID : C6090550
Test Case Title : Check that force region exerts world space force on rigid bodies (negative test)
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090550
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py
index 0788b1da66..2e201e20bd 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
Test case ID : C6090551
Test Case Title : Check that force region exerts local space force on rigid bodies (negative test)
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090551
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py
index a878819045..585a337389 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
Test case ID : C6090552
Test Case Title : Check that force region exerts linear damping force on rigid bodies (negative test)
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090552
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py
index 43c4335918..6abee0ad64 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6090553
# Test Case Title : Check that force region exerts simple drag force on rigid bodies (negative test)
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090553
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py
index d7781b6040..0969cebd8d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
Test case ID : C6090554
Test Case Title : Check that force region exerts point force on rigid bodies (negative test)
-URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090554
+
"""
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py
index b1b76d896d..90f67391ad 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6090555
# Test Case Title : Check that force region exerts spline follow force on rigid bodies(negative test)
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6090555
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py b/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py
index 11281df4eb..ee68ef6049 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6131473
# Test Case Title : Verify a static slice is not spawned automatically everytime a dynamic slice with
# PhysX Components is spawned
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6131473
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py b/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py
index 6501e11e68..6693c17dff 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py
@@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6224408
# Test Case Title : Entity using PhysX nodes in Script Canvas can be spawned.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6224408
+
# fmt: off
class Tests:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py b/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py
index 44c8be9e1e..c360473b7f 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6274125
# Test Case Title : Verify ScriptCanvas Trigger Events.
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6274125
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py b/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py
index c1a51f2887..4b0b036970 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Test case ID : C6321601
# Test Case Title : Check that very high values of direction axes of forces do not throw error
-# URL of the test case : https://testrail.agscollab.com/index.php?/cases/view/6321601
+
# fmt: off
diff --git a/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py b/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py
index e61118ef5b..476c1df237 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/JointsHelper.py
@@ -27,6 +27,13 @@ def vector3LargerThanScalar(vec3Value, scalarValue):
vec3Value.y > scalarValue and
vec3Value.z > scalarValue)
+def getRelativeVector(vecA, vecB):
+ relativeVec = vecA
+ relativeVec.x = relativeVec.x - vecB.x
+ relativeVec.y = relativeVec.y - vecB.y
+ relativeVec.z = relativeVec.z - vecB.z
+ return relativeVec
+
# Entity class for joints tests
class JointEntity:
diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
index 67e855a00e..f81445fe03 100644
--- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py
@@ -34,4 +34,61 @@ class TestAutomation(TestAutomationBase):
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
+ from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
+ from . import C4044459_Material_DynamicFriction as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
+ from . import C15425929_Undo_Redo as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C4976243_Collision_SameCollisionGroupDiffCollisionLayers(self, request, workspace, editor,
+ launcher_platform):
+ from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C14654881_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform):
+ from . import C14654881_CharacterController_SwitchLevels as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ def test_C17411467_AddPhysxRagdollComponent(self, request, workspace, editor, launcher_platform):
+ from . import C17411467_AddPhysxRagdollComponent as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C12712453_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform):
+ from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
+ # Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ @fm.file_override('physxsystemconfiguration.setreg','C4982593_PhysXCollider_CollisionLayer.setreg', 'AutomatedTesting/Registry')
+ def test_C4982593_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform):
+ from . import C4982593_PhysXCollider_CollisionLayerTest as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C18243586_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
+ from . import C18243586_Joints_HingeLeadFollowerCollide as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C4982803_Enable_PxMesh_Option(self, request, workspace, editor, launcher_platform):
+ from . import C4982803_Enable_PxMesh_Option as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain(self, request, workspace, editor, launcher_platform):
+ from . import C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain as test_module
self._run_test(request, workspace, editor, test_module)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py
index 39ed85a65a..93831e9658 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py
@@ -52,11 +52,6 @@ class TestAutomation(TestAutomationBase):
from . import C4976207_PhysXRigidBodies_KinematicBehavior as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(self, request, workspace, editor, launcher_platform):
- from . import C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C5932042_PhysXForceRegion_LinearDamping(self, request, workspace, editor, launcher_platform):
from . import C5932042_PhysXForceRegion_LinearDamping as test_module
@@ -92,11 +87,6 @@ class TestAutomation(TestAutomationBase):
from . import C4976194_RigidBody_PhysXComponentIsValid as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform):
- from . import C4044459_Material_DynamicFriction as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C5932045_ForceRegion_Spline(self, request, workspace, editor, launcher_platform):
from . import C5932045_ForceRegion_Spline as test_module
@@ -208,26 +198,11 @@ class TestAutomation(TestAutomationBase):
from . import C18981526_Material_RestitutionCombinePriority as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
- from . import C15425929_Undo_Redo as test_module
- self._run_test(request, workspace, editor, test_module)
-
- @revert_physics_config
- def test_C15308217_NoCrash_LevelSwitch(self, request, workspace, editor, launcher_platform):
- from . import C15308217_NoCrash_LevelSwitch as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C12868580_ForceRegion_SplineModifiedTransform(self, request, workspace, editor, launcher_platform):
from . import C12868580_ForceRegion_SplineModifiedTransform as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C4976243_Collision_SameCollisionGroupDiffCollisionLayers(self, request, workspace, editor, launcher_platform):
- from . import C4976243_Collision_SameCollisionGroupDiffCollisionLayers as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C12712455_ScriptCanvas_ShapeCastVerification(self, request, workspace, editor, launcher_platform):
from . import C12712455_ScriptCanvas_ShapeCastVerification as test_module
@@ -248,17 +223,6 @@ class TestAutomation(TestAutomationBase):
from . import C6131473_StaticSlice_OnDynamicSliceSpawn as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C4982798_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform):
- from . import C4982798_Collider_ColliderRotationOffset as test_module
- self._run_test(request, workspace, editor, test_module)
-
- @revert_physics_config
- def test_C12712453_ScriptCanvas_MultipleRaycastNode(self, request, workspace, editor, launcher_platform):
- from . import C12712453_ScriptCanvas_MultipleRaycastNode as test_module
- # Fixme: unexpected_lines = ["Assert"] + test_module.Lines.unexpected
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C5959808_ForceRegion_PositionOffset(self, request, workspace, editor, launcher_platform):
from . import C5959808_ForceRegion_PositionOffset as test_module
@@ -275,7 +239,7 @@ class TestAutomation(TestAutomationBase):
def test_C13895144_Ragdoll_ChangeLevel(self, request, workspace, editor, launcher_platform):
from . import C13895144_Ragdoll_ChangeLevel as test_module
self._run_test(request, workspace, editor, test_module)
-
+
@revert_physics_config
def test_C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody(self, request, workspace, editor, launcher_platform):
from . import C5968759_ForceRegion_ExertsSeveralForcesOnRigidBody as test_module
@@ -290,6 +254,8 @@ class TestAutomation(TestAutomationBase):
from . import C4044697_Material_PerfaceMaterialValidation as test_module
self._run_test(request, workspace, editor, test_module)
+ @pytest.mark.xfail(
+ reason="This test will sometimes fail as the ball will continue to roll before the timeout is reached.")
@revert_physics_config
def test_C4976202_RigidBody_StopsWhenBelowKineticThreshold(self, request, workspace, editor, launcher_platform):
from . import C4976202_RigidBody_StopsWhenBelowKineticThreshold as test_module
@@ -305,11 +271,6 @@ class TestAutomation(TestAutomationBase):
from . import C5296614_PhysXMaterial_ColliderShape as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C6090547_ForceRegion_ParentChildForceRegions(self, request, workspace, editor, launcher_platform):
- from . import C6090547_ForceRegion_ParentChildForceRegions as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C4982595_Collider_TriggerDisablesCollision(self, request, workspace, editor, launcher_platform):
from . import C4982595_Collider_TriggerDisablesCollision as test_module
@@ -320,11 +281,6 @@ class TestAutomation(TestAutomationBase):
from . import C14976307_Gravity_SetGravityWorks as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C14654881_CharacterController_SwitchLevels(self, request, workspace, editor, launcher_platform):
- from . import C14654881_CharacterController_SwitchLevels as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(self, request, workspace, editor, launcher_platform):
from . import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module
@@ -374,18 +330,6 @@ class TestAutomation(TestAutomationBase):
from . import C4044461_Material_Restitution as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- @fm.file_override('physxsystemconfiguration.setreg','C4982593_PhysXCollider_CollisionLayer.setreg', 'AutomatedTesting/Registry')
- def test_C4982593_PhysXCollider_CollisionLayerTest(self, request, workspace, editor, launcher_platform):
- from . import C4982593_PhysXCollider_CollisionLayerTest as test_module
- self._run_test(request, workspace, editor, test_module)
-
- @revert_physics_config
- @fm.file_override('physxsystemconfiguration.setreg','C3510644_Collider_CollisionGroups.setreg', 'AutomatedTesting/Registry')
- def test_C3510644_Collider_CollisionGroups(self, request, workspace, editor, launcher_platform):
- from . import C3510644_Collider_CollisionGroups as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
@fm.file_override('physxdefaultsceneconfiguration.setreg','C14902097_ScriptCanvas_PreUpdateEvent.setreg', 'AutomatedTesting/Registry')
def test_C14902097_ScriptCanvas_PreUpdateEvent(self, request, workspace, editor, launcher_platform):
@@ -415,11 +359,6 @@ class TestAutomation(TestAutomationBase):
from . import C18243589_Joints_BallSoftLimitsConstrained as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C18243586_Joints_HingeLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
- from . import C18243586_Joints_HingeLeadFollowerCollide as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C18243591_Joints_BallLeadFollowerCollide(self, request, workspace, editor, launcher_platform):
from . import C18243591_Joints_BallLeadFollowerCollide as test_module
@@ -441,21 +380,11 @@ class TestAutomation(TestAutomationBase):
from . import C14861500_DefaultSetting_ColliderShape as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C19578021_ShapeCollider_CanBeAdded(self, request, workspace, editor, launcher_platform):
- from . import C19578021_ShapeCollider_CanBeAdded as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C19723164_ShapeCollider_WontCrashEditor(self, request, workspace, editor, launcher_platform):
from . import C19723164_ShapeColliders_WontCrashEditor as test_module
self._run_test(request, workspace, editor, test_module)
- @revert_physics_config
- def test_C4982803_Enable_PxMesh_Option(self, request, workspace, editor, launcher_platform):
- from . import C4982803_Enable_PxMesh_Option as test_module
- self._run_test(request, workspace, editor, test_module)
-
@revert_physics_config
def test_C4982800_PhysXColliderShape_CanBeSelected(self, request, workspace, editor, launcher_platform):
from . import C4982800_PhysXColliderShape_CanBeSelected as test_module
@@ -471,10 +400,6 @@ class TestAutomation(TestAutomationBase):
from . import C4982802_PhysXColliderShape_CanBeSelected as test_module
self._run_test(request, workspace, editor, test_module)
- def test_C17411467_AddPhysxRagdollComponent(self, request, workspace, editor, launcher_platform):
- from . import C17411467_AddPhysxRagdollComponent as test_module
- self._run_test(request, workspace, editor, test_module)
-
def test_C12905528_ForceRegion_WithNonTriggerCollider(self, request, workspace, editor, launcher_platform):
from . import C12905528_ForceRegion_WithNonTriggerCollider as test_module
# Fixme: expected_lines = ["[Warning] (PhysX Force Region) - Please ensure collider component marked as trigger exists in entity"]
@@ -522,4 +447,35 @@ class TestAutomation(TestAutomationBase):
def test_C100000_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
- self._run_test(request, workspace, editor, test_module)
\ No newline at end of file
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ @fm.file_override('physxsystemconfiguration.setreg','C3510644_Collider_CollisionGroups.setreg', 'AutomatedTesting/Registry')
+ def test_C3510644_Collider_CollisionGroups(self, request, workspace, editor, launcher_platform):
+ from . import C3510644_Collider_CollisionGroups as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C4982798_Collider_ColliderRotationOffset(self, request, workspace, editor, launcher_platform):
+ from . import C4982798_Collider_ColliderRotationOffset as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C15308217_NoCrash_LevelSwitch(self, request, workspace, editor, launcher_platform):
+ from . import C15308217_NoCrash_LevelSwitch as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C6090547_ForceRegion_ParentChildForceRegions(self, request, workspace, editor, launcher_platform):
+ from . import C6090547_ForceRegion_ParentChildForceRegions as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C19578021_ShapeCollider_CanBeAdded(self, request, workspace, editor, launcher_platform):
+ from . import C19578021_ShapeCollider_CanBeAdded as test_module
+ self._run_test(request, workspace, editor, test_module)
+
+ @revert_physics_config
+ def test_C15425929_Undo_Redo(self, request, workspace, editor, launcher_platform):
+ from . import C15425929_Undo_Redo as test_module
+ self._run_test(request, workspace, editor, test_module)
diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py
index 39bc4c8188..e829726ba9 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Sandbox.py
@@ -1,49 +1,49 @@
-"""
-All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-its licensors.
-
-For complete copyright and license terms please see the LICENSE at the root of this
-distribution (the "License"). All use of this software is governed by the License,
-or, if provided, by the license below or the license accompanying this file. Do not
-remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
-"""
-
-# This suite consists of all test cases that are passing and have been verified.
-
-import pytest
-import os
-import sys
-
-from .FileManagement import FileManagement as fm
-from ly_test_tools import LAUNCHERS
-
-sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
-
-from base import TestAutomationBase
-
-
-revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
-
-
-@pytest.mark.SUITE_sandbox
-@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
-@pytest.mark.parametrize("project", ["AutomatedTesting"])
-class TestAutomation(TestAutomationBase):
-
- ## Seems to be flaky, need to investigate
- def test_C19536274_GetCollisionName_PrintsName(self, request, workspace, editor, launcher_platform):
- from . import C19536274_GetCollisionName_PrintsName as test_module
- # Fixme: expected_lines=["Layer Name: Right"]
- self._run_test(request, workspace, editor, test_module)
-
- ## Seems to be flaky, need to investigate
- def test_C19536277_GetCollisionName_PrintsNothing(self, request, workspace, editor, launcher_platform):
- from . import C19536277_GetCollisionName_PrintsNothing as test_module
- # All groups present in the PhysX Collider that could show up in test
- # Fixme: collision_groups = ["All", "None", "All_NoTouchBend", "All_3", "None_1", "All_NoTouchBend_1", "All_2", "None_1_1", "All_NoTouchBend_1_1", "All_1", "None_1_1_1", "All_NoTouchBend_1_1_1", "All_4", "None_1_1_1_1", "All_NoTouchBend_1_1_1_1", "GroupLeft", "GroupRight"]
- # Fixme: for group in collision_groups:
- # Fixme: unexpected_lines.append(f"GroupName: {group}")
- # Fixme: expected_lines=["GroupName: "]
- self._run_test(request, workspace, editor, test_module)
\ No newline at end of file
+"""
+All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+its licensors.
+
+For complete copyright and license terms please see the LICENSE at the root of this
+distribution (the "License"). All use of this software is governed by the License,
+or, if provided, by the license below or the license accompanying this file. Do not
+remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+"""
+
+# This suite consists of all test cases that are passing and have been verified.
+
+import pytest
+import os
+import sys
+
+from .FileManagement import FileManagement as fm
+from ly_test_tools import LAUNCHERS
+
+sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
+
+from base import TestAutomationBase
+
+
+revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
+
+
+@pytest.mark.SUITE_sandbox
+@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
+@pytest.mark.parametrize("project", ["AutomatedTesting"])
+class TestAutomation(TestAutomationBase):
+
+ ## Seems to be flaky, need to investigate
+ def test_C19536274_GetCollisionName_PrintsName(self, request, workspace, editor, launcher_platform):
+ from . import C19536274_GetCollisionName_PrintsName as test_module
+ # Fixme: expected_lines=["Layer Name: Right"]
+ self._run_test(request, workspace, editor, test_module)
+
+ ## Seems to be flaky, need to investigate
+ def test_C19536277_GetCollisionName_PrintsNothing(self, request, workspace, editor, launcher_platform):
+ from . import C19536277_GetCollisionName_PrintsNothing as test_module
+ # All groups present in the PhysX Collider that could show up in test
+ # Fixme: collision_groups = ["All", "None", "All_NoTouchBend", "All_3", "None_1", "All_NoTouchBend_1", "All_2", "None_1_1", "All_NoTouchBend_1_1", "All_1", "None_1_1_1", "All_NoTouchBend_1_1_1", "All_4", "None_1_1_1_1", "All_NoTouchBend_1_1_1_1", "GroupLeft", "GroupRight"]
+ # Fixme: for group in collision_groups:
+ # Fixme: unexpected_lines.append(f"GroupName: {group}")
+ # Fixme: expected_lines=["GroupName: "]
+ self._run_test(request, workspace, editor, test_module)
diff --git a/AutomatedTesting/Levels/Physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.ly b/AutomatedTesting/Levels/Physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.ly
index ba141251d5..d618bf1873 100644
--- a/AutomatedTesting/Levels/Physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.ly
+++ b/AutomatedTesting/Levels/Physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.ly
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:231d5ac32c95334eeb1cbf77ea0bceae1d8010de3290dfdbd991abb46d18bae6
-size 6844
+oid sha256:83af66a6db4ff2b4df7212099b661a96668cfb326d8984e41b16506ec0062141
+size 5844
diff --git a/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi b/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi
deleted file mode 100644
index ac1d663bb8..0000000000
--- a/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-
-#pragma once
-
-// Please read README.md for an explanation on why scenesrg.srgi and viewsrg.srgi are
-// located in this folder (And how you can optionally customize your own scenesrg.srgi
-// and viewsrg.srgi in your game project).
-
-#include
-
-partial ShaderResourceGroup RayTracingSceneSrg : SRG_RayTracingScene
-{
-/* Intentionally Empty. Helps define the SrgSemantic for RayTracingSceneSrg once.*/
-};
-
-#define AZ_COLLECTING_PARTIAL_SRGS
-#include
-#undef AZ_COLLECTING_PARTIAL_SRGS
diff --git a/Code/CryEngine/CryCommon/CryEngineDecalInfo.h b/Code/CryEngine/CryCommon/CryEngineDecalInfo.h
deleted file mode 100644
index f38533e341..0000000000
--- a/Code/CryEngine/CryCommon/CryEngineDecalInfo.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-// Description : declaration of struct CryEngineDecalInfo.
-
-// Note:
-// 3D Engine and Character Animation subsystems (as well as perhaps
-// some others) transfer data about the decals that need to be spawned
-// via this structure. This is to avoid passing many parameters through
-// each function call, and to save on copying these parameters when just
-// simply passing the structure from one function to another.
-
-#ifndef CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
-#define CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
-#pragma once
-
-#include "Cry_Math.h"
-
-// Summary:
-// Structure containing common parameters that describe a decal
-
-struct SDecalOwnerInfo
-{
- SDecalOwnerInfo() { memset(this, 0, sizeof(*this)); nRenderNodeSlotId = nRenderNodeSlotSubObjectId = -1; }
- struct IStatObj* GetOwner(Matrix34A& objMat);
-
- struct IRenderNode* pRenderNode; // Owner (decal will be attached to or wrapped around of this object)
- PodArray* pDecalReceivers;
- int nRenderNodeSlotId; // is set internally by 3dengine
- int nRenderNodeSlotSubObjectId; // is set internally by 3dengine
- int nMatID;
-};
-
-struct CryEngineDecalInfo
-{
- SDecalOwnerInfo ownerInfo;
- Vec3 vPos; // Decal position (world coordinates)
- Vec3 vNormal; // Decal/face normal
- float fSize; // Decal size
- float fLifeTime; // Decal life time (in seconds)
- float fAngle; // Angle of rotation
- struct IStatObj* pIStatObj; // Decal geometry
- Vec3 vHitDirection; // Direction from weapon/player position to decal position (bullet direction)
- float fGrowTime, fGrowTimeAlpha;// Used for blood pools
- unsigned int nGroupId; // Used for multi-component decals
- bool bSkipOverlappingTest; // Always spawn decals even if there are a lot of other decals in same place
- bool bAssemble; // Assemble to bigger decals if more than 1 decal is on the same place
- bool bForceEdge; // force the decal to the nearest edge of the owner mesh and project it accordingly
- bool bForceSingleOwner; // Do not attempt to cast the decal into the environment even if it's large enough
- bool bDeferred;
- uint8 sortPrio;
- char szMaterialName[_MAX_PATH]; // name of material used for rendering the decal (in favor of szTextureName/nTid and the default decal shader)
- bool preventDecalOnGround; // mainly for decal placement support
- const Matrix33* pExplicitRightUpFront; // mainly for decal placement support
-
- void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const{}
-
- // the constructor fills in some non-obligatory fields; the other fields must be filled in by the client
- CryEngineDecalInfo ()
- {
- memset(this, 0, sizeof(*this));
- ownerInfo.nRenderNodeSlotId = ownerInfo.nRenderNodeSlotSubObjectId = -1;
- sortPrio = 255;
- }
-};
-
-#endif // CRYINCLUDE_CRYCOMMON_CRYENGINEDECALINFO_H
diff --git a/Code/CryEngine/CryCommon/Gem.h b/Code/CryEngine/CryCommon/Gem.h
deleted file mode 100644
index 3097fcf304..0000000000
--- a/Code/CryEngine/CryCommon/Gem.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-#pragma once
-
-#include
-
-#if defined(AZ_RESTRICTED_PLATFORM)
- #include AZ_RESTRICTED_FILE(Gem_h)
-#endif
-
-#if defined(LINUX) || defined(APPLE) || defined(ANDROID)
- #define OPENGL 1
-#endif
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include <3dEngine.h>
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include
diff --git a/Code/CryEngine/CryCommon/I3DEngine.h b/Code/CryEngine/CryCommon/I3DEngine.h
deleted file mode 100644
index 883b0a6d3b..0000000000
--- a/Code/CryEngine/CryCommon/I3DEngine.h
+++ /dev/null
@@ -1,3021 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-// Description : 3dengine interface
-
-#ifndef CRYINCLUDE_CRYCOMMON_I3DENGINE_H
-#define CRYINCLUDE_CRYCOMMON_I3DENGINE_H
-#pragma once
-
-// The maximum number of unique surface types that can be used per node
-#define MMRM_MAX_SURFACE_TYPES 16
-#define COMPILED_OCTREE_FILE_NAME "terrain/terrain.dat"
-
-// !!! Do not add any headers here !!!
-#include "CryEngineDecalInfo.h"
-#include
-#include // <> required for Interfuscator
-#include "IRenderer.h"
-#include // <> required for Interfuscator
-#include // <> required for Interfuscator
-#include // <> required for Interfuscator
-#include // <> required for Interfuscator
-#include "CryArray.h"
-#include // <> required for Interfuscator
-#include
-// !!! Do not add any headers here !!!
-
-class IOpticsManager;
-class CContentCGF;
-class ICrySizer;
-class CRenderView;
-struct ISystem;
-struct CVars;
-struct pe_params_particle;
-struct IMaterial;
-struct SpawnParams;
-struct ForceObject;
-struct IRenderNode;
-struct IObjManager;
-struct IDeferredPhysicsEventManager;
-struct IBSPTree3D;
-struct ITextureLoadHandler;
-struct ITimeOfDay;
-struct MacroTextureConfiguration;
-
-namespace LegacyProceduralVegetation
-{
- class IVegetationPoolManager;
-}
-
-namespace LegacyTerrain
-{
- struct MacroTextureConfiguration;
-}
-
-namespace ChunkFile
-{
- struct IChunkFileWriter;
-}
-
-namespace AZ
-{
- class Aabb;
-}
-
-enum E3DEngineParameter
-{
- E3DPARAM_SUN_COLOR,
-
- E3DPARAM_SUN_SPECULAR_MULTIPLIER,
-
- E3DPARAM_AMBIENT_GROUND_COLOR,
- E3DPARAM_AMBIENT_MIN_HEIGHT,
- E3DPARAM_AMBIENT_MAX_HEIGHT,
-
- E3DPARAM_FOG_COLOR,
- E3DPARAM_FOG_COLOR2,
- E3DPARAM_FOG_RADIAL_COLOR,
-
- E3DPARAM_VOLFOG_HEIGHT_DENSITY,
- E3DPARAM_VOLFOG_HEIGHT_DENSITY2,
-
- E3DPARAM_VOLFOG_GRADIENT_CTRL,
-
- E3DPARAM_VOLFOG_GLOBAL_DENSITY,
- E3DPARAM_VOLFOG_RAMP,
-
- E3DPARAM_VOLFOG_SHADOW_RANGE,
- E3DPARAM_VOLFOG_SHADOW_DARKENING,
- E3DPARAM_VOLFOG_SHADOW_ENABLE,
-
- E3DPARAM_VOLFOG2_CTRL_PARAMS,
- E3DPARAM_VOLFOG2_SCATTERING_PARAMS,
- E3DPARAM_VOLFOG2_RAMP,
- E3DPARAM_VOLFOG2_COLOR,
- E3DPARAM_VOLFOG2_GLOBAL_DENSITY,
- E3DPARAM_VOLFOG2_HEIGHT_DENSITY,
- E3DPARAM_VOLFOG2_HEIGHT_DENSITY2,
- E3DPARAM_VOLFOG2_COLOR1,
- E3DPARAM_VOLFOG2_COLOR2,
-
- E3DPARAM_SKYLIGHT_SUN_INTENSITY,
-
- E3DPARAM_SKYLIGHT_KM,
- E3DPARAM_SKYLIGHT_KR,
- E3DPARAM_SKYLIGHT_G,
-
- E3DPARAM_SKYLIGHT_WAVELENGTH_R,
- E3DPARAM_SKYLIGHT_WAVELENGTH_G,
- E3DPARAM_SKYLIGHT_WAVELENGTH_B,
-
- E3DPARAM_NIGHSKY_HORIZON_COLOR,
- E3DPARAM_NIGHSKY_ZENITH_COLOR,
- E3DPARAM_NIGHSKY_ZENITH_SHIFT,
-
- E3DPARAM_NIGHSKY_STAR_INTENSITY,
-
- E3DPARAM_NIGHSKY_MOON_DIRECTION,
- E3DPARAM_NIGHSKY_MOON_COLOR,
- E3DPARAM_NIGHSKY_MOON_SIZE,
- E3DPARAM_NIGHSKY_MOON_INNERCORONA_COLOR,
- E3DPARAM_NIGHSKY_MOON_INNERCORONA_SCALE,
- E3DPARAM_NIGHSKY_MOON_OUTERCORONA_COLOR,
- E3DPARAM_NIGHSKY_MOON_OUTERCORONA_SCALE,
-
- E3DPARAM_CLOUDSHADING_MULTIPLIERS,
- E3DPARAM_CLOUDSHADING_SUNCOLOR,
- E3DPARAM_CLOUDSHADING_SKYCOLOR,
-
- E3DPARAM_CORONA_SIZE,
-
- E3DPARAM_OCEANFOG_COLOR,
- E3DPARAM_OCEANFOG_DENSITY,
-
- // Sky highlight (ex. From Lightning)
- E3DPARAM_SKY_HIGHLIGHT_COLOR,
- E3DPARAM_SKY_HIGHLIGHT_SIZE,
- E3DPARAM_SKY_HIGHLIGHT_POS,
-
- E3DPARAM_SKY_MOONROTATION,
-
- E3DPARAM_SKY_SKYBOX_ANGLE,
- E3DPARAM_SKY_SKYBOX_STRETCHING,
-
- EPARAM_SUN_SHAFTS_VISIBILITY,
-
- E3DPARAM_SKYBOX_MULTIPLIER,
-
- E3DPARAM_DAY_NIGHT_INDICATOR,
-
- // Tone mapping tweakables
- E3DPARAM_HDR_FILMCURVE_SHOULDER_SCALE,
- E3DPARAM_HDR_FILMCURVE_LINEAR_SCALE,
- E3DPARAM_HDR_FILMCURVE_TOE_SCALE,
- E3DPARAM_HDR_FILMCURVE_WHITEPOINT,
-
- E3DPARAM_HDR_EYEADAPTATION_PARAMS,
- E3DPARAM_HDR_EYEADAPTATION_PARAMS_LEGACY,
- E3DPARAM_HDR_BLOOM_AMOUNT,
-
- E3DPARAM_HDR_COLORGRADING_COLOR_SATURATION,
- E3DPARAM_HDR_COLORGRADING_COLOR_BALANCE,
-
- E3DPARAM_COLORGRADING_FILTERS_PHOTOFILTER_COLOR,
- E3DPARAM_COLORGRADING_FILTERS_PHOTOFILTER_DENSITY,
- E3DPARAM_COLORGRADING_FILTERS_GRAIN
-};
-
-enum EShadowMode
-{
- ESM_NORMAL = 0,
- ESM_HIGHQUALITY
-};
-
-struct IBSPTree3D
-{
- typedef DynArray CFace;
- typedef DynArray FaceList;
-
- virtual ~IBSPTree3D() {}
- virtual bool IsInside(const Vec3& vPos) const = 0;
- virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
-
- virtual size_t WriteToBuffer(void* pBuffer) const = 0;
- virtual void ReadFromBuffer(const void* pBuffer) = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Description:
-// This structure is filled and passed by the caller to the DebugDraw functions of the stat object or entity.
-struct SGeometryDebugDrawInfo
-{
- Matrix34 tm; // Transformation Matrix
- ColorB color; // Optional color of the lines.
- ColorB lineColor; // Optional color of the lines.
-
- // Optional flags controlling how to render debug draw information.
- uint32 bNoCull : 1;
- uint32 bNoLines : 1;
- uint32 bExtrude : 1; // Extrude debug draw geometry alittle bit so it is over real geometry.
-
- SGeometryDebugDrawInfo()
- : color(255, 0, 255, 255)
- , lineColor(255, 255, 0, 255)
- , bNoLines(0)
- , bNoCull(0) { tm.SetIdentity(); }
-};
-
-struct SFrameLodInfo
-{
- uint32 nID;
- float fLodRatio;
- float fTargetSize;
- uint nMinLod;
- uint nMaxLod;
-
- SFrameLodInfo()
- {
- nID = 0;
- fLodRatio = 0.f;
- fTargetSize = 0.f;
- nMinLod = 0;
- nMaxLod = 6;
- }
-};
-struct SMeshLodInfo
-{
- static const int s_nMaxLodCount = 5;
- float fGeometricMean;
- uint nFaceCount;
- uint32 nFrameLodID;
- SMeshLodInfo()
- {
- Clear();
- }
- void Clear()
- {
- fGeometricMean = 0.f;
- nFaceCount = 0;
- nFrameLodID = 0;
- }
- void Merge(const SMeshLodInfo& lodInfo)
- {
- uint nTotalCount = nFaceCount + lodInfo.nFaceCount;
- if (nTotalCount > 0)
- {
- float fGeometricMeanTotal = 0.f;
- if (fGeometricMean > 0.f)
- {
- fGeometricMeanTotal += logf(fGeometricMean) * nFaceCount;
- }
- if (lodInfo.fGeometricMean > 0.f)
- {
- fGeometricMeanTotal += logf(lodInfo.fGeometricMean) * lodInfo.nFaceCount;
- }
- fGeometricMean = expf(fGeometricMeanTotal / (float)nTotalCount);
- nFaceCount = nTotalCount;
- }
- }
-};
-// Summary:
-// Physics material enumerator, allows for 3dengine to get material id from game code.
-struct IPhysMaterialEnumerator
-{
- //
- virtual ~IPhysMaterialEnumerator(){}
- virtual int EnumPhysMaterial(const char* szPhysMatName) = 0;
- virtual bool IsCollidable(int nMatId) = 0;
- virtual int GetMaterialCount() = 0;
- virtual const char* GetMaterialNameByIndex(int index) = 0;
- //
-};
-
-
-// Summary:
-// Physics foreign data flags.
-enum EPhysForeignFlags
-{
- PFF_HIDABLE = 0x1,
- PFF_HIDABLE_SECONDARY = 0x2,
- PFF_EXCLUDE_FROM_STATIC = 0x4,
- PFF_UNIMPORTANT = 0x20,
- PFF_OUTDOOR_AREA = 0x40,
- PFF_MOVING_PLATFORM = 0x80,
-};
-
-// Summary:
-// Ocean data flags.
-enum EOceanRenderFlags
-{
- OCR_NO_DRAW = 1 << 0,
- OCR_OCEANVOLUME_VISIBLE = 1 << 1,
-};
-
-// Summary:
-// Structure to pass vegetation group properties.
-struct IStatInstGroup
-{
- enum EPlayerHideable
- {
- ePlayerHideable_None = 0,
- ePlayerHideable_High,
- ePlayerHideable_Mid,
- ePlayerHideable_Low,
-
- ePlayerHideable_COUNT,
- };
-
- IStatInstGroup()
- {
- pStatObj = 0;
- szFileName[0] = 0;
- bHideability = 0;
- bHideabilitySecondary = 0;
- fBending = 0;
- nCastShadowMinSpec = 0;
- bRecvShadow = 0;
- bDynamicDistanceShadows = false;
- bUseAlphaBlending = 0;
- fSpriteDistRatio = 1.f;
- fShadowDistRatio = 1.f;
- fMaxViewDistRatio = 1.f;
- fLodDistRatio = 1.f;
- fBrightness = 1.f;
- pMaterial = 0;
-
- fDensity = 1;
- fElevationMax = 4096;
- fElevationMin = 8;
- fSize = 1;
- fSizeVar = 0;
- fSlopeMax = 255;
- fSlopeMin = 0;
- fStiffness = 0.5f;
- fDamping = 2.5f;
- fVariance = 0.6f;
- fAirResistance = 1.f;
- bRandomRotation = false;
- nRotationRangeToTerrainNormal = 0;
- nMaterialLayers = 0;
- bAllowIndoor = false;
- fAlignToTerrainCoefficient = 0.f;
- bAutoMerged = false;
- minConfigSpec = (ESystemConfigSpec)0;
- nTexturesAreStreamedIn = 0;
- nPlayerHideable = ePlayerHideable_None;
- nID = -1;
- }
-
- IStatObj* GetStatObj()
- {
- IStatObj* p = pStatObj;
- return (IStatObj*)p;
- }
- const IStatObj* GetStatObj() const
- {
- const IStatObj* p = pStatObj;
- return (const IStatObj*)p;
- }
-
- _smart_ptr pStatObj;
- char szFileName[256];
- bool bHideability;
- bool bHideabilitySecondary;
- float fBending;
- uint8 nCastShadowMinSpec;
- bool bRecvShadow;
- bool bDynamicDistanceShadows;
- bool bUseAlphaBlending;
- float fSpriteDistRatio;
- float fLodDistRatio;
- float fShadowDistRatio;
- float fMaxViewDistRatio;
- float fBrightness;
- bool bRandomRotation;
- int32 nRotationRangeToTerrainNormal;
- float fAlignToTerrainCoefficient;
- bool bAllowIndoor;
- bool bAutoMerged;
-
- float fDensity;
- float fElevationMax;
- float fElevationMin;
- float fSize;
- float fSizeVar;
- float fSlopeMax;
- float fSlopeMin;
- float fStiffness;
- float fDamping;
- float fVariance;
- float fAirResistance;
-
- float fVegRadius;
- float fVegRadiusVert;
- float fVegRadiusHor;
-
- int nPlayerHideable;
- int nID;
-
- // Minimal configuration spec for this vegetation group.
- ESystemConfigSpec minConfigSpec;
-
- // Override material for this instance group.
- _smart_ptr pMaterial;
-
- // Material layers bitmask -> which layers are active.
- uint8 nMaterialLayers;
-
- // Textures Are Streamed In.
- uint8 nTexturesAreStreamedIn;
-
- // Flags similar to entity render flags.
- int m_dwRndFlags;
-};
-
-// Description:
-// Water volumes should usually be created by I3DEngine::CreateWaterVolume.
-// Summary:
-// Interface to water volumes.
-struct IWaterVolume
-{
- //
- //DOC-IGNORE-BEGIN
- virtual ~IWaterVolume(){}
- virtual void UpdatePoints(const Vec3* pPoints, int nCount, float fHeight) = 0;
- virtual void SetFlowSpeed(float fSpeed) = 0;
- virtual void SetAffectToVolFog(bool bAffectToVolFog) = 0;
- virtual void SetTriSizeLimits(float fTriMinSize, float fTriMaxSize) = 0;
- // virtual void SetMaterial(const char * szShaderName) = 0;
- virtual void SetMaterial(_smart_ptr pMaterial) = 0;
- virtual _smart_ptr GetMaterial() = 0;
- virtual const char* GetName() const = 0;
- virtual void SetName(const char* szName) = 0;
- //DOC-IGNORE-END
-
- // Description:
- // Used to change the water level. Will assign a new Z value to all
- // vertices of the water geometry.
- // Arguments:
- // vNewOffset - Position of the new water level
- // Summary:
- // Sets a new water level.
- virtual void SetPositionOffset(const Vec3& vNewOffset) = 0;
- //
-};
-
-struct SClipVolumeBlendInfo
-{
- static const int BlendPlaneCount = 2;
-
- Plane_tpl blendPlanes[BlendPlaneCount];
- struct IClipVolume* blendVolumes[BlendPlaneCount];
-};
-
-struct IClipVolume
-{
- enum EClipVolumeFlags
- {
- eClipVolumeConnectedToOutdoor = BIT(0),
- eClipVolumeIgnoreGI = BIT(1),
- eClipVolumeAffectedBySun = BIT(2),
- eClipVolumeBlend = BIT(3),
- eClipVolumeIsVisArea = BIT(4),
- eClipVolumeIgnoreOutdoorAO = BIT(5),
- };
-
- virtual ~IClipVolume() {};
- virtual void GetClipVolumeMesh(_smart_ptr& renderMesh, Matrix34& worldTM) const = 0;
- virtual AABB GetClipVolumeBBox() const = 0;
- virtual bool IsPointInsideClipVolume(const Vec3& point) const = 0;
-
- virtual uint8 GetStencilRef() const = 0;
- virtual uint GetClipVolumeFlags() const = 0;
-};
-
-// Summary:
-// Provides information about the different VisArea volumes.
-struct IVisArea
- : public IClipVolume
-{
- //
- virtual ~IVisArea(){}
- // Summary:
- // Gets the last rendered frame id.
- // Return Value:
- // An int which contains the frame id.
- virtual int GetVisFrameId() = 0;
-
- // Description:
- // Gets a list of all the VisAreas which are connected to the current one.
- // Arguments:
- // pAreas - Pointer to an array of IVisArea*
- // nMaxConnNum - The maximum of IVisArea to write in pAreas
- // bSkipDisabledPortals - Ignore portals which are disabled
- // Return Value:
- // An integer which hold the amount of VisArea found to be connected. If
- // the return is equal to nMaxConnNum, it's possible that not all
- // connected VisAreas were returned due to the restriction imposed by the
- // argument.
- // Summary:
- // Gets all the areas which are connected to the current one.
- virtual int GetVisAreaConnections(IVisArea** pAreas, int nMaxConnNum, bool bSkipDisabledPortals = false) = 0;
-
- // Summary:
- // Determines if it's connected to an outdoor area.
- // Return Value:
- // True if the VisArea is connected to an outdoor area.
- virtual bool IsConnectedToOutdoor() const = 0;
-
- // Summary:
- // Determines if the visarea ignores Global Illumination inside.
- // Return Value:
- // True if the VisArea ignores Global Illumination inside.
- virtual bool IsIgnoringGI() const = 0;
-
- // Summary:
- // Determines if the visarea ignores Outdoor Ambient occlusion inside.
- // Return Value:
- // True if the VisArea ignores Outdoor Ambient Occlusion inside.
- virtual bool IsIgnoringOutdoorAO() const = 0;
-
- // Summary:
- // Gets the name.
- // Notes:
- // The name is always returned in lower case.
- // Return Value:
- // A null terminated char array containing the name of the VisArea.
- virtual const char* GetName() = 0;
-
- // Summary:
- // Determines if this VisArea is a portal.
- // Return Value:
- // True if the VisArea is a portal, or false in the opposite case.
- virtual bool IsPortal() const = 0;
-
- // Description:
- // Searches for a specified VisArea to see if it's connected to the current
- // VisArea.
- // Arguments:
- // pAnotherArea - A specified VisArea to find
- // nMaxRecursion - The maximum number of recursion to do while searching
- // bSkipDisabledPortals - Will avoid searching disabled VisAreas
- // pVisitedAreas - if not NULL - will get list of all visited areas
- // Return Value:
- // True if the VisArea was found.
- // Summary:
- // Searches for a specified VisArea.
- virtual bool FindVisArea(IVisArea* pAnotherArea, int nMaxRecursion, bool bSkipDisabledPortals) = 0;
-
- // Description:
- // Searches for the surrounding VisAreas which connected to the current
- // VisArea.
- // Arguments:
- // nMaxRecursion - The maximum number of recursion to do while searching
- // bSkipDisabledPortals - Will avoid searching disabled VisAreas
- // pVisitedAreas - if not NULL - will get list of all visited areas
- // Return Value:
- // None.
- // Summary:
- // Searches for the surrounding VisAreas.
- virtual void FindSurroundingVisArea(int nMaxRecursion, bool bSkipDisabledPortals, PodArray* pVisitedAreas = NULL, int nMaxVisitedAreas = 0, int nDeepness = 0) = 0;
-
- // Summary:
- // Determines if it's affected by outdoor lighting.
- // Return Value:
- // Returns true if the VisArea if it's affected by outdoor lighting, else
- // false will be returned.
- virtual bool IsAffectedByOutLights() const = 0;
-
- // Summary:
- // Determines if the spere can be affect the VisArea.
- // Return Value:
- // Returns true if the VisArea can be affected by the sphere, else
- // false will be returned.
- virtual bool IsSphereInsideVisArea(const Vec3& vPos, const f32 fRadius) = 0;
-
- // Summary:
- // Clips geometry inside or outside a vis area.
- // Return Value:
- // Whether geom was clipped.
- virtual bool ClipToVisArea(bool bInside, Sphere& sphere, Vec3 const& vNormal) = 0;
-
- // Summary:
- // Gives back the axis aligned bounding box of VisArea.
- // Return Value:
- // Returns the pointer of a AABB.
- virtual const AABB* GetAABBox() const = 0;
-
- // Summary:
- // Gives back the axis aligned bounding box of all static objects in the VisArea.
- // This AABB can be huger than the ViaArea AABB as some objects might not be completely inside the VisArea.
- // Return Value:
- // Returns the pointer to the AABB.
- virtual const AABB* GetStaticObjectAABBox() const = 0;
-
- // Summary:
- // Determines if the point can be affect the VisArea.
- // Return Value:
- // Returns true if the VisArea can be affected by the point, else
- // false will be returned.
- virtual bool IsPointInsideVisArea(const Vec3& vPos) const = 0;
-
- virtual void GetShapePoints(const Vec3*& pPoints, size_t& nPoints) = 0;
- virtual float GetHeight() = 0;
- //
-};
-
-#include "OceanConstants.h"
-
-// float m_SortId : offseted by +WATER_LEVEL_SORTID_OFFSET if the camera object line is crossing the water surface
-// : otherwise offseted by -WATER_LEVEL_SORTID_OFFSET
-#define WATER_LEVEL_SORTID_OFFSET 10000000
-
-#define DEFAULT_SID 0
-
-// Summary:
-// indirect lighting quadtree definition.
-namespace NQT
-{
- // Forward declaration
- template
- class CQuadTree;
-}
-
-#define FILEVERSION_TERRAIN_SHLIGHTING_FILE 5
-
-enum EVoxelBrushShape
-{
- evbsSphere = 1,
- evbsBox,
-};
-
-enum EVoxelEditTarget
-{
- evetVoxelObjects = 1,
-};
-
-enum EVoxelEditOperation
-{
- eveoNone = 0,
- eveoPaintHeightPos,
- eveoPaintHeightNeg,
- eveoCreate,
- eveoSubstract,
- eveoMaterial,
- eveoBaseColor,
- eveoBlurPos,
- eveoBlurNeg,
- eveoCopyTerrainPos,
- eveoCopyTerrainNeg,
- eveoPickHeight,
- eveoIntegrateMeshPos,
- eveoIntegrateMeshNeg,
- eveoForceDepth,
- eveoLimitLod,
- eveoLast,
-};
-
-#define COMPILED_VISAREA_MAP_FILE_NAME "terrain\\indoor.dat"
-#define COMPILED_MERGED_MESHES_BASE_NAME "terrain\\merged_meshes_sectors\\"
-#define COMPILED_MERGED_MESHES_LIST "mmrm_used_meshes.lst"
-#define LEVEL_INFO_FILE_NAME "levelinfo.xml"
-
-//////////////////////////////////////////////////////////////////////////
-
-#pragma pack(push,4)
-
-#define VISAREAMANAGER_CHUNK_VERSION 6
-
-#define SERIALIZATION_FLAG_BIG_ENDIAN 1
-#define SERIALIZATION_FLAG_SECTOR_PALETTES 2
-
-#define TCH_FLAG2_AREA_ACTIVATION_IN_USE 1
-
-struct SVisAreaManChunkHeader
-{
- int8 nVersion;
- int8 nDummy;
- int8 nFlags;
- int8 nFlags2;
- int nChunkSize;
- int nVisAreasNum;
- int nPortalsNum;
- int nOcclAreasNum;
-
- AUTO_STRUCT_INFO
-};
-
-struct SOcTreeNodeChunk
-{
- int16 nChunkVersion;
- int16 ucChildsMask;
- AABB nodeBox;
- int32 nObjectsBlockSize;
-
- AUTO_STRUCT_INFO
-};
-
-struct SHotUpdateInfo
-{
- SHotUpdateInfo()
- {
- nHeigtmap = 1;
- nObjTypeMask = ~0;
- pVisibleLayerMask = NULL;
- pLayerIdTranslation = NULL;
- areaBox.Reset();
- }
-
- uint32 nHeigtmap;
- uint32 nObjTypeMask;
- const uint8* pVisibleLayerMask;
- const uint16* pLayerIdTranslation;
- AABB areaBox;
-
- AUTO_STRUCT_INFO
-};
-
-#define OCTREE_CHUNK_VERSION 29
-
-//==============================================================================================
-
-// Summary:
-// Common header for binary files used by 3dengine
-struct SCommonFileHeader
-{
- char signature[4]; // File signature, should be "CRY "
- uint8 file_type; // File type
- uint8 flags; // File common flags
- uint16 version; // File version
-
- AUTO_STRUCT_INFO
-};
-
-struct IVisAreaCallback
-{
- //
- virtual ~IVisAreaCallback(){}
- virtual void OnVisAreaDeleted(IVisArea* pVisArea) = 0;
- //
-};
-
-struct IVisAreaManager
-{
- //
- virtual ~IVisAreaManager(){}
- // Summary:
- // Loads data into VisAreaManager engine from memory block.
- virtual bool SetCompiledData(uint8* pData, int nDataSize, std::vector** ppStatObjTable, std::vector<_smart_ptr >** ppMatTable, bool bHotUpdate, SHotUpdateInfo* pExportInfo) = 0;
-
- // Summary:
- // Saves data from VisAreaManager engine into memory block.
- virtual bool GetCompiledData(uint8* pData, int nDataSize, std::vector** ppStatObjTable, std::vector<_smart_ptr >** ppMatTable, std::vector** ppStatInstGroupTable, EEndian eEndian, SHotUpdateInfo* pExportInfo = NULL) = 0;
-
- // Summary:
- // Returns VisAreaManager data memory block size.
- virtual int GetCompiledDataSize(SHotUpdateInfo* pExportInfo = NULL) = 0;
-
- // Summary:
- // Returns the accumulated number of visareas and portals.
- virtual int GetNumberOfVisArea() const = 0;
-
- // Summary:
- // Returns the visarea interface based on the id (0..GetNumberOfVisArea()) it can be a visarea or a portal.
- virtual IVisArea* GetVisAreaById(int nID) const = 0;
-
- virtual void AddListener(IVisAreaCallback* pListener) = 0;
- virtual void RemoveListener(IVisAreaCallback* pListener) = 0;
-
- virtual void PrepareSegmentData(const AABB& box) = 0;
- virtual void ReleaseInactiveSegments() = 0;
- virtual bool CreateSegment(int nSID) = 0;
- virtual bool DeleteSegment(int nSID, bool bDeleteNow) = 0;
- virtual bool StreamCompiledData(uint8* pData, int nDataSize, int nSID, std::vector* pStatObjTable, std::vector<_smart_ptr >* pMatTable, std::vector* pStatInstGroupTable, const Vec2& vIndexOffset) = 0;
- virtual void OffsetPosition(const Vec3& delta) = 0;
- virtual void UpdateConnections() = 0;
- // Summary:
- // Clones all vis areas in a region of the level, offsetting and rotating them based
- // on the values passed in.
- // Arguments:
- // offset - Offset amount, relative to the center of the region passed in.
- // zRotation - Rotation around the z axis, in radians.
- virtual void CloneRegion(const AABB& region, const Vec3& offset, float zRotation) = 0;
-
- // Summary:
- // Removes all vis areas in a region of the level.
- virtual void ClearRegion(const AABB& region) = 0;
-
- virtual void GetObjectsByType(PodArray& lstObjects, EERType objType, const AABB* pBBox, ObjectTreeQueryFilterCallback filterCallback = nullptr) = 0;
- virtual void GetObjectsByFlags(uint dwFlags, PodArray& lstObjects) = 0;
-
- virtual void GetObjects(PodArray& lstObjects, const AABB* pBBox) = 0;
-
- virtual bool IsOutdoorAreasVisible() = 0;
-};
-
-struct SSkyLightRenderParams
-{
- static const int skyDomeTextureWidth = 64;
- static const int skyDomeTextureHeight = 32;
- static const int skyDomeTextureSize = 64 * 32;
-
- static const int skyDomeTextureWidthBy8 = 8;
- static const int skyDomeTextureWidthBy4Log = 4; // = log2(64/4)
- static const int skyDomeTextureHeightBy2Log = 4; // = log2(32/2)
-
- SSkyLightRenderParams()
- : m_pSkyDomeMesh(0)
- , m_pSkyDomeTextureDataMie(0)
- , m_pSkyDomeTextureDataRayleigh(0)
- , m_skyDomeTexturePitch(0)
- , m_skyDomeTextureTimeStamp(-1)
- , m_partialMieInScatteringConst(0.0f, 0.0f, 0.0f, 0.0f)
- , m_partialRayleighInScatteringConst(0.0f, 0.0f, 0.0f, 0.0f)
- , m_sunDirection(0.0f, 0.0f, 0.0f, 0.0f)
- , m_phaseFunctionConsts(0.0f, 0.0f, 0.0f, 0.0f)
- , m_hazeColor(0.0f, 0.0f, 0.0f, 0.0f)
- , m_hazeColorMieNoPremul(0.0f, 0.0f, 0.0f, 0.0f)
- , m_hazeColorRayleighNoPremul(0.0f, 0.0f, 0.0f, 0.0f)
- , m_skyColorTop(0.0f, 0.0f, 0.0f)
- , m_skyColorNorth(0.0f, 0.0f, 0.0f)
- , m_skyColorEast(0.0f, 0.0f, 0.0f)
- , m_skyColorSouth(0.0f, 0.0f, 0.0f)
- , m_skyColorWest(0.0f, 0.0f, 0.0f)
- {
- }
-
- // Sky dome mesh
- _smart_ptr m_pSkyDomeMesh;
-
- // temporarily add padding bytes to prevent fetching Vec4 constants below from wrong offset
- uint32 dummy0;
- uint32 dummy1;
-
- // Sky dome texture data
- const void* m_pSkyDomeTextureDataMie;
- const void* m_pSkyDomeTextureDataRayleigh;
- size_t m_skyDomeTexturePitch;
- int m_skyDomeTextureTimeStamp;
-
- int pad;//Enable 16 byte alignment for Vec4s
-
- // Sky dome shader constants
- Vec4 m_partialMieInScatteringConst;
- Vec4 m_partialRayleighInScatteringConst;
- Vec4 m_sunDirection;
- Vec4 m_phaseFunctionConsts;
- Vec4 m_hazeColor;
- Vec4 m_hazeColorMieNoPremul;
- Vec4 m_hazeColorRayleighNoPremul;
-
- // Sky hemisphere colors
- Vec3 m_skyColorTop;
- Vec3 m_skyColorNorth;
- Vec3 m_skyColorEast;
- Vec3 m_skyColorSouth;
- Vec3 m_skyColorWest;
-};
-
-struct SVisAreaInfo
-{
- float fHeight;
- Vec3 vAmbientColor;
- bool bAffectedByOutLights;
- bool bIgnoreSkyColor;
- bool bSkyOnly;
- float fViewDistRatio;
- bool bDoubleSide;
- bool bUseDeepness;
- bool bUseInIndoors;
- bool bOceanIsVisible;
- bool bIgnoreGI;
- bool bIgnoreOutdoorAO;
- float fPortalBlending;
-};
-
-struct SDebugFPSInfo
-{
- SDebugFPSInfo()
- : fAverageFPS(0.0f)
- , fMaxFPS(0.0f)
- , fMinFPS(0.0f)
- {
- }
- float fAverageFPS;
- float fMinFPS;
- float fMaxFPS;
-};
-
-struct SRainParams
-{
- SRainParams()
- : fAmount(0.f)
- , fCurrentAmount(0.f)
- , fRadius(0.f)
- , nUpdateFrameID(-1)
- , bIgnoreVisareas(false)
- , bDisableOcclusion(false)
- , matOccTrans(IDENTITY)
- , matOccTransRender(IDENTITY)
- , qRainRotation(IDENTITY)
- , areaAABB(AABB::RESET)
- , bApplySkyColor(false)
- , fSkyColorWeight(0.5f)
- {
- }
-
- Matrix44 matOccTrans; // Transformation matrix for rendering into a new occ map
- Matrix44 matOccTransRender; // Transformation matrix for rendering occluded rain using current occ map
- Quat qRainRotation; // Quaternion for the scene's rain entity rotation
- AABB areaAABB;
-
- Vec3 vWorldPos;
- Vec3 vColor;
-
- float fAmount;
- float fCurrentAmount;
- float fRadius;
-
- // Deferred rain params
- float fFakeGlossiness; // unused
- float fFakeReflectionAmount; // unused
- float fDiffuseDarkening;
- float fRainDropsAmount;
- float fRainDropsSpeed;
- float fRainDropsLighting;
- float fMistAmount;
- float fMistHeight;
- float fPuddlesAmount;
- float fPuddlesMaskAmount;
- float fPuddlesRippleAmount;
- float fSplashesAmount;
-
- int nUpdateFrameID;
-
- bool bApplyOcclusion;
- bool bIgnoreVisareas;
- bool bDisableOcclusion;
-
-// Summary:
-// Common scene rain parameters shared across engine and editor
- bool bApplySkyColor;
- float fSkyColorWeight;
-
- // Bus ID to listen to
-};
-
-struct SSnowParams
-{
- SSnowParams()
- : m_vWorldPos(0, 0, 0)
- , m_fRadius(0.0)
- , m_fSnowAmount(0.0)
- , m_fFrostAmount(0.0)
- , m_fSurfaceFreezing(0.0)
- , m_nSnowFlakeCount(0)
- , m_fSnowFlakeSize(0.0)
- , m_fSnowFallBrightness(0.0)
- , m_fSnowFallGravityScale(0.0)
- , m_fSnowFallWindScale(0.0)
- , m_fSnowFallTurbulence(0.0)
- , m_fSnowFallTurbulenceFreq(0.0)
- {
- }
-
- Vec3 m_vWorldPos;
- float m_fRadius;
-
- // Surface params.
- float m_fSnowAmount;
- float m_fFrostAmount;
- float m_fSurfaceFreezing;
-
-
- // Snowfall params.
- int m_nSnowFlakeCount;
- float m_fSnowFlakeSize;
- float m_fSnowFallBrightness;
- float m_fSnowFallGravityScale;
- float m_fSnowFallWindScale;
- float m_fSnowFallTurbulence;
- float m_fSnowFallTurbulenceFreq;
-};
-
-
-struct IScreenshotCallback
-{
- //
- virtual ~IScreenshotCallback(){}
- virtual void SendParameters(void* data, uint32 width, uint32 height, f32 minx, f32 miny, f32 maxx, f32 maxy) = 0;
- //
-};
-
-class IStreamedObjectListener
-{
-public:
- //
- virtual void OnCreatedStreamedObject(const char* filename, void* pHandle) = 0;
- virtual void OnRequestedStreamedObject(void* pHandle) = 0;
- virtual void OnReceivedStreamedObject(void* pHandle) = 0;
- virtual void OnUnloadedStreamedObject(void* pHandle) = 0;
- virtual void OnBegunUsingStreamedObjects(void** pHandles, size_t numHandles) = 0;
- virtual void OnEndedUsingStreamedObjects(void** pHandles, size_t numHandles) = 0;
- virtual void OnDestroyedStreamedObject(void* pHandle) = 0;
- //
-protected:
- virtual ~IStreamedObjectListener() {}
-};
-
-#pragma pack(push, 16)
-
-struct SFogVolumeData
-{
- AABB avgAABBox;
- ColorF fogColor;
- int m_volumeType;
- Vec3 m_heightFallOffBasePoint;
- float m_densityOffset;
- Vec3 m_heightFallOffDirScaled;
- float m_globalDensity;
-
- SFogVolumeData() :
- avgAABBox(AABB::RESET),
- m_globalDensity(0.0f),
- m_densityOffset(0.0f),
- m_volumeType(0),
- m_heightFallOffBasePoint(Vec3(0, 0, 0)),
- m_heightFallOffDirScaled(Vec3(0, 0, 0)),
- fogColor(ColorF(1.0f, 1.0f, 1.0f, 1.0f))
- {
- }
-
-};
-
-// Summary:
-// Light volumes data
-
-#define LIGHTVOLUME_MAXLIGHTS 16
-
-struct SLightVolume
-{
- struct SLightData
- {
- SLightData()
- : vPos(0, 0, 0, 0)
- , vColor(0, 0, 0, 0)
- , vParams(0, 0, 0, 0) {}
- SLightData(const Vec4& vInPos, const Vec4& vInColor, const Vec4& vInParams)
- : vPos(vInPos)
- , vColor(vInColor)
- , vParams(vInParams) {}
-
- Vec4 vPos;
- Vec4 vColor;
- Vec4 vParams;
- };
-
- SLightVolume()
- {
- pData.reserve(LIGHTVOLUME_MAXLIGHTS);
- }
-
- typedef DynArray LightDataVector;
-
- DEFINE_ALIGNED_DATA(LightDataVector, pData, 16);
-};
-
-#pragma pack(pop)
-
-struct CRNTmpData
-{
- struct SRNUserData
- {
- int m_narrDrawFrames[MAX_RECURSION_LEVELS];
- SLodDistDissolveTransitionState lodDistDissolveTransitionState;
- Matrix34 objMat;
- OcclusionTestClient m_OcclState;
- struct IClipVolume* m_pClipVolume;
- SBending m_Bending;
- SBending m_BendingPrev;
- Vec3 vCurrentWind;
- uint32 nBendingLastFrame : 29;
- uint32 bWindCurrent : 1;
- uint32 bBendingSet : 1;
- uint16 nCubeMapId;
- uint16 nCubeMapIdCacheClearCounter;
- uint8 nWantedLod;
- CRenderObject* m_pRenderObject[MAX_STATOBJ_LODS_NUM];
- CRenderObject* m_arrPermanentRenderObjects[MAX_STATOBJ_LODS_NUM];
- } userData;
-
- CRNTmpData() { memset(this, 0, sizeof(*this)); assert((void*)this == (void*)&this->userData); nPhysAreaChangedProxyId = ~0; }
- CRNTmpData* pNext, * pPrev;
- CRNTmpData** pOwnerRef;
- uint32 nFrameInfoId;
- uint32 nPhysAreaChangedProxyId;
-
- void Unlink()
- {
- if (!pNext || !pPrev)
- {
- return;
- }
- pNext->pPrev = pPrev;
- pPrev->pNext = pNext;
- pNext = pPrev = NULL;
- }
-
- void Link(CRNTmpData* Before)
- {
- if (pNext || pPrev)
- {
- return;
- }
- pNext = Before->pNext;
- Before->pNext->pPrev = this;
- Before->pNext = this;
- pPrev = Before;
- }
-
- int Count()
- {
- int nCounter = 0;
- for (CRNTmpData* pElem = pNext; pElem != this; pElem = pElem->pNext)
- {
- nCounter++;
- }
- return nCounter;
- }
-
- void OffsetPosition(const Vec3& delta)
- {
- userData.objMat.SetTranslation(userData.objMat.GetTranslation() + delta);
- }
-};
-
-
-// Summary:
-// Interface to the 3d Engine.
-struct I3DEngine
- : public IProcess
-{
- struct SObjectsStreamingStatus
- {
- int nReady;
- int nInProgress;
- int nTotal;
- int nActive;
- int nAllocatedBytes;
- int nMemRequired;
- int nMeshPoolSize; // in MB
-
- };
-
- struct OceanAnimationData
- {
- float fWindDirection;
- float fWindSpeed;
- float fWavesSpeed;
- float fWavesAmount;
- float fWavesSize;
- float fWindDirectionU;
- float fWindDirectionV;
- };
-
- struct SStremaingBandwidthData
- {
- SStremaingBandwidthData()
- {
- memset(this, 0, sizeof(SStremaingBandwidthData));
- }
- float fBandwidthActual;
- float fBandwidthRequested;
- };
-
- enum eStreamingSubsystem
- {
- eStreamingSubsystem_Textures,
- eStreamingSubsystem_Objects,
- eStreamingSubsystem_Audio,
- };
-
- using LoadStaticObjectAsyncResult = AZStd::function)>;
-
- struct StaticObjectAsyncLoadRequest
- {
- StaticObjectAsyncLoadRequest() = default;
-
- LoadStaticObjectAsyncResult m_callback;
- string m_filename;
- string m_geomName;
- bool m_useStreaming;
- unsigned long m_loadingFlags;
- };
-
- struct CausticsParams
- {
- float tiling = 0.0f;
- float distanceAttenuation = 0.0f;
- float height = 0.0f;
- float depth = 0.0f;
- float intensity = 0.0f;
- };
-
-
- //
- // Summary:
- // Initializes the 3D Engine.
- // See Also:
- // ShutDown
- // Notes:
- // Only call once, after creating the instance.
- virtual bool Init() = 0;
-
-
- // Summary:
- // Sets the path used to load levels.
- // See Also:
- // LoadLevel
- // Arguments:
- // szFolderName - Should contains the folder to be used
- virtual void SetLevelPath(const char* szFolderName) = 0;
-
- virtual bool CheckMinSpec(uint32 nMinSpec) = 0;
-
- virtual void PrepareOcclusion(const CCamera& rCamera) = 0;
- virtual void EndOcclusion() = 0;
- // Description:
- // Will load a level from the folder specified with SetLevelPath. If a
- // level is already loaded, the resources will be deleted before.
- // See Also:
- // SetLevelPath
- // Arguments:
- // szFolderName - Name of the subfolder to load
- // szMissionName - Name of the mission
- // Return Value:
- // A boolean which indicate the result of the function; true is
- // succeed, or false if failed.
- // Summary:
- // Load a level.
- virtual bool LoadLevel(const char* szFolderName, const char* szMissionName) = 0;
- virtual bool InitLevelForEditor(const char* szFolderName, const char* szMissionName) = 0;
- virtual bool LevelLoadingInProgress() = 0;
- // Summary:
- // Handles any work needed at start of new frame.
- // Notes:
- // Should be called for every frame.
- virtual void OnFrameStart() = 0;
-
- // Description:
- // Must be called after the game completely finishes loading the level.
- // 3D engine uses it to pre-cache some resources needed for rendering.
- // See Also:
- // LoadLevel
- // Summary:
- // Pre-caches some resources need for rendering.
- virtual void PostLoadLevel() = 0;
-
- // Description:
- // Loads the required assets for a null level.
- virtual void LoadEmptyLevel() = 0;
-
- // Summary:
- // Clears all rendering resources, all objects, characters and materials, voxels and terrain.
- // Notes:
- // Should always be called before LoadLevel, and also before loading textures from a script.
- virtual void UnloadLevel() = 0;
-
-
- // Summary:
- // Updates the 3D Engine.
- // Notes:
- // Should be called for every frame.
- virtual void Update() = 0;
-
- // Summary:
- // Returns the Camera used for Rendering on 3DEngine Side, normaly equal to the view camera, except if frozen with e_camerafreeze
- // Notes:
- // Only valid during RenderWorld(else the camera of the last frame is used)
- // This is the camera which should be used for all Engine side culling (since e_camerafreeze allows easy debugging then)
- virtual const CCamera& GetRenderingCamera() const = 0;
- virtual float GetZoomFactor() const = 0;
-
- // Summary:
- // clear all per frame temp data used in SRenderingPass
- virtual void Tick() = 0;
-
- // Summary:
- // Update all ShaderItems flags, only required after shaders were reloaded at runtime
- virtual void UpdateShaderItems() = 0;
-
- // Summary:
- // Deletes the 3D Engine instance.
- virtual void Release() = 0;
-
- // Summary:
- // Draws the world.
- // See Also:
- // SetCamera
- // Arguments:
- // szDebugName - name that can be visualized for debugging purpose, must not be 0
- virtual void RenderWorld(int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName) = 0;
-
- virtual void RenderSceneReflection(int nRenderFlags, const SRenderingPassInfo& passInfo) = 0;
-
- // Summary:
- // Prepares for the world stream update, should be called before rendering
- virtual void PreWorldStreamUpdate(const CCamera& cam) = 0;
-
- // Summary:
- // Performs the actual world streaming update. PreWorldStreamUpdate must be called before
- virtual void WorldStreamUpdate() = 0;
-
- // Summary:
- // Shuts down the 3D Engine.
- virtual void ShutDown() = 0;
-
- // Summary:
- // Loads a static object from a CGF file. Does not increment the static object's reference counter. The reference returned is not guaranteed to be valid when run outside the main thread. Best used for priming the cache
- // See Also:
- // IStatObj
- // Arguments:
- // fileName - CGF Filename - should not be 0 or ""
- // geomName - Optional name of geometry inside CGF.
- // subObject - [Out]Optional Out parameter,Pointer to the
- // loadingFlags - Zero or a bitwise combination of the flags from ELoadingFlags, defined in IMaterial.h, under the interface IMaterialManager.
- // data - Raw buffer contain CGF data.
- // dataSize - Size of the raw data buffer.
- // Return Value:
- // A pointer to an object derived from IStatObj.
- virtual IStatObj* LoadStatObjUnsafeManualRef(const char* fileName, const char* geomName = nullptr, /*[Out]*/ IStatObj::SSubObject** subObject = nullptr,
- bool useStreaming = true, unsigned long loadingFlags = 0, const void* data = nullptr, int dataSize = 0) = 0;
-
- // Summary:
- // Loads a static object from a CGF file. Increments the static object's reference counter. This method is threadsafe. Not suitable for preloading
- // See Also:
- // IStatObj
- // Arguments:
- // fileName - CGF Filename - should not be 0 or "", even if data is provided.
- // geomName - Optional name of geometry inside CGF.
- // subObject - [Out]Optional Out parameter,Pointer to the
- // loadingFlags - Zero or a bitwise combination of the flags from ELoadingFlags, defined in IMaterial.h, under the interface IMaterialManager.
- // data - Raw buffer contain CGF data.
- // dataSize - Size of the raw data buffer.
- // Return Value:
- // A smart pointer to an object derived from IStatObj.
- virtual _smart_ptr LoadStatObjAutoRef(const char* fileName, const char* geomName = nullptr, /*[Out]*/ IStatObj::SSubObject** subObject = nullptr,
- bool useStreaming = true, unsigned long loadingFlags = 0, const void* data = nullptr, int dataSize = 0) = 0;
-
- // Summary:
- // Flushes queued async mesh loads.
- virtual void ProcessAsyncStaticObjectLoadRequests() = 0;
-
- // Summary:
- // Loads a static object from a CGF file asynchronously and invokes a callback on completion.
- // Actual load will occur on the main thread.
- // See Also:
- // IStatObj
- // Arguments:
- // callback - The user callback to invoke on completion.
- // szFileName - CGF Filename - should not be 0 or ""
- // szGeomName - Optional name of geometry inside CGF.
- // ppSubObject - [Out]Optional Out parameter,Pointer to the
- // nLoadingFlags - Zero or a bitwise combination of the flags from ELoadingFlags,
- // defined in IMaterial.h, under the interface IMaterialManager.
- // Return Value:
- // None
- virtual void LoadStatObjAsync(LoadStaticObjectAsyncResult resultCallback, const char* szFileName, const char* szGeomName = nullptr, bool bUseStreaming = true, unsigned long nLoadingFlags = 0) = 0;
-
- // Summary:
- // Finds a static object created from the given filename
- // See Also:
- // IStatObj
- // Arguments:
- // szFileName - CGF Filename - should not be 0 or ""
- // Return Value:
- // A pointer to an object derived from IStatObj.
- virtual IStatObj* FindStatObjectByFilename(const char* filename) = 0;
-
- // Summary:
- // Gets gsm range
- // Return Value:
- // An integer representing the gsm range.
- virtual const float GetGSMRange() = 0;
-
- // Summary:
- // Gets gsm range step
- // Return Value:
- // An integer representing the gsm range step
- virtual const float GetGSMRangeStep() = 0;
-
- // Summary:
- // Gets the amount of loaded objects.
- // Return Value:
- // An integer representing the amount of loaded objects.
- virtual int GetLoadedObjectCount() { return 0; }
-
- // Summary:
- // Fills pObjectsArray with pointers to loaded static objects
- // if pObjectsArray is NULL only fills nCount parameter with amount of loaded objects.
- virtual void GetLoadedStatObjArray(IStatObj** pObjectsArray, int& nCount) = 0;
-
- // Summary:
- // Gets stats on streamed objects
- virtual void GetObjectsStreamingStatus(SObjectsStreamingStatus& outStatus) = 0;
-
- // Summary:
- // Gets stats on the streaming bandwidth requests from subsystems
- // Arguments:
- // subsystem - the streaming subsystem we want bandwidth data for
- // outData - structure containing the bandwidth data for the subsystem requested
- virtual void GetStreamingSubsystemData(int subsystem, SStremaingBandwidthData& outData) = 0;
-
- // Summary:
- // Registers an entity to be rendered.
- // Arguments:
- // pEntity - The entity to render
- virtual void RegisterEntity(IRenderNode* pEntity, int nSID = -1, int nSIDConsideredSafe = -1) = 0;
-
- // Summary:
- // Selects an entity for debugging.
- // Arguments:
- // pEntity - The entity to render
- virtual void SelectEntity(IRenderNode* pEntity) = 0;
-
- //////////////////////////////////////////////
- // Start Confetti //////////////////////////
- // Summary:
- // Return the setting for sun shadows. Return false for sub classes without sun shadows settings.
- virtual bool IsSunShadows(){ return false; };
- // End Confetti//////////////////////////////
- //////////////////////////////////////////////
-
- // Summary:
- // Offers same functionality as Cry3DEngineBase::MakeSystemMaterialFromShader
- virtual _smart_ptr MakeSystemMaterialFromShaderHelper(const char* sShaderName, SInputShaderResources* Res = NULL) = 0;
-
- virtual bool CheckMinSpecHelper(uint32 nMinSpec) = 0;
-
- virtual void OnCasterDeleted(IShadowCaster* pCaster) = 0;
-
- virtual void GetStatObjAndMatTables(DynArray* pStatObjTable, DynArray<_smart_ptr>* pMatTable, DynArray* pStatInstGroupTable, uint32 nObjTypeMask) = 0;
-
-#ifndef _RELEASE
- enum EDebugDrawListAssetTypes
- {
- DLOT_ALL = 0,
- DLOT_CHARACTER = BIT(2),
- DLOT_STATOBJ = BIT(3)
- };
-
- struct SObjectInfoToAddToDebugDrawList
- {
- const char* pName;
- const char* pClassName;
- const char* pFileName;
- IRenderNode* pRenderNode;
- uint32 numTris;
- uint32 numVerts;
- uint32 texMemory;
- uint32 meshMemory;
- EDebugDrawListAssetTypes type;
- const AABB* pBox;
- const Matrix34* pMat;
- };
-
- virtual void AddObjToDebugDrawList(SObjectInfoToAddToDebugDrawList& objInfo) = 0;
- virtual bool IsDebugDrawListEnabled() const = 0;
-#endif
-
-
- // Summary:
- // Notices the 3D Engine to stop rendering a specified entity.
- // Arguments:
- // pEntity - The entity to stop render
- virtual void UnRegisterEntityDirect(IRenderNode* pEntity) = 0;
- virtual void UnRegisterEntityAsJob(IRenderNode* pEnt) = 0;
- // Summary:
- // Returns whether a world pos is under water.
- virtual bool IsUnderWater(const Vec3& vPos) const = 0;
-
- // Summary:
- // Returns whether ocean volume is visible or not.
- virtual void SetOceanRenderFlags(uint8 nFlags) = 0;
- virtual uint8 GetOceanRenderFlags() const = 0;
- virtual uint32 GetOceanVisiblePixelsCount() const = 0;
-
- // Summary:
- // Gets the closest walkable bottom z straight beneath the given reference position.
- // Notes:
- // This function will take into account both the global terrain elevation and local voxel (or other solid walkable object).
- // Arguments:
- // referencePos - Position from where to start searching downwards.
- // maxRelevantDepth - Max depth caller is interested in relative to referencePos (for ray casting performance reasons).
- // objtypes - expects physics entity flags. Use this to specify what object types make a valid bottom for you.
- // Return Value:
- // A float value which indicate the global world z of the bottom level beneath the referencePos.
- // If the referencePos is below terrain but not inside any voxel area BOTTOM_LEVEL_UNKNOWN is returned.
- virtual float GetBottomLevel(const Vec3& referencePos, float maxRelevantDepth, int objtypes) = 0;
- // A set of overloads for enabling users to use different sets of input params. Basically, only
- // referencePos is mandatory. The overloads as such don't need to be virtual but this seems to be
- // a purely virtual interface.
- virtual float GetBottomLevel(const Vec3& referencePos, float maxRelevantDepth = 10.0f) = 0;
- virtual float GetBottomLevel(const Vec3& referencePos, int objflags) = 0;
-
- // Summary:
- // Gets the ocean water level. Fastest option, always prefer is only ocean height required.
- // Notes:
- // This function will take into account just the global water level.
- // Return Value:
- // A float value which indicate the water level. In case no water was
- // found at the specified location, the value WATER_LEVEL_UNKNOWN will
- // be returned.
- virtual float GetWaterLevel() = 0;
-
- // Summary:
- // Gets the closest walkable bottom z straight beneath the given reference position.
- // - Use with caution the accurate query - SLOW
- // Notes:
- // This function will take into account both the global water level and any water volume present.
- // Function is provided twice for performance with diff. arguments.
- // Arguments:
- // pvPos - Desired position to inspect the water level
- // pent - Pointer to return the physical entity to test against (optional)
- // Return Value:
- // A float value which indicate the water level. In case no water was
- // found at the specified location, the value WATER_LEVEL_UNKNOWN will
- // be returned.
- virtual float GetWaterLevel(const Vec3* pvPos, IPhysicalEntity* pent = NULL, bool bAccurate = false) = 0;
-
- // Summary:
- // Gets the ocean water level for a specified position.
- // - Use with caution the accurate query - SLOW
- // Notes:
- // This function only takes into account ocean water.
- // Arguments:
- // pCurrPos - Position to check water level
- // Return Value:
- // A float value which indicate the water level.
- virtual float GetAccurateOceanHeight(const Vec3& pCurrPos) const = 0;
-
- // Summary:
- // Gets caustics parameters.
- virtual CausticsParams GetCausticsParams() const = 0;
-
- // Summary:
- // Gets ocean animation parameters.
- virtual OceanAnimationData GetOceanAnimationParams() const = 0;
-
- // Summary:
- // Gets HDR setup parameters.
- // Return Value:
- virtual void GetHDRSetupParams (Vec4 pParams[5]) const = 0;
-
- // Summary:
- // Removes all particles and decals from the world.
- virtual void ResetParticlesAndDecals() = 0;
-
- // Summary:
- // Creates new decals on the walls, static objects, terrain and entities.
- // Arguments:
- // Decal - Structure describing the decal effect to be applied
- virtual void CreateDecal(const CryEngineDecalInfo& Decal) = 0;
-
- // Summary:
- // Removes decals in a specified range.
- // Arguments:
- // vAreaBox - Specify the area in which the decals will be removed
- // pEntity - if not NULL will only delete decals attached to this entity
- virtual void DeleteDecalsInRange(AABB* pAreaBox, IRenderNode* pEntity) = 0;
-
- // Summary:
- // Sets the current sun base color.
- virtual void SetSunColor(Vec3 vColor) = 0;
-
- // Summary:
- // Gets the current sun animated color.
- virtual Vec3 GetSunAnimColor() = 0;
-
- // Summary:
- // Sets the current sky brightening multiplier.
- virtual void SetSunAnimColor(const Vec3& color) = 0;
-
- // Summary:
- // Sets the current sun animation speed.
- virtual float GetSunAnimSpeed() = 0;
-
- // Summary:
- virtual void SetSunAnimSpeed(float sunAnimSpeed) = 0;
-
- // Summary:
- // Gets the current sun animation phase.
- virtual AZ::u8 GetSunAnimPhase() = 0;
- // Summary:
- // Sets the current sun animation phase.
- virtual void SetSunAnimPhase(AZ::u8 sunAnimPhase) = 0;
-
- // Summary:
- // Gets the current sun animation index.
- virtual AZ::u8 GetSunAnimIndex() = 0;
-
- // Summary:
- // Sets the current sun animation index.
- virtual void SetSunAnimIndex(AZ::u8 sunAnimIndex) = 0;
-
- // Summary:
- // Sets current rain parameters.
- virtual void SetRainParams(const SRainParams& rainParams) = 0;
-
- // Summary:
- // Gets the validity and fills current rain parameters.
- virtual bool GetRainParams(SRainParams& rainParams) = 0;
-
- // Summary:
- // Sets current snow surface parameters.
- virtual void SetSnowSurfaceParams(const Vec3& vCenter, float fRadius, float fSnowAmount, float fFrostAmount, float fSurfaceFreezing) = 0;
-
- // Summary:
- // Gets current snow surface parameters.
- virtual bool GetSnowSurfaceParams(Vec3& vCenter, float& fRadius, float& fSnowAmount, float& fFrostAmount, float& fSurfaceFreezing) = 0;
-
- // Summary:
- // Sets current snow parameters.
- virtual void SetSnowFallParams(int nSnowFlakeCount, float fSnowFlakeSize, float fSnowFallBrightness, float fSnowFallGravityScale, float fSnowFallWindScale, float fSnowFallTurbulence, float fSnowFallTurbulenceFreq) = 0;
-
- // Summary:
- // Gets current snow parameters.
- virtual bool GetSnowFallParams(int& nSnowFlakeCount, float& fSnowFlakeSize, float& fSnowFallBrightness, float& fSnowFallGravityScale, float& fSnowFallWindScale, float& fSnowFallTurbulence, float& fSnowFallTurbulenceFreq) = 0;
-
- // Summary:
- // Sets the view distance scale.
- // Arguments:
- // fScale - may be between 0 and 1, 1.f = Unmodified view distance set by level designer, value of 0.5 will reduce it twice
- // Notes:
- // This value will be reset automatically to 1 on next level loading.
- virtual void SetMaxViewDistanceScale(float fScale) = 0;
-
- // Summary:
- // Gets the view distance.
- // Return Value:
- // A float value representing the maximum view distance.
- virtual float GetMaxViewDistance(bool bScaled = true) = 0;
-
- virtual const SFrameLodInfo& GetFrameLodInfo() const = 0;
- virtual void SetFrameLodInfo(const SFrameLodInfo& frameLodInfo) = 0;
-
- // Summary:
- // Sets the fog color.
- virtual void SetFogColor(const Vec3& vFogColor) = 0;
-
- // Summary:
- // Gets the fog color.
- virtual Vec3 GetFogColor() = 0;
-
- // Summary:
- // Gets various sky light parameters.
- virtual void GetSkyLightParameters(Vec3& sunDir, Vec3& sunIntensity, float& Km, float& Kr, float& g, Vec3& rgbWaveLengths) = 0;
-
- // Summary:
- // Sets various sky light parameters.
- virtual void SetSkyLightParameters(const Vec3& sunDir, const Vec3& sunIntensity, float Km, float Kr, float g, const Vec3& rgbWaveLengths, bool forceImmediateUpdate = false) = 0;
-
- // Return Value:
- // In logarithmic scale -4.0 .. 4.0
- virtual float GetLightsHDRDynamicPowerFactor() const = 0;
-
- // Return true if tessellation is allowed for given render object
- virtual bool IsTessellationAllowed(const CRenderObject* pObj, const SRenderingPassInfo& passInfo, bool bIgnoreShadowPass = false) const = 0;
-
- // allows to modify material on render nodes at run-time (make sure it is properly restored back)
- virtual void SetRenderNodeMaterialAtPosition(EERType eNodeType, const Vec3& vPos, _smart_ptr pMat) = 0;
-
- // override the camera precache point with the requested position for the current round
- virtual void OverrideCameraPrecachePoint(const Vec3& vPos) = 0;
-
- // begin streaming of meshes and textures for specified position, pre-cache stops after fTimeOut seconds
- virtual int AddPrecachePoint(const Vec3& vPos, const Vec3& vDir, float fTimeOut = 3.f, float fImportanceFactor = 1.0f) = 0;
- virtual void ClearPrecachePoint(int id) = 0;
- virtual void ClearAllPrecachePoints() = 0;
-
- virtual void GetPrecacheRoundIds(int pRoundIds[MAX_STREAM_PREDICTION_ZONES]) = 0;
-
- virtual void TraceFogVolumes(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality) = 0;
-
- //DOC-IGNORE-BEGIN
-
- // Internal functions, mostly used by the editor, which won't be documented for now
-
- // Summary:
- // Removes all static objects on the map (for editor)
- virtual void RemoveAllStaticObjects(int nSID = DEFAULT_SID) = 0;
-
- // Summary:
- // Sets group parameters
- virtual bool SetStatInstGroup(int nGroupId, const IStatInstGroup& siGroup, int nSID = 0) = 0;
-
- // Summary:
- // Gets group parameters
- virtual bool GetStatInstGroup(int nGroupId, IStatInstGroup& siGroup, int nSID = 0) = 0;
-
- //DOC-IGNORE-END
-
- // Summary:
- // Notifies of an explosion, and maybe creates an hole in the terrain
- // Description:
- // This function should usually make sure that no static objects are near before making the hole.
- // Arguments:
- // vPos - Position of the explosion
- // fRadius - Radius of the explosion
- // bDeformTerrain - Allow to deform the terrain
- virtual void OnExplosion(Vec3 vPos, float fRadius, bool bDeformTerrain = true) = 0;
-
- // Summary:
- // Sets the physics material enumerator
- // Arguments:
- // pPhysMaterialEnumerator - The physics material enumarator to set
- virtual void SetPhysMaterialEnumerator(IPhysMaterialEnumerator* pPhysMaterialEnumerator) = 0;
-
- // Summary:
- // Gets the physics material enumerator
- // Return Value:
- // A pointer to an IPhysMaterialEnumerator derived object.
- virtual IPhysMaterialEnumerator* GetPhysMaterialEnumerator() = 0;
-
- //DOC-IGNORE-BEGIN
- //Internal functions
-
- // Summary:
- // Allows to enable fog in editor
- virtual void SetupDistanceFog() = 0;
-
- // Summary:
- // Loads environment settings for specified mission
- virtual void LoadMissionDataFromXMLNode(const char* szMissionName) = 0;
-
- virtual void LoadEnvironmentSettingsFromXML(XmlNodeRef pInputNode, int nSID = DEFAULT_SID) = 0;
-
- // Summary:
- // This one is called by the editor when the terrain editing tools are not being built.
- // This is the case when the game developers are using external tools to author terrain.
- // The Octree data and the terrain heightmap data are stored in the same file.
- // This method makes sure only the non-terrain data of the Octree is loaded.
- virtual bool LoadCompiledOctreeForEditor() = 0;
-
- //DOC-IGNORE-END
-
- //DOC-IGNORE-BEGIN
- // Set direction to the sun
- // virtual void SetSunDir( const Vec3& vNewSunDir ) = 0;
-
- // Summary:
- // Return non-normalized direction to the sun
- virtual Vec3 GetSunDir() const = 0;
-
- // Summary:
- // Return normalized direction to the sun
- virtual Vec3 GetSunDirNormalized() const = 0;
-
- // Summary:
- // Return realtime (updated every frame with real sun position) normalized direction to the scene
- virtual Vec3 GetRealtimeSunDirNormalized() const = 0;
-
- //Internal function used by 3d engine and renderer
- // Summary:
- // Gets distance to the sector containig ocean water
- virtual float GetDistanceToSectorWithWater() = 0;
- //DOC-IGNORE-END
-
- // Summary:
- // Gets the sun color
- // Notes:
- // Should have been specified in the editor.
- // Return Value:
- // An rgb value contained in a Vec3 object.
- virtual Vec3 GetSunColor() const = 0;
-
- // Summary:
- // Retrieves the current SSAO multiplier
- // Notes:
- // Return Value:
- // scalar value
- virtual float GetSSAOAmount() const = 0;
-
- // Summary:
- // Retrieves the current SSAO contrast multiplier
- // Notes:
- // Return Value:
- // scalar value
- virtual float GetSSAOContrast() const = 0;
- // Summary:
- // Frees entity render info.
- virtual void FreeRenderNodeState(IRenderNode* pEntity) = 0;
-
- // Summary:
- // Adds the level's path to a specified filename.
- // Arguments:
- // szFileName - The filename for which we need to add the path
- // Return Value:
- // Full path for the filename; including the level path and the filename appended after.
- virtual const char* GetLevelFilePath(const char* szFileName) = 0;
-
- // Summary:
- // Displays statistic on the 3d Engine.
- // Arguments:
- // fTextPosX - X position for the text
- // fTextPosY - Y position for the text
- // fTextStepY - Amount of pixels to distance each line
- // bEnhanced - false=normal, true=more interesting information
- virtual void DisplayInfo(float& fTextPosX, float& fTextPosY, float& fTextStepY, bool bEnhanced) = 0;
-
- // Summary:
- // Displays CPU and GPU memory usage statistics on screen
- virtual void DisplayMemoryStatistics() = 0;
-
- // Summary:
- // Draws text right aligned at the y pixel precision.
- virtual void DrawTextRightAligned(const float x, const float y, const char* format, ...) PRINTF_PARAMS(4, 5) = 0;
- virtual void DrawTextRightAligned(const float x, const float y, const float scale, const ColorF& color, const char* format, ...) PRINTF_PARAMS(6, 7) = 0;
-
- virtual void DrawBBoxHelper(const Vec3& vMin, const Vec3& vMax, ColorB col = Col_White) = 0;
- virtual void DrawBBoxHelper(const AABB& box, ColorB col = Col_White) = 0;
-
- // Summary:
- // Enables or disables portal at a specified position.
- // Arguments:
- // vPos - Position to place the portal
- // bActivate - Set to true in order to enable the portal, or to false to disable
- // szEntityName -
- virtual void ActivatePortal(const Vec3& vPos, bool bActivate, const char* szEntityName) = 0;
-
- //DOC-IGNORE-BEGIN
- // Summary:
- // Counts memory usage
- virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
-
- // Summary:
- // Counts resource memory usage
- // Arguments:
- // cstAABB - Use the whole level AABB if you want to grab the resources
- // from the whole level. For height level, use something BIG
- // (ie: +-FLT_MAX)
- virtual void GetResourceMemoryUsage(ICrySizer* pSizer, const AABB& cstAABB) = 0;
- //DOC-IGNORE-END
-
- // Summary:
- // Creates a new VisArea.
- // Return Value:
- // A pointer to a newly created VisArea object
- virtual IVisArea* CreateVisArea(uint64 visGUID) = 0;
-
- // Summary:
- // Deletes a VisArea.
- // Arguments:
- // pVisArea - A pointer to the VisArea to delete
- virtual void DeleteVisArea(IVisArea* pVisArea) = 0;
-
- //mat: todo
-
- // Summary:
- // Updates the VisArea
- // Arguments:
- // pArea -
- // pPoints -
- // nCount -
- // szName -
- // info -
- // bReregisterObjects -
- virtual void UpdateVisArea(IVisArea* pArea, const Vec3* pPoints, int nCount, const char* szName, const SVisAreaInfo& info, bool bReregisterObjects) = 0;
-
- // Summary:
- // Determines if two VisAreas are connected.
- // Description:
- // Used to determine if a sound is potentially hearable between two VisAreas.
- // Arguments:
- // pArea1 - A pointer to a VisArea
- // pArea2 - A pointer to a VisArea
- // nMaxRecursion - Maximum number of recursions to be done
- // bSkipDisabledPortals - Indicate if disabled portals should be skipped
- // Return Value:
- // A boolean value set to true if the two VisAreas are connected, else false will be returned.
- virtual bool IsVisAreasConnected(IVisArea* pArea1, IVisArea* pArea2, int nMaxRecursion = 1, bool bSkipDisabledPortals = true) = 0;
-
- // Summary:
- // Creates a ClipVolume.
- // Return Value:
- // A pointer to a newly created ClipVolume object
- virtual IClipVolume* CreateClipVolume() = 0;
-
- // Summary:
- // Deletes a ClipVolume.
- // Arguments:
- // pClipVolume - A pointer to the ClipVolume to delete
- virtual void DeleteClipVolume(IClipVolume* pClipVolume) = 0;
-
- // Summary:
- // Updates a ClipVolume
- // Arguments:
- // pClipVolume - Pointer to volume that needs updating
- // pRenderMesh - Pointer to new render mesh
- // worldTM - Updated world transform
- // szName - Updated ClipVolume name
- virtual void UpdateClipVolume(IClipVolume* pClipVolume, _smart_ptr pRenderMesh, IBSPTree3D* pBspTree, const Matrix34& worldTM, bool bActive, uint32 flags, const char* szName) = 0;
-
- //mat: todo
-
- // Summary:
- // Creates instance of IRenderNode object with specified type.
- virtual IRenderNode* CreateRenderNode(EERType type) = 0;
-
- // Summary:
- // Delete RenderNode object.
- virtual void DeleteRenderNode(IRenderNode* pRenderNode) = 0;
-
-
- // Summary:
- // Gets wind direction and force, averaged within a box.
- virtual Vec3 GetWind(const AABB& box, bool bIndoors) const = 0;
-
- // Summary:
- // Gets the global wind vector.
- virtual Vec3 GetGlobalWind(bool bIndoors) const = 0;
-
- // Summary:
- // Gets wind direction and forace at the sample points provided.
- // Note: the positions defining the samples will be overwritten
- // with the accumulated wind influences.
- virtual bool SampleWind(Vec3* pSamples, int nSamples, const AABB& volume, bool bIndoors) const = 0;
-
- // Description:
- // Gets the VisArea which is present at a specified point.
- // Arguments:
- // vPos:
- // Return Value:
- // VisArea containing point, if any. 0 otherwise.
- virtual IVisArea* GetVisAreaFromPos(const Vec3& vPos) = 0;
-
- // Description:
- // Tests for intersection against Vis Areas.
- // Arguments:
- // box: Volume to test for intersection.
- // pNodeCache (out, optional): Set to a cached pointer, for quicker calls to ClipToVisAreas.
- // Return Value:
- // Whether box intersects any vis areas.
- virtual bool IntersectsVisAreas(const AABB& box, void** pNodeCache = 0) = 0;
-
- // Description:
- // Clips geometry against the boundaries of VisAreas.
- // Arguments:
- // pInside: Vis Area to clip inside of. If 0, clip outside all Vis Areas.
- // sphere -
- // vNormal -
- // pNodeChache -
- // Return Value:
- // Whether it was clipped
- virtual bool ClipToVisAreas(IVisArea* pInside, Sphere& sphere, Vec3 const& vNormal, void* pNodeCache = 0) = 0;
-
- // Summary:
- // Enables or disables ocean rendering.
- // Arguments:
- // bOcean - Will enable or disable the rendering of ocean
- virtual void EnableOceanRendering(bool bOcean) = 0;
-
- // Description:
- // Register a texture load handler
- virtual void AddTextureLoadHandler(ITextureLoadHandler* pHandler) = 0;
-
- // Description
- // Unregister a texture load handler
- virtual void RemoveTextureLoadHandler(ITextureLoadHandler* pHandler) = 0;
-
- // Description:
- // Get a texture load handler for a given extension
- virtual ITextureLoadHandler* GetTextureLoadHandlerForImage(const char* ext) = 0;
- // Summary:
- // Creates a new light source.
- // Return Value:
- // Pointer to newly created light or -1 if it fails.
- virtual struct ILightSource* CreateLightSource() = 0;
-
- // Summary:
- // Deletes a light.
- // Arguments:
- // Pointer to the light
- virtual void DeleteLightSource(ILightSource* pLightSource) = 0;
-
- // Summary:
- // Gives access to the list holding all static light sources
- // Return Value:
- // An array holding all the CDLight pointers.
- virtual const PodArray* GetLightEntities() = 0;
-
- // Summary:
- // Gives access to list holding all lighting volumes
- // Return Value:
- // An array holding all the SLightVolume pointers.
- virtual void GetLightVolumes(threadID nThreadID, SLightVolume*& pLightVols, uint32& nNumVols) = 0;
-
- // Summary:
- // Registers a volume for lighting
- // Return Value:
- // The index of the registered volume.
- virtual uint16 RegisterVolumeForLighting(const Vec3& vPos, f32 fRadius, uint8 nClipVolumeRef, const SRenderingPassInfo& passInfo) = 0;
-
- // Summary:
- // Reload the heightmap.
- // Description:
- // Reloading the heightmap will resets all decals and particles.
- // Notes:
- // In future will restore deleted vegetations
- // Returns:
- // success
- virtual bool RestoreTerrainFromDisk(int nSID = 0) = 0;
-
- //DOC-IGNORE-BEGIN
- // tmp
- virtual const char* GetFilePath(const char* szFileName) { return GetLevelFilePath(szFileName); }
- //DOC-IGNORE-END
-
- // Summary:
- // Post processing effects interfaces.
- virtual class IPostEffectGroupManager* GetPostEffectGroups() const = 0;
- virtual class IPostEffectGroup* GetPostEffectBaseGroup() const = 0;
-
- // Most code should use either GetPostEffectGroups() or GetPostEffectBaseGroup() instead of these
- virtual void SetPostEffectParam(const char* pParam, float fValue, bool bForceValue = false) const = 0;
- virtual void SetPostEffectParamVec4(const char* pParam, const Vec4& pValue, bool bForceValue = false) const = 0;
- virtual void SetPostEffectParamString(const char* pParam, const char* pszArg) const = 0;
-
- virtual void GetPostEffectParam(const char* pParam, float& fValue) const = 0;
- virtual void GetPostEffectParamVec4(const char* pParam, Vec4& pValue) const = 0;
- virtual void GetPostEffectParamString(const char* pParam, const char*& pszArg) const = 0;
-
- virtual int32 GetPostEffectID(const char* pPostEffectName) = 0;
-
- virtual void ResetPostEffects(bool bOnSpecChange = false) = 0;
- //Disable post effect groups other than default and base.
- virtual void DisablePostEffects() = 0;
-
- virtual void SetShadowsGSMCache(bool bCache) = 0;
- virtual void SetCachedShadowBounds(const AABB& shadowBounds, float fAdditionalCascadesScale) = 0;
- virtual void SetRecomputeCachedShadows(uint nUpdateStrategy = 0) = 0;
-
- // Summary:
- // In debug mode check memory heap and makes assert, do nothing in release
- virtual void CheckMemoryHeap() = 0;
-
- // Summary:
- // Removes all decals attached to specified entity.
- virtual void DeleteEntityDecals(IRenderNode* pEntity) = 0;
-
- // Summary:
- // Disables CGFs unloading.
- virtual void LockCGFResources() = 0;
-
- // Summary:
- // Enables CGFs unloading (this is default state), this function will also release all not used CGF's.
- virtual void UnlockCGFResources() = 0;
-
- // Summary:
- // Release all unused CGFs.
- virtual void FreeUnusedCGFResources() = 0;
-
-
- // Summary:
- // Creates static object containing empty IndexedMesh.
- virtual IStatObj* CreateStatObj() = 0;
- virtual IStatObj* CreateStatObjOptionalIndexedMesh(bool createIndexedMesh) = 0;
-
- // Summary:
- // Creates the instance of the indexed mesh.
- virtual IIndexedMesh* CreateIndexedMesh() = 0;
-
- // Summary:
- // Saves/loads state of engine objects.
- virtual void SerializeState(TSerialize ser) = 0;
-
- // Summary:
- // Cleanups after save/load.
- virtual void PostSerialize(bool bReading) = 0;
-
- // Description:
- // Retrieve pointer to the material i/o interface.
- virtual IMaterialHelpers& GetMaterialHelpers() = 0;
-
- // Description:
- // Retrieve pointer to the material manager interface.
- virtual IMaterialManager* GetMaterialManager() = 0;
-
- // Description:
- // Retrieve pointer to the object manager interface.
- virtual IObjManager* GetObjManager() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // CGF Loader.
- //////////////////////////////////////////////////////////////////////////
- // Description:
- // Creates a chunkfile content instance
- // Returns 'NULL' if the memory for the instance could not be allocated
- virtual CContentCGF* CreateChunkfileContent(const char* filename) = 0;
-
- // Description:
- // Deletes the chunkfile content instance
- virtual void ReleaseChunkfileContent(CContentCGF*) = 0;
-
- // Description:
- // Loads the contents of a chunkfile into the given CContentCGF.
- // Returns 'false' on error.
- virtual bool LoadChunkFileContent(CContentCGF* pCGF, const char* filename, bool bNoWarningMode = false, bool bCopyChunkFile = true) = 0;
-
- // Description:
- // Loads the contents of a chunkfile into the given CContentCGF.
- // Returns 'false' on error.
- virtual bool LoadChunkFileContentFromMem(CContentCGF* pCGF, const void* pData, size_t nDataLen, uint32 nLoadingFlags, bool bNoWarningMode = false, bool bCopyChunkFile = true) = 0;
-
- // Description:
- // Creates ChunkFile.
- virtual IChunkFile* CreateChunkFile(bool bReadOnly = false) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Chunk file writer.
- //////////////////////////////////////////////////////////////////////////
- enum EChunkFileFormat
- {
- eChunkFileFormat_0x745,
- eChunkFileFormat_0x746,
- };
- virtual ChunkFile::IChunkFileWriter* CreateChunkFileWriter(EChunkFileFormat eFormat, AZ::IO::IArchive* pPak, const char* filename) const = 0;
- virtual void ReleaseChunkFileWriter(ChunkFile::IChunkFileWriter* p) const = 0;
-
- // Description:
- // Returns true if the ocean was created successfully.
- virtual bool CreateOcean(_smart_ptr pTerrainWaterMat, float waterLevel) = 0;
-
- // Description:
- // Deletes the ocean if it exists, otherwise does nothing.
- virtual void DeleteOcean() = 0;
-
- // Description:
- // Changes ocean material if the ocean exists.
- virtual void ChangeOceanMaterial(_smart_ptr pMat) = 0;
-
- // Description:
- // Changes ocean water level if the ocean exists.
- virtual void ChangeOceanWaterLevel(float fWaterLevel) = 0;
-
- virtual void InitMaterialDefautMappingAxis(_smart_ptr pMat) = 0;
-
- // Description:
- // Returns interface to visarea manager.
- virtual IVisAreaManager* GetIVisAreaManager() = 0;
-
- // Description:
- // Places camera into every visarea or every manually set pre-cache points and render the scenes.
- virtual void PrecacheLevel(bool bPrecacheAllVisAreas, Vec3* pPrecachePoints, int nPrecachePointsNum) = 0;
-
- // Description:
- // Proposes 3dengine to load on next frame all shaders and textures synchronously.
- virtual void ProposeContentPrecache() = 0;
-
-
-
- // Description:
- // Returns TOD interface.
- virtual ITimeOfDay* GetTimeOfDay() = 0;
-
- // Description:
- // Updates the sky material paths. LoadSkyMaterial will handle loading these materials.
- virtual void SetSkyMaterialPath(const string& skyMaterialPath) = 0;
- virtual void SetSkyLowSpecMaterialPath(const string& skyMaterialPath) = 0;
-
- // Description:
- // Loads the sky material for the level. e_SkyType will determine if we load the low spec sky material or the regular sky material.
- virtual void LoadSkyMaterial() = 0;
-
- // Description:
- // Returns SkyBox material.
- virtual _smart_ptr GetSkyMaterial() = 0;
-
- // Description:
- // Sets SkyBox Material.
- virtual void SetSkyMaterial(_smart_ptr pSkyMat) = 0;
-
- // Description:
- // Sets global 3d engine parameter.
- virtual void SetGlobalParameter(E3DEngineParameter param, const Vec3& v) = 0;
- void SetGlobalParameter(E3DEngineParameter param, float val) { SetGlobalParameter(param, Vec3(val, 0, 0)); };
-
- // Description:
- // Retrieves global 3d engine parameter.
- virtual void GetGlobalParameter(E3DEngineParameter param, Vec3& v) = 0;
- float GetGlobalParameter(E3DEngineParameter param) { Vec3 v(0, 0, 0); GetGlobalParameter(param, v); return v.x; };
-
- virtual void SetShadowMode(EShadowMode shadowMode) = 0;
- virtual EShadowMode GetShadowMode() const = 0;
- virtual void AddPerObjectShadow(IShadowCaster* pCaster, float fConstBias, float fSlopeBias, float fJitter, const Vec3& vBBoxScale, uint nTexSize) = 0;
- virtual void RemovePerObjectShadow(IShadowCaster* pCaster) = 0;
- virtual struct SPerObjectShadow* GetPerObjectShadow(IShadowCaster* pCaster) = 0;
- virtual void GetCustomShadowMapFrustums(struct ShadowMapFrustum*& arrFrustums, int& nFrustumCount) = 0;
-
- // Description:
- // Saves pStatObj to a stream.
- // Notes:
- // Full mesh for generated ones, path/geom otherwise
- virtual int SaveStatObj(IStatObj* pStatObj, TSerialize ser) = 0;
- // Description:
- // Loads statobj from a stream
- virtual IStatObj* LoadStatObj(TSerialize ser) = 0;
-
- // Description:
- // Returns true if input line segment intersect clouds sprites.
- virtual bool CheckIntersectClouds(const Vec3& p1, const Vec3& p2) = 0;
-
- // Description:
- // Removes references to RenderMesh
- virtual void OnRenderMeshDeleted(IRenderMesh* pRenderMesh) = 0;
-
- // Used to highlight an object under the reticule
- virtual void DebugDraw_UpdateDebugNode() = 0;
-
- // Description:
- // Used by editor during AO computations
- virtual bool RayObjectsIntersection2D(Vec3 vStart, Vec3 vEnd, Vec3& vHitPoint, EERType eERType) = 0;
-
-
- // Description:
- // Used by editor during object alignment
- virtual bool RenderMeshRayIntersection(IRenderMesh* pRenderMesh, SRayHitInfo& hitInfo, _smart_ptr pCustomMtl = 0) = 0;
-
- virtual void CheckCreateRNTmpData(CRNTmpData** ppInfo, IRenderNode* pRNode, const SRenderingPassInfo& passInfo) = 0;
-
- // Description:
- // Frees lod transition state
- virtual void FreeRNTmpData(CRNTmpData** ppInfo) = 0;
-
- // Description:
- // Returns true if the Octree is ready.
- virtual bool IsObjectTreeReady() = 0;
-
- virtual IOctreeNode* GetIObjectTree() = 0;
-
- // Description:
- // Call function 2 times (first to get the size then to fill in the data)
- // Arguments:
- // pObjects - 0 if only the count is required
- // Return Value:
- // Count returned
- virtual uint32 GetObjectsByType(EERType objType, IRenderNode** pObjects = 0) = 0;
- virtual uint32 GetObjectsByTypeInBox(EERType objType, const AABB& bbox, IRenderNode** pObjects = 0, ObjectTreeQueryFilterCallback filterCallback = nullptr) = 0;
- virtual uint32 GetObjectsInBox(const AABB& bbox, IRenderNode** pObjects = 0) = 0;
- virtual uint32 GetObjectsByFlags(uint dwFlag, IRenderNode** pObjects = 0) = 0;
-
- // variant which takes a POD array which is resized in the function itself
- virtual void GetObjectsByTypeInBox(EERType objType, const AABB& bbox, PodArray* pLstObjects, ObjectTreeQueryFilterCallback filterCallback = nullptr) = 0;
-
- // Called from editor whenever an object is modified by the user
- virtual void OnObjectModified(IRenderNode* pRenderNode, uint dwFlags) = 0;
-
- virtual void FillDebugFPSInfo(SDebugFPSInfo&) = 0;
-
- virtual const char* GetLevelFolder() = 0;
-
- virtual bool IsAreaActivationInUse() = 0;
-
- virtual void RenderRenderNode_ShadowPass(IShadowCaster* pRNode, const SRenderingPassInfo& passInfo, AZ::LegacyJobExecutor* pJobExecutor) = 0;
-
- virtual IOpticsManager* GetOpticsManager() = 0;
-
- // Description:
- // Syncs and performs outstanding operations for the Asyncrhon ProcessStreaming Update
- virtual void SyncProcessStreamingUpdate() = 0;
-
- // Set Callback for Editor to store additional information in Minimap tool
- virtual void SetScreenshotCallback(IScreenshotCallback* pCallback) = 0;
-
- // Show/Hide objects by layer (useful for streaming and performance)
- virtual void ActivateObjectsLayer(uint16 nLayerId, bool bActivate, bool bPhys, bool bObjects, bool bStaticLights, const char* pLayerName, IGeneralMemoryHeap* pHeap = NULL, bool bCheckLayerActivation = true) = 0;
-
- // Get object layer memory usage
- virtual void GetLayerMemoryUsage(uint16 nLayerId, ICrySizer* pSizer, int* pNumBrushes, int* pNumDecals) const = 0;
-
- // Collect layer ID's to skip loading objects from these layers, e.g. to skip console specific layers
- virtual void SkipLayerLoading(uint16 nLayerId, bool bClearList) = 0;
-
- // Activate streaming of render node and all sub-components
- virtual void PrecacheRenderNode(IRenderNode* pObj, float fEntDistanceReal) = 0;
-
- virtual IDeferredPhysicsEventManager* GetDeferredPhysicsEventManager() = 0;
-
- virtual void SetStreamableListener(IStreamedObjectListener* pListener) = 0;
-
- // following functions are used by SRenderingPassInfo
- virtual CCamera* GetRenderingPassCamera(const CCamera& rCamera) = 0;
-
- struct SSvoStaticTexInfo
- {
- SSvoStaticTexInfo()
- {
- ZeroStruct(*this);
- }
-
- // SVO data pools
- ITexture* pTexTree;
- ITexture* pTexOpac;
- ITexture* pTexRgb0;
- ITexture* pTexRgb1;
- ITexture* pTexDynl;
- ITexture* pTexRgb2;
- ITexture* pTexRgb3;
- ITexture* pTexNorm;
- ITexture* pTexAldi;
-
- ITexture* pGlobalSpecCM;
-
- float fGlobalSpecCM_Mult;
- int nTexDimXY;
- int nTexDimZ;
- int nBrickSize;
- bool bSvoReady;
- bool bSvoFreeze;
- };
-
- struct SLightTI
- {
- Vec4 vPosR;
- Vec4 vDirF;
- Vec4 vCol;
- float fSortVal;
- class ITexture* pCM;
- };
-
- virtual void GetSvoStaticTextures(I3DEngine::SSvoStaticTexInfo& svoInfo, PodArray* pLightsTI_S, PodArray* pLightsTI_D) = 0;
-
- struct SSvoNodeInfo
- {
- AABB wsBox;
- AABB tcBox;
- int nAtlasOffset;
- };
-
- virtual void GetSvoBricksForUpdate(PodArray& arrNodeInfo, bool getDynamic) = 0;
-
-#if defined(USE_GEOM_CACHES)
- // Summary:
- // Loads a geometry cache from a CAX file.
- // See Also:
- // IGeomCache
- // Arguments:
- // szFileName - CAX Filename - should not be 0 or ""
- // Return Value:
- // A pointer to an object derived from IGeomCache.
- virtual IGeomCache* LoadGeomCache(const char* szFileName) = 0;
-
- // Finds a geom cache created from the given filename
- // See Also:
- // IGeomCache
- // Arguments:
- // szFileName - CAX Filename - should not be 0 or ""
- // Return Value:
- // A pointer to an object derived from IGeomCache.
- virtual IGeomCache* FindGeomCacheByFilename(const char* szFileName) = 0;
-#endif
-
- // Summary:
- // Loads a designer object from a stream of _decoded_ binary node. (Base64Decode)
- // Arguments:
- // szBinaryStream - decoded stream + size
- virtual IStatObj* LoadDesignerObject(int nVersion, const char* szBinaryStream, int size) = 0;
-
- // Summary:
- // Makes sure all queued culling jobs are completely finished.
- // This is useful when adding or removing Components that trigger AZ::Job creation
- // like the terrain system. It is important to complete those jobs before removing
- // such type of components.
- virtual void WaitForCullingJobsCompletion() = 0;
-
- //
-};
-
-#pragma pack(pop)
-
-#include
-
-// state of 3dengine during rendering
-// used to prevent global state
-struct SRenderingPassInfo
-{
- enum EShadowMapType
- {
- SHADOW_MAP_NONE = 0,
- SHADOW_MAP_GSM,
- SHADOW_MAP_LOCAL,
- SHADOW_MAP_CACHED,
- SHADOW_MAP_CACHED_MGPU_COPY
- };
-
- // enum flags to identify which objects to skip for this pass
- enum ESkipRenderingFlags
- {
- SHADOWS = BIT(0),
- ENTITIES = BIT(3),
- WATEROCEAN = BIT(5),
- DECALS = BIT(7),
- MERGED_MESHES = BIT(10),
- ROADS = BIT(13),
- WATER_VOLUMES = BIT(14),
- CLOUDS = BIT(15),
- CUBEMAP_GEN = BIT(16),
- GEOM_CACHES = BIT(17),
- DISABLE_RENDER_CHUNK_MERGE = BIT(18),
-
- // below are precombined flags
- STATIC_OBJECTS = ENTITIES,
- DEFAULT_FLAGS = SHADOWS | ENTITIES | WATEROCEAN | DECALS | MERGED_MESHES | ROADS | WATER_VOLUMES | CLOUDS | GEOM_CACHES,
- DEFAULT_RECURSIVE_FLAGS = ENTITIES | WATEROCEAN | DECALS | MERGED_MESHES | ROADS | WATER_VOLUMES | CLOUDS | GEOM_CACHES
- };
-
- // creating function for RenderingPassInfo, the create functions will fetch all other necessary
- // information like thread id/frame id, etc
- static SRenderingPassInfo CreateGeneralPassRenderingInfo(const CCamera& rCamera, uint32 nRenderingFlags = DEFAULT_FLAGS, bool bAuxWindow = false);
- static SRenderingPassInfo CreateRecursivePassRenderingInfo(const CCamera& rCamera, uint32 nRenderingFlags = DEFAULT_RECURSIVE_FLAGS);
- static SRenderingPassInfo CreateShadowPassRenderingInfo(const CCamera& rCamera, int nLightFlags, int nShadowMapLod, bool bExtendedLod, bool bIsMGPUCopy, uint32* pShadowGenMask, uint32 nSide, uint32 nShadowFrustumID, uint32 nRenderingFlags = DEFAULT_FLAGS);
- static SRenderingPassInfo CreateTempRenderingInfo(const CCamera& rCamera, const SRenderingPassInfo& rPassInfo);
- static SRenderingPassInfo CreateTempRenderingInfo(uint32 nRenderingFlags, const SRenderingPassInfo& rPassInfo);
-
- // state getter
- bool IsGeneralPass() const;
-
- bool IsRecursivePass() const;
- uint32 GetRecursiveLevel() const;
-
- bool IsShadowPass() const;
- bool IsCachedShadowPass() const;
- EShadowMapType GetShadowMapType() const;
- bool IsDisableRenderChunkMerge() const;
-
- bool IsAuxWindow() const;
-
- threadID ThreadID() const;
- void SetThreadID(threadID id) { m_nThreadID = static_cast(id); }
-
- int GetFrameID() const;
- uint32 GetMainFrameID() const;
-
- const CCamera& GetCamera() const;
- bool IsCameraUnderWater() const;
-
- float GetZoomFactor() const;
- float GetInverseZoomFactor() const;
- bool RenderShadows() const;
- bool RenderEntities() const;
- bool RenderWaterOcean() const;
- bool RenderDecals() const;
- bool RenderWaterVolumes() const;
- bool RenderClouds() const;
- bool RenderGeomCaches() const;
-
- bool IsRenderingCubemap() const;
-
- uint32* ShadowGenMaskAddress() const;
- uint32 ShadowFrustumID() const;
- uint8 ShadowFrustumSide() const;
- uint8 ShadowFrustumLod() const;
-
- CRenderView* GetRenderView() const;
-
- SRenderingPassInfo(threadID id)
- {
- SRenderingPassInfo();
- SetThreadID(id);
- m_pRenderView = gEnv->pRenderer->GetRenderViewForThread(id);
- }
-
-private:
-
- // private constructor, creation is only allowed with create functions
- SRenderingPassInfo()
- : pShadowGenMask(NULL)
- , nShadowSide(0)
- , nShadowLod(0)
- , nShadowFrustumId(0)
- , m_bAuxWindow(0)
- , m_nRenderStackLevel(0)
- , m_eShadowMapRendering(static_cast(SHADOW_MAP_NONE))
- , m_bCameraUnderWater(0)
- , m_nRenderingFlags(0)
- , m_fZoomFactor(0.0f)
- , m_pCamera(NULL)
- {
- threadID nThreadID = 0;
- gEnv->pRenderer->EF_Query(EFQ_MainThreadList, nThreadID);
- m_nThreadID = aznumeric_caster(nThreadID);
- m_nRenderFrameID = gEnv->pRenderer->GetFrameID();
- m_nRenderMainFrameID = gEnv->pRenderer->GetFrameID(false);
- m_pRenderView = gEnv->pRenderer->GetRenderViewForThread(m_nThreadID);
- }
-
- void InitRenderingFlags(uint32 nRenderingFlags);
- void SetCamera(const CCamera& cam);
-
- uint8 m_nThreadID;
- uint8 m_nRenderStackLevel;
- uint8 m_eShadowMapRendering; // State flag denoting what type of shadow map is being currently rendered into
- uint8 m_bCameraUnderWater;
-
- uint32 m_nRenderingFlags;
-
- float m_fZoomFactor;
-
- int m_nRenderFrameID;
- uint32 m_nRenderMainFrameID;
-
- const CCamera* m_pCamera;
-
- // Render view used for this rendering pass
- CRenderView* m_pRenderView;
-
- // members used only in shadow pass
- uint32* pShadowGenMask;
- uint32 nShadowFrustumId;
- uint8 nShadowSide : 4;
- uint8 nShadowLod : 4;
- uint8 m_bAuxWindow;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsGeneralPass() const
-{
- return m_nRenderStackLevel == 0 && m_bAuxWindow == 0 && static_cast(m_eShadowMapRendering) == SHADOW_MAP_NONE;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsRecursivePass() const
-{
- return m_nRenderStackLevel > 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline uint32 SRenderingPassInfo::GetRecursiveLevel() const
-{
- return m_nRenderStackLevel;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsShadowPass() const
-{
- return static_cast(m_eShadowMapRendering) != SHADOW_MAP_NONE;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsCachedShadowPass() const
-{
- return IsShadowPass() &&
- (GetShadowMapType() == SRenderingPassInfo::SHADOW_MAP_CACHED ||
- GetShadowMapType() == SRenderingPassInfo::SHADOW_MAP_CACHED_MGPU_COPY);
-}
-///////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo::EShadowMapType SRenderingPassInfo::GetShadowMapType() const
-{
- assert(IsShadowPass());
- return static_cast(m_eShadowMapRendering);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsAuxWindow() const
-{
- return m_bAuxWindow != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline threadID SRenderingPassInfo::ThreadID() const
-{
- return m_nThreadID;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline int SRenderingPassInfo::GetFrameID() const
-{
- return m_nRenderFrameID;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline uint32 SRenderingPassInfo::GetMainFrameID() const
-{
- return m_nRenderMainFrameID;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline const CCamera& SRenderingPassInfo::GetCamera() const
-{
- assert(m_pCamera != NULL);
- return *m_pCamera;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsCameraUnderWater() const
-{
- return m_bCameraUnderWater != 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline float SRenderingPassInfo::GetZoomFactor() const
-{
- return m_fZoomFactor;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline float SRenderingPassInfo::GetInverseZoomFactor() const
-{
- return 1.0f / m_fZoomFactor;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderShadows() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::SHADOWS) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderEntities() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::ENTITIES) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderWaterOcean() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::WATEROCEAN) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderDecals() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::DECALS) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderWaterVolumes() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::WATER_VOLUMES) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderClouds() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::CLOUDS) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::RenderGeomCaches() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::GEOM_CACHES) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsRenderingCubemap() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::CUBEMAP_GEN) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline bool SRenderingPassInfo::IsDisableRenderChunkMerge() const
-{
- return (m_nRenderingFlags& SRenderingPassInfo::DISABLE_RENDER_CHUNK_MERGE) != 0;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline uint32* SRenderingPassInfo::ShadowGenMaskAddress() const
-{
- assert(pShadowGenMask);
- return pShadowGenMask;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline uint32 SRenderingPassInfo::ShadowFrustumID() const
-{
- return nShadowFrustumId;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline uint8 SRenderingPassInfo::ShadowFrustumSide() const
-{
- return nShadowSide;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline uint8 SRenderingPassInfo::ShadowFrustumLod() const
-{
- return nShadowLod;
-}
-////////////////////////////////////////////////////////////////////////////////
-inline CRenderView* SRenderingPassInfo::GetRenderView() const
-{
- return m_pRenderView;
-}
-////////////////////////////////////////////////////////////////////////////////
-inline void SRenderingPassInfo::SetCamera(const CCamera& cam)
-{
- m_pCamera = gEnv->p3DEngine->GetRenderingPassCamera(cam);
- m_bCameraUnderWater = gEnv->p3DEngine->IsUnderWater(cam.GetPosition());
- m_fZoomFactor = 0.2f + 0.8f * (RAD2DEG(cam.GetFov()) / 60.f);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline void SRenderingPassInfo::InitRenderingFlags(uint32 nRenderingFlags)
-{
- m_nRenderingFlags = nRenderingFlags;
-#if (ALLOW_CONST_CVAR_MODIFICATIONS)
- static ICVar* pDefaultMaterial = gEnv->pConsole->GetCVar("e_DefaultMaterial");
- static ICVar* pShadows = gEnv->pConsole->GetCVar("e_Shadows");
- static ICVar* pEntities = gEnv->pConsole->GetCVar("e_Entities");
- static ICVar* pWaterOcean = gEnv->pConsole->GetCVar("e_WaterOcean");
- static ICVar* pDecals = gEnv->pConsole->GetCVar("e_Decals");
- static ICVar* pWaterVolumes = gEnv->pConsole->GetCVar("e_WaterVolumes");
- static ICVar* pClouds = gEnv->pConsole->GetCVar("e_Clouds");
- static ICVar* pGeomCaches = gEnv->pConsole->GetCVar("e_GeomCaches");
-
- if (pShadows->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::SHADOWS;
- }
- if (pEntities->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::ENTITIES;
- }
- if (pWaterOcean->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::WATEROCEAN;
- }
- if (pDecals->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::DECALS;
- }
- if (pWaterVolumes->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::WATER_VOLUMES;
- }
- if (pClouds->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::CLOUDS;
- }
- if (pGeomCaches->GetIVal() == 0)
- {
- m_nRenderingFlags &= ~SRenderingPassInfo::GEOM_CACHES;
- }
-
- // on dedicated server, never render any object at all
- if (gEnv->IsDedicated())
- {
- m_nRenderingFlags = 0;
- }
-#endif // (ALLOW_CONST_CVAR_MODIFICATIONS)
-}
-
-////////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo SRenderingPassInfo::CreateGeneralPassRenderingInfo(const CCamera& rCamera, uint32 nRenderingFlags, bool bAuxWindow)
-{
- static ICVar* pCameraFreeze = gEnv->pConsole->GetCVar("e_CameraFreeze");
-
- // Update Camera only if e_camerafreeze is not set
- const CCamera& rCameraToSet = (pCameraFreeze && pCameraFreeze->GetIVal() != 0) ? gEnv->p3DEngine->GetRenderingCamera() : rCamera;
-
- SRenderingPassInfo passInfo;
- passInfo.SetCamera(rCameraToSet);
- passInfo.InitRenderingFlags(nRenderingFlags);
- passInfo.m_bAuxWindow = bAuxWindow;
-
- return passInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo SRenderingPassInfo::CreateRecursivePassRenderingInfo(const CCamera& rCamera, uint32 nRenderingFlags)
-{
- static ICVar* pRecursionViewDistRatio = gEnv->pConsole->GetCVar("e_RecursionViewDistRatio");
-
- SRenderingPassInfo passInfo;
- passInfo.m_nRenderStackLevel = 1;
- passInfo.SetCamera(rCamera);
-
- // adjust view distance in recursive mode by adjusting the ZoomFactor
- passInfo.m_fZoomFactor /= pRecursionViewDistRatio->GetFVal();
-
- passInfo.InitRenderingFlags(nRenderingFlags);
-
- return passInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo SRenderingPassInfo::CreateShadowPassRenderingInfo(const CCamera& rCamera, int nLightFlags, int nShadowMapLod, bool bExtendedLod, bool bIsMGPUCopy, uint32* pShadowGenMask, uint32 nSide, uint32 nShadowFrustumID, uint32 nRenderingFlags)
-{
- SRenderingPassInfo passInfo;
- passInfo.SetCamera(rCamera);
- passInfo.InitRenderingFlags(nRenderingFlags);
-
- // set correct shadow map type
- if (nLightFlags & DLF_SUN)
- {
- assert(nShadowMapLod >= 0 && nShadowMapLod < 8);
- if (bExtendedLod)
- {
- passInfo.m_eShadowMapRendering = bIsMGPUCopy ? static_cast(SHADOW_MAP_CACHED_MGPU_COPY) : static_cast(SHADOW_MAP_CACHED);
- }
- else
- {
- passInfo.m_eShadowMapRendering = static_cast(SHADOW_MAP_GSM);
- }
- }
- else if (nLightFlags & (DLF_POINT | DLF_PROJECT | DLF_AREA_LIGHT))
- {
- passInfo.m_eShadowMapRendering = static_cast(SHADOW_MAP_LOCAL);
- }
- else
- {
- passInfo.m_eShadowMapRendering = static_cast(SHADOW_MAP_NONE);
- }
-
- passInfo.pShadowGenMask = pShadowGenMask;
- passInfo.nShadowSide = nSide;
- passInfo.nShadowLod = nShadowMapLod;
- passInfo.nShadowFrustumId = nShadowFrustumID;
-
- return passInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo SRenderingPassInfo::CreateTempRenderingInfo(const CCamera& rCamera, const SRenderingPassInfo& rPassInfo)
-{
- SRenderingPassInfo passInfo = rPassInfo;
- passInfo.SetCamera(rCamera);
-
- passInfo.pShadowGenMask = NULL;
- passInfo.nShadowSide = 0;
- passInfo.nShadowFrustumId = 0;
-
- return passInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRenderingPassInfo SRenderingPassInfo::CreateTempRenderingInfo(uint32 nRenderingFlags, const SRenderingPassInfo& rPassInfo)
-{
- SRenderingPassInfo passInfo = rPassInfo;
- passInfo.m_nRenderingFlags = nRenderingFlags;
- return passInfo;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// class to wrap a special counter used to presort SRendItems
-// this is used to fix random ordering introduced by parallelization
-// of parts of the 3DEngine
-struct SRendItemSorter
-{
- // Deferred PreProcess needs a special ordering, use these to prefix the values
- // to ensure the deferred shading pass is after all LPV objects
- enum EDeferredPreprocess
- {
- eLPVPass = 0,
- eDeferredShadingPass = BIT(30)
- };
-
- static SRendItemSorter CreateRendItemSorter(const SRenderingPassInfo& passInfo);
- static SRendItemSorter CreateShadowPassRendItemSorter(const SRenderingPassInfo& passInfo);
- static SRendItemSorter CreateParticleRendItemSorter(const SRenderingPassInfo& passInfo);
- static SRendItemSorter CreateDeferredPreProcessRendItemSorter(const SRenderingPassInfo& passInfo, EDeferredPreprocess deferredPrerocessType);
- static SRendItemSorter CreateDefaultRendItemSorter();
-
- void IncreaseOctreeCounter() { nValue += eOctreeNodeCounter; }
- void IncreaseObjectCounter() { nValue += eObjectCounter; }
- void IncreaseGroupCounter() { nValue += eGroupCounter; }
-
- void IncreaseParticleCounter() { nValue += eParticleCounter; }
- uint32 ParticleCounter() const { return nValue & ~eRecursivePassMask; }
-
- uint32 ShadowFrustumID() const { return nValue & ~eRecursivePassMask; }
-
- uint32 GetValue() const { return nValue; }
-
- bool operator<(const SRendItemSorter& rOther) const
- {
- return nValue < rOther.nValue;
- }
-
- bool IsRecursivePass() const { return (nValue & eRecursivePassMask) != 0; }
-
- SRendItemSorter()
- : nValue(0) {}
- explicit SRendItemSorter(uint32 _nValue)
- : nValue(_nValue) {}
-
-private:
- // encode various counter in a single value
- enum
- {
- eRecursivePassMask = BIT(31)
- }; // present in all combinations
-
- // flags used for regular SRendItems
- enum
- {
- eObjectCounter = BIT(0)
- }; // bits 0-14 used
- enum
- {
- eOctreeNodeCounter = BIT(14)
- }; // bits 15-27 used
- enum
- {
- eGroupCounter = BIT(27)
- }; // bits 28-31 used
-
- // flags used for Particles
- enum
- {
- eParticleCounter = BIT(0)
- };
-
- uint32 nValue;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRendItemSorter SRendItemSorter::CreateRendItemSorter(const SRenderingPassInfo& passInfo)
-{
- SRendItemSorter rendItemSorter;
- rendItemSorter.nValue = 0;
- rendItemSorter.nValue |= passInfo.IsRecursivePass() ? eRecursivePassMask : 0;
- return rendItemSorter;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRendItemSorter SRendItemSorter::CreateShadowPassRendItemSorter(const SRenderingPassInfo& passInfo)
-{
- SRendItemSorter rendItemSorter;
- rendItemSorter.nValue = passInfo.ShadowFrustumID();
- rendItemSorter.nValue |= passInfo.IsRecursivePass() ? eRecursivePassMask : 0;
- return rendItemSorter;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRendItemSorter SRendItemSorter::CreateParticleRendItemSorter(const SRenderingPassInfo& passInfo)
-{
- SRendItemSorter rendItemSorter;
- rendItemSorter.nValue = 0;
- rendItemSorter.nValue |= passInfo.IsRecursivePass() ? eRecursivePassMask : 0;
- return rendItemSorter;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRendItemSorter SRendItemSorter::CreateDeferredPreProcessRendItemSorter(const SRenderingPassInfo& passInfo, EDeferredPreprocess deferredPrerocessType)
-{
- SRendItemSorter rendItemSorter;
- rendItemSorter.nValue = 0;
- rendItemSorter.nValue |= passInfo.IsRecursivePass() ? eRecursivePassMask : 0;
- rendItemSorter.nValue |= deferredPrerocessType;
- return rendItemSorter;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-inline SRendItemSorter SRendItemSorter::CreateDefaultRendItemSorter()
-{
- SRendItemSorter rendItemSorter;
- rendItemSorter.nValue = 0;
- return rendItemSorter;
-}
-
-//Legacy Bus for communicating with SVOGI from the legacy engine code.
-class SVOGILegacyRequests
- : public AZ::EBusTraits
-{
-public:
- //////////////////////////////////////////////////////////////////////////
- // EBusTraits overrides
- static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
- static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
- using MutexType = AZStd::recursive_mutex;
-// static const bool LocklessDispatch = true;
- //////////////////////////////////////////////////////////////////////////
-
- //////////////////////////////////////////////////////////////////////////
- // Triggers an update of voxel data.
- virtual void UpdateVoxelData() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Triggers an update of voxel data to GPU.
- virtual void UpdateRenderData() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Called at framestart
- virtual void OnFrameStart(const SRenderingPassInfo& passInfo) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Gets the textures bound for GI plus lighting data.
- virtual void GetSvoStaticTextures(I3DEngine::SSvoStaticTexInfo& svoInfo, PodArray* pLightsTI_S, PodArray* pLightsTI_D) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Generates a list of bricks that need to be updated in compute shaders.
- virtual void GetSvoBricksForUpdate(PodArray& arrNodeInfo, bool getDynamic) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Causes the GI system to free all voxel data.
- virtual void ReleaseData() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Register and unregister a mutex to protect assets during rendering.
- virtual void RegisterMutex(AZStd::mutex* mutex) = 0;
- virtual void UnregisterMutex() = 0;
-
-};
-using SVOGILegacyRequestBus = AZ::EBus;
-
-
-#endif // CRYINCLUDE_CRYCOMMON_I3DENGINE_H
-
diff --git a/Code/CryEngine/CryCommon/I3DEngine_info.h b/Code/CryEngine/CryCommon/I3DEngine_info.h
deleted file mode 100644
index f1c601fcc6..0000000000
--- a/Code/CryEngine/CryCommon/I3DEngine_info.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-#ifndef CRYINCLUDE_CRYCOMMON_I3DENGINE_INFO_H
-#define CRYINCLUDE_CRYCOMMON_I3DENGINE_INFO_H
-#pragma once
-
-#include "TypeInfo_impl.h"
-#include "IShader_info.h"
-#include // <> required for Interfuscator
-
-STRUCT_INFO_BEGIN(SVisAreaManChunkHeader)
-STRUCT_VAR_INFO(nVersion, TYPE_INFO(int8))
-STRUCT_VAR_INFO(nDummy, TYPE_INFO(int8))
-STRUCT_VAR_INFO(nFlags, TYPE_INFO(int8))
-STRUCT_VAR_INFO(nFlags2, TYPE_INFO(int8))
-STRUCT_VAR_INFO(nChunkSize, TYPE_INFO(int))
-STRUCT_VAR_INFO(nVisAreasNum, TYPE_INFO(int))
-STRUCT_VAR_INFO(nPortalsNum, TYPE_INFO(int))
-STRUCT_VAR_INFO(nOcclAreasNum, TYPE_INFO(int))
-STRUCT_INFO_END(SVisAreaManChunkHeader)
-
-STRUCT_INFO_BEGIN(SOcTreeNodeChunk)
-STRUCT_VAR_INFO(nChunkVersion, TYPE_INFO(int16))
-STRUCT_VAR_INFO(ucChildsMask, TYPE_INFO(int16))
-STRUCT_VAR_INFO(nodeBox, TYPE_INFO(AABB))
-STRUCT_VAR_INFO(nObjectsBlockSize, TYPE_INFO(int32))
-STRUCT_INFO_END(SOcTreeNodeChunk)
-
-STRUCT_INFO_BEGIN(SHotUpdateInfo)
-STRUCT_VAR_INFO(nHeigtmap, TYPE_INFO(uint32))
-STRUCT_VAR_INFO(nObjTypeMask, TYPE_INFO(uint32))
-STRUCT_VAR_INFO(areaBox, TYPE_INFO(AABB))
-STRUCT_INFO_END(SHotUpdateInfo)
-
-STRUCT_INFO_BEGIN(SCommonFileHeader)
-STRUCT_VAR_INFO(signature, TYPE_ARRAY(4, TYPE_INFO(char)))
-STRUCT_VAR_INFO(file_type, TYPE_INFO(uint8))
-STRUCT_VAR_INFO(flags, TYPE_INFO(uint8))
-STRUCT_VAR_INFO(version, TYPE_INFO(uint16))
-STRUCT_INFO_END(SCommonFileHeader)
-
-#endif // CRYINCLUDE_CRYCOMMON_I3DENGINE_INFO_H
diff --git a/Code/CryEngine/CryCommon/IEntityRenderState.h b/Code/CryEngine/CryCommon/IEntityRenderState.h
index 92ff354eff..29b1bdc463 100644
--- a/Code/CryEngine/CryCommon/IEntityRenderState.h
+++ b/Code/CryEngine/CryCommon/IEntityRenderState.h
@@ -286,7 +286,6 @@ struct IRenderNode
// Physicalizes node.
virtual void Physicalize([[maybe_unused]] bool bInstant = false) {}
- // Make sure I3DEngine::FreeRenderNodeState(this) is called in destructor of derived class.
virtual ~IRenderNode() { assert(!m_pRNTmpData); };
// Summary:
diff --git a/Code/CryEngine/CryCommon/ILocalMemoryUsage.h b/Code/CryEngine/CryCommon/ILocalMemoryUsage.h
deleted file mode 100644
index fd1e7e3693..0000000000
--- a/Code/CryEngine/CryCommon/ILocalMemoryUsage.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-// Description : Interface for LocalMemoryUsage
-
-
-#ifndef CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
-#define CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
-#pragma once
-
-
-class CCamera;
-struct IRenderer;
-
-struct ILocalMemoryUsage
-{
- virtual ~ILocalMemoryUsage(){}
- virtual void OnRender(IRenderer* pRenderer, const CCamera* camera) = 0;
- virtual void OnUpdate() = 0;
- virtual void DeleteGlobalData() = 0;
-};
-
-#endif // CRYINCLUDE_CRYCOMMON_ILOCALMEMORYUSAGE_H
diff --git a/Code/CryEngine/CryCommon/IMaterial.h b/Code/CryEngine/CryCommon/IMaterial.h
index 81d612397f..020ddcc871 100644
--- a/Code/CryEngine/CryCommon/IMaterial.h
+++ b/Code/CryEngine/CryCommon/IMaterial.h
@@ -273,7 +273,7 @@ struct IMaterial
//////////////////////////////////////////////////////////////////////////
// material name
//////////////////////////////////////////////////////////////////////////
- //! Set material name, (Do not use this directly, to change material name use I3DEngine::RenameMatInfo method).
+ //! Set material name, (Do not use this directly
virtual void SetName(const char* pName) = 0;
//! Returns material name.
virtual const char* GetName() const = 0;
@@ -404,7 +404,6 @@ struct IMaterial
//////////////////////////////////////////////////////////////////////////
// Makes this specific material enter sketch mode.
- // Se also: I3DEngine::LoadCGF, in I3DEngine.h.
// Current supported sketch modes:
// - 0, no sketch.
// - 1, normal sketch mode.
diff --git a/Code/CryEngine/CryCommon/IMovieSystem.h b/Code/CryEngine/CryCommon/IMovieSystem.h
index c22394e1b3..ce4e59d43c 100644
--- a/Code/CryEngine/CryCommon/IMovieSystem.h
+++ b/Code/CryEngine/CryCommon/IMovieSystem.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/Code/CryEngine/CryCommon/IObjManager.h b/Code/CryEngine/CryCommon/IObjManager.h
index acbd5c5d18..a63a252976 100644
--- a/Code/CryEngine/CryCommon/IObjManager.h
+++ b/Code/CryEngine/CryCommon/IObjManager.h
@@ -202,7 +202,6 @@ struct IObjManager
// time counters
virtual bool IsAfterWater(const Vec3& vPos, const SRenderingPassInfo& passInfo) = 0;
- virtual void GetObjectsStreamingStatus(I3DEngine::SObjectsStreamingStatus& outStatus) = 0;
virtual void FreeNotUsedCGFs() = 0;
virtual void MakeUnitCube() = 0;
diff --git a/Code/CryEngine/CryCommon/ISystem.h b/Code/CryEngine/CryCommon/ISystem.h
index 9b1e817602..96d9a6ad10 100644
--- a/Code/CryEngine/CryCommon/ISystem.h
+++ b/Code/CryEngine/CryCommon/ISystem.h
@@ -66,7 +66,6 @@ struct IConsole;
struct IRemoteConsole;
struct IRenderer;
struct IProcess;
-struct I3DEngine;
struct ITimer;
struct ICryFont;
struct IMovieSystem;
@@ -123,8 +122,6 @@ namespace Serialization {
struct IArchiveHost;
}
-struct ILocalMemoryUsage;
-
typedef void* WIN_HWND;
class CCamera;
@@ -793,7 +790,6 @@ struct SSystemUpdateStats
// ISystem
struct SSystemGlobalEnvironment
{
- I3DEngine* p3DEngine;
AZ::IO::IArchive* pCryPak;
AZ::IO::FileIOBase* pFileIO;
IFileChangeMonitor* pFileChangeMonitor;
@@ -801,7 +797,6 @@ struct SSystemGlobalEnvironment
IOpticsManager* pOpticsManager;
ITimer* pTimer;
ICryFont* pCryFont;
- ILocalMemoryUsage* pLocalMemoryUsage;
::IConsole* pConsole;
ISystem* pSystem = nullptr;
ILog* pLog;
@@ -1113,25 +1108,9 @@ struct ISystem
virtual void DoWorkDuringOcclusionChecks() = 0;
virtual bool NeedDoWorkDuringOcclusionChecks() = 0;
- // Summary:
- // Renders subsystems.
- virtual void Render() = 0;
- // Summary:
- // Begins rendering frame.
- virtual void RenderBegin() = 0;
- // Summary:
- // Ends rendering frame and swap back buffer.
- virtual void RenderEnd(bool bRenderStats = true, bool bMainWindow = true) = 0;
-
//! Update screen and call some important tick functions during loading.
virtual void SynchronousLoadingTick(const char* pFunc, int line) = 0;
- // Description:
- // Renders the statistics; this is called from RenderEnd, but if the
- // Host application (Editor) doesn't employ the Render cycle in ISystem,
- // it may call this method to render the essential statistics.
- virtual void RenderStatistics() = 0;
-
// Summary:
// Returns the current used memory.
virtual uint32 GetUsedMemory() = 0;
@@ -1229,7 +1208,6 @@ struct ISystem
virtual ICryFont* GetICryFont() = 0;
virtual IMemoryManager* GetIMemoryManager() = 0;
virtual IMovieSystem* GetIMovieSystem() = 0;
- virtual I3DEngine* GetI3DEngine() = 0;
virtual ::IConsole* GetIConsole() = 0;
virtual IRemoteConsole* GetIRemoteConsole() = 0;
// Returns:
diff --git a/Code/CryEngine/CryCommon/ITimeOfDay.h b/Code/CryEngine/CryCommon/ITimeOfDay.h
deleted file mode 100644
index b491ea9359..0000000000
--- a/Code/CryEngine/CryCommon/ITimeOfDay.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-#pragma once
-
-struct SBezierKey;
-struct ITimeOfDayUpdateCallback;
-struct ISplineInterpolator;
-
-
-//! Interface to the Time Of Day functionality.
-struct ITimeOfDay
-{
- enum ETimeOfDayParamID
- {
- PARAM_SUN_COLOR,
- PARAM_SUN_INTENSITY,
- PARAM_SUN_SPECULAR_MULTIPLIER,
-
- PARAM_FOG_COLOR,
- PARAM_FOG_COLOR_MULTIPLIER,
- PARAM_VOLFOG_HEIGHT,
- PARAM_VOLFOG_DENSITY,
- PARAM_FOG_COLOR2,
- PARAM_FOG_COLOR2_MULTIPLIER,
- PARAM_VOLFOG_HEIGHT2,
- PARAM_VOLFOG_DENSITY2,
- PARAM_VOLFOG_HEIGHT_OFFSET,
-
- PARAM_FOG_RADIAL_COLOR,
- PARAM_FOG_RADIAL_COLOR_MULTIPLIER,
- PARAM_VOLFOG_RADIAL_SIZE,
- PARAM_VOLFOG_RADIAL_LOBE,
-
- PARAM_VOLFOG_FINAL_DENSITY_CLAMP,
-
- PARAM_VOLFOG_GLOBAL_DENSITY,
- PARAM_VOLFOG_RAMP_START,
- PARAM_VOLFOG_RAMP_END,
- PARAM_VOLFOG_RAMP_INFLUENCE,
-
- PARAM_VOLFOG_SHADOW_DARKENING,
- PARAM_VOLFOG_SHADOW_DARKENING_SUN,
- PARAM_VOLFOG_SHADOW_DARKENING_AMBIENT,
- PARAM_VOLFOG_SHADOW_RANGE,
-
- PARAM_VOLFOG2_HEIGHT,
- PARAM_VOLFOG2_DENSITY,
- PARAM_VOLFOG2_HEIGHT2,
- PARAM_VOLFOG2_DENSITY2,
- PARAM_VOLFOG2_GLOBAL_DENSITY,
- PARAM_VOLFOG2_RAMP_START,
- PARAM_VOLFOG2_RAMP_END,
- PARAM_VOLFOG2_COLOR1,
- PARAM_VOLFOG2_ANISOTROPIC1,
- PARAM_VOLFOG2_COLOR2,
- PARAM_VOLFOG2_ANISOTROPIC2,
- PARAM_VOLFOG2_BLEND_FACTOR,
- PARAM_VOLFOG2_BLEND_MODE,
- PARAM_VOLFOG2_COLOR,
- PARAM_VOLFOG2_ANISOTROPIC,
- PARAM_VOLFOG2_RANGE,
- PARAM_VOLFOG2_INSCATTER,
- PARAM_VOLFOG2_EXTINCTION,
- PARAM_VOLFOG2_GLOBAL_FOG_VISIBILITY,
- PARAM_VOLFOG2_FINAL_DENSITY_CLAMP,
-
- PARAM_SKYLIGHT_SUN_INTENSITY,
- PARAM_SKYLIGHT_SUN_INTENSITY_MULTIPLIER,
-
- PARAM_SKYLIGHT_KM,
- PARAM_SKYLIGHT_KR,
- PARAM_SKYLIGHT_G,
-
- PARAM_SKYLIGHT_WAVELENGTH_R,
- PARAM_SKYLIGHT_WAVELENGTH_G,
- PARAM_SKYLIGHT_WAVELENGTH_B,
-
- PARAM_NIGHSKY_HORIZON_COLOR,
- PARAM_NIGHSKY_HORIZON_COLOR_MULTIPLIER,
- PARAM_NIGHSKY_ZENITH_COLOR,
- PARAM_NIGHSKY_ZENITH_COLOR_MULTIPLIER,
- PARAM_NIGHSKY_ZENITH_SHIFT,
-
- PARAM_NIGHSKY_START_INTENSITY,
-
- PARAM_NIGHSKY_MOON_COLOR,
- PARAM_NIGHSKY_MOON_COLOR_MULTIPLIER,
- PARAM_NIGHSKY_MOON_INNERCORONA_COLOR,
- PARAM_NIGHSKY_MOON_INNERCORONA_COLOR_MULTIPLIER,
- PARAM_NIGHSKY_MOON_INNERCORONA_SCALE,
- PARAM_NIGHSKY_MOON_OUTERCORONA_COLOR,
- PARAM_NIGHSKY_MOON_OUTERCORONA_COLOR_MULTIPLIER,
- PARAM_NIGHSKY_MOON_OUTERCORONA_SCALE,
-
- PARAM_CLOUDSHADING_SUNLIGHT_MULTIPLIER,
- PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR,
- PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR_MULTIPLIER,
- PARAM_CLOUDSHADING_SUNLIGHT_CUSTOM_COLOR_INFLUENCE,
-
- PARAM_SUN_SHAFTS_VISIBILITY,
- PARAM_SUN_RAYS_VISIBILITY,
- PARAM_SUN_RAYS_ATTENUATION,
- PARAM_SUN_RAYS_SUNCOLORINFLUENCE,
- PARAM_SUN_RAYS_CUSTOMCOLOR,
-
- PARAM_OCEANFOG_COLOR, // Remove when ocean related feature toggle is removed.
- PARAM_OCEANFOG_COLOR_MULTIPLIER, // Remove when ocean related feature toggle is removed.
- PARAM_OCEANFOG_DENSITY, // Remove when ocean related feature toggle is removed.
-
- PARAM_SKYBOX_MULTIPLIER,
-
- PARAM_HDR_FILMCURVE_SHOULDER_SCALE,
- PARAM_HDR_FILMCURVE_LINEAR_SCALE,
- PARAM_HDR_FILMCURVE_TOE_SCALE,
- PARAM_HDR_FILMCURVE_WHITEPOINT,
-
- PARAM_HDR_COLORGRADING_COLOR_SATURATION,
- PARAM_HDR_COLORGRADING_COLOR_BALANCE,
-
- PARAM_HDR_EYEADAPTATION_SCENEKEY,
- PARAM_HDR_EYEADAPTATION_MIN_EXPOSURE,
- PARAM_HDR_EYEADAPTATION_MAX_EXPOSURE,
- PARAM_HDR_EYEADAPTATION_EV_MIN,
- PARAM_HDR_EYEADAPTATION_EV_MAX,
- PARAM_HDR_EYEADAPTATION_EV_AUTO_COMPENSATION,
- PARAM_HDR_BLOOM_AMOUNT,
-
- PARAM_COLORGRADING_FILTERS_GRAIN,
- PARAM_COLORGRADING_FILTERS_PHOTOFILTER_COLOR,
- PARAM_COLORGRADING_FILTERS_PHOTOFILTER_DENSITY,
-
- PARAM_COLORGRADING_DOF_FOCUSRANGE,
- PARAM_COLORGRADING_DOF_BLURAMOUNT,
-
- PARAM_SHADOWSC0_BIAS,
- PARAM_SHADOWSC0_SLOPE_BIAS,
- PARAM_SHADOWSC1_BIAS,
- PARAM_SHADOWSC1_SLOPE_BIAS,
- PARAM_SHADOWSC2_BIAS,
- PARAM_SHADOWSC2_SLOPE_BIAS,
- PARAM_SHADOWSC3_BIAS,
- PARAM_SHADOWSC3_SLOPE_BIAS,
- PARAM_SHADOWSC4_BIAS,
- PARAM_SHADOWSC4_SLOPE_BIAS,
- PARAM_SHADOWSC5_BIAS,
- PARAM_SHADOWSC5_SLOPE_BIAS,
- PARAM_SHADOWSC6_BIAS,
- PARAM_SHADOWSC6_SLOPE_BIAS,
- PARAM_SHADOWSC7_BIAS,
- PARAM_SHADOWSC7_SLOPE_BIAS,
-
- PARAM_SHADOW_JITTERING,
-
- PARAM_HDR_DYNAMIC_POWER_FACTOR,
- PARAM_TERRAIN_OCCL_MULTIPLIER,
- PARAM_SUN_COLOR_MULTIPLIER,
-
- PARAM_TOTAL
- };
-
- struct SPresetInfo
- {
- const char* m_pName;
- bool m_bCurrent;
- };
-
- enum EVariableType
- {
- TYPE_FLOAT,
- TYPE_COLOR
- };
- struct SVariableInfo
- {
- const char* name; //!< Variable name.
- const char* displayName; //!< Variable user readable name.
- const char* group; //!< Group name.
- int nParamId;
- EVariableType type;
- float fValue[3]; //!< Value of the variable (3 needed for color type).
- ISplineInterpolator* pInterpolator; //!< Splines that control variable value.
- };
- struct SAdvancedInfo
- {
- float fStartTime;
- float fEndTime;
- float fAnimSpeed;
- };
- struct SEnvironmentInfo
- {
- SEnvironmentInfo()
- : bSunLinkedToTOD(true)
- , sunRotationLatitude(0)
- , sunRotationLongitude(0){}
- bool bSunLinkedToTOD;
- float sunRotationLatitude;
- float sunRotationLongitude;
- };
-
- //
- virtual ~ITimeOfDay(){}
-
- virtual int GetPresetCount() const = 0;
- virtual bool GetPresetsInfos(SPresetInfo* resultArray, unsigned int arraySize) const = 0;
- virtual bool SetCurrentPreset(const char* szPresetName) = 0;
- virtual bool AddNewPreset(const char* szPresetName) = 0;
- virtual bool RemovePreset(const char* szPresetName) = 0;
- virtual bool SavePreset(const char* szPresetName) const = 0;
- virtual bool LoadPreset(const char* szFilePath) = 0;
- virtual void ResetPreset(const char* szPresetName) = 0;
-
- virtual bool ImportPreset(const char* szPresetName, const char* szFilePath) = 0;
- virtual bool ExportPreset(const char* szPresetName, const char* szFilePath) const = 0;
-
- //! Access to variables that control time of the day appearance.
- virtual int GetVariableCount() const = 0;
- virtual bool GetVariableInfo(int nIndex, SVariableInfo& varInfo) const = 0;
- virtual void SetVariableValue(int nIndex, float fValue[3]) = 0;
-
- //! Editor interface.
- virtual bool InterpolateVarInRange(int nIndex, float fMin, float fMax, unsigned int nCount, Vec3* resultArray) const = 0;
- virtual uint GetSplineKeysCount(int nIndex, int nSpline) const = 0;
- virtual bool GetSplineKeysForVar(int nIndex, int nSpline, SBezierKey* keysArray, unsigned int keysArraySize) const = 0;
- virtual bool SetSplineKeysForVar(int nIndex, int nSpline, const SBezierKey* keysArray, unsigned int keysArraySize) = 0;
- virtual bool UpdateSplineKeyForVar(int nIndex, int nSpline, float fTime, float newValue) = 0;
-
- virtual void ResetVariables() = 0;
-
- //! Sets the time of the day specified in hours.
- virtual void SetTime(float fHour, bool bForceUpdate = false, bool bForceEnvUpdate = true) = 0;
- virtual float GetTime() = 0;
-
- //! Sun position.
- virtual void SetSunPos(float longitude, float latitude) = 0;
- virtual float GetSunLatitude() = 0;
- virtual float GetSunLongitude() = 0;
-
- //! Updates the current ToD.
- virtual void Tick() = 0;
-
-
- virtual void SetPaused(bool paused) = 0;
-
- virtual void SetAdvancedInfo(const SAdvancedInfo& advInfo) = 0;
- virtual void GetAdvancedInfo(SAdvancedInfo& advInfo) = 0;
-
- //! Updates engine parameters after variable values have been changed.
- virtual void Update(bool bInterpolate = true, bool bForceUpdate = false, bool bForceEnvUpdate = true) = 0;
- virtual void SetUpdateCallback(ITimeOfDayUpdateCallback* pCallback) = 0;
-
- virtual void BeginEditMode() = 0;
- virtual void EndEditMode() = 0;
-
- virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
- virtual void Serialize(TSerialize ser) = 0;
-
- virtual void SetTimer(ITimer* pTimer) = 0;
- virtual void SetEnvironmentSettings(const SEnvironmentInfo& envInfo) = 0;
- virtual void LerpWith(const ITimeOfDay& other, float lerpValue, ITimeOfDay& output) const = 0;
-
- //! Multiplayer serialization.
- static const int NETSER_FORCESET = BIT(0);
- static const int NETSER_COMPENSATELAG = BIT(1);
- static const int NETSER_STATICPROPS = BIT(2);
- virtual void NetSerialize(TSerialize ser, float lag, uint32 flags) = 0;
-};
-
-struct ITimeOfDayUpdateCallback
-{
- //
- virtual ~ITimeOfDayUpdateCallback(){}
- virtual void BeginUpdate() = 0;
- virtual bool GetCustomValue(ITimeOfDay::ETimeOfDayParamID paramID, int dim, float* pValues, float& blendWeight) = 0;
- virtual void EndUpdate() = 0;
- //
-};
-
diff --git a/Code/CryEngine/CryCommon/Mocks/I3DEngineMock.h b/Code/CryEngine/CryCommon/Mocks/I3DEngineMock.h
deleted file mode 100644
index b0936ddbdd..0000000000
--- a/Code/CryEngine/CryCommon/Mocks/I3DEngineMock.h
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-#pragma once
-
-#include
-
-#include
-#include
-#include
-
-// the following was generated using google's python script to autogenerate mocks.
-// however, it needed some hand-editing to make it work, so if you add functions to I3DEngine,
-// it will probably be better to just manually add them here than try to run the script again.
-
-class I3DEngineMock
- : public I3DEngine
-{
-public:
- // From IProcess
- MOCK_METHOD1(SetFlags,
- void(int));
- MOCK_METHOD0(GetFlags,
- int(void));
-
- // From I3DEngine
- MOCK_METHOD0(Init,
- bool());
- MOCK_METHOD1(SetLevelPath,
- void(const char* szFolderName));
- MOCK_METHOD1(CheckMinSpec,
- bool(uint32 nMinSpec));
- MOCK_METHOD1(PrepareOcclusion,
- void(const CCamera& rCamera));
- MOCK_METHOD0(EndOcclusion,
- void());
- MOCK_METHOD2(LoadLevel,
- bool(const char* szFolderName, const char* szMissionName));
- MOCK_METHOD2(InitLevelForEditor,
- bool(const char* szFolderName, const char* szMissionName));
- MOCK_METHOD0(LevelLoadingInProgress,
- bool());
- MOCK_METHOD0(OnFrameStart,
- void());
- MOCK_METHOD0(PostLoadLevel,
- void());
- MOCK_METHOD0(LoadEmptyLevel,
- void());
- MOCK_METHOD0(UnloadLevel,
- void());
- MOCK_METHOD0(Update,
- void());
- MOCK_CONST_METHOD0(GetRenderingCamera,
- const CCamera&());
- MOCK_CONST_METHOD0(GetZoomFactor,
- float());
- MOCK_METHOD0(Tick,
- void());
- MOCK_METHOD0(UpdateShaderItems,
- void());
- MOCK_METHOD0(Release,
- void());
- MOCK_METHOD3(RenderWorld,
- void(int nRenderFlags, const SRenderingPassInfo& passInfo, const char* szDebugName));
- MOCK_METHOD2(RenderSceneReflection,
- void(int nRenderFlags, const SRenderingPassInfo& passInfo));
- MOCK_METHOD1(PreWorldStreamUpdate,
- void(const CCamera& cam));
- MOCK_METHOD0(WorldStreamUpdate,
- void());
- MOCK_METHOD0(ShutDown,
- void());
- MOCK_METHOD7(LoadStatObjUnsafeManualRef,
- IStatObj*(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
- bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
- MOCK_METHOD7(LoadStatObjAutoRef,
- _smart_ptr(const char* fileName, const char* geomName, IStatObj::SSubObject** subObject,
- bool useStreaming, unsigned long loadingFlags, const void* data, int dataSize));
- MOCK_METHOD0(ProcessAsyncStaticObjectLoadRequests,
- void());
- MOCK_METHOD5(LoadStatObjAsync,
- void(LoadStaticObjectAsyncResult resultCallback, const char* szFileName, const char* szGeomName, bool bUseStreaming, unsigned long nLoadingFlags));
- MOCK_METHOD1(FindStatObjectByFilename,
- IStatObj*(const char* filename));
- MOCK_METHOD0(GetGSMRange,
- const float());
- MOCK_METHOD0(GetGSMRangeStep,
- const float());
- MOCK_METHOD0(GetLoadedObjectCount,
- int());
- MOCK_METHOD2(GetLoadedStatObjArray,
- void(IStatObj** pObjectsArray, int& nCount));
- MOCK_METHOD1(GetObjectsStreamingStatus,
- void(SObjectsStreamingStatus& outStatus));
- MOCK_METHOD2(GetStreamingSubsystemData,
- void(int subsystem, SStremaingBandwidthData& outData));
- MOCK_METHOD3(RegisterEntity,
- void(IRenderNode* pEntity, int nSID, int nSIDConsideredSafe));
- MOCK_METHOD1(SelectEntity,
- void(IRenderNode* pEntity));
- MOCK_METHOD0(IsSunShadows,
- bool());
- MOCK_METHOD2(MakeSystemMaterialFromShaderHelper
- , _smart_ptr(const char* sShaderName, SInputShaderResources* Res));
- MOCK_METHOD1(CheckMinSpecHelper
- , bool(uint32 nMinSpec));
- MOCK_METHOD1(OnCasterDeleted
- , void(IShadowCaster* pCaster));
- MOCK_METHOD4(GetStatObjAndMatTables,
- void(DynArray* pStatObjTable, DynArray<_smart_ptr>* pMatTable, DynArray* pStatInstGroupTable, uint32 nObjTypeMask));
-#ifndef _RELEASE
- MOCK_METHOD1(AddObjToDebugDrawList,
- void(SObjectInfoToAddToDebugDrawList& objInfo));
- MOCK_CONST_METHOD0(IsDebugDrawListEnabled,
- bool());
-#endif
- MOCK_METHOD1(UnRegisterEntityDirect,
- void(IRenderNode* pEntity));
- MOCK_METHOD1(UnRegisterEntityAsJob,
- void(IRenderNode* pEnt));
- MOCK_CONST_METHOD1(IsUnderWater,
- bool(const Vec3& vPos));
- MOCK_METHOD1(SetOceanRenderFlags,
- void(uint8 nFlags));
- MOCK_CONST_METHOD0(GetOceanRenderFlags,
- uint8());
- MOCK_CONST_METHOD0(GetOceanVisiblePixelsCount,
- uint32());
- MOCK_METHOD3(GetBottomLevel,
- float(const Vec3& referencePos, float maxRelevantDepth, int objtypes));
- MOCK_METHOD2(GetBottomLevel,
- float(const Vec3& referencePos, float maxRelevantDepth));
- MOCK_METHOD2(GetBottomLevel,
- float(const Vec3& referencePos, int objflags));
- MOCK_METHOD0(GetWaterLevel,
- float());
- MOCK_METHOD3(GetWaterLevel,
- float(const Vec3* pvPos, IPhysicalEntity* pent, bool bAccurate));
- MOCK_CONST_METHOD1(GetAccurateOceanHeight,
- float(const Vec3& pCurrPos));
- MOCK_CONST_METHOD0(GetCausticsParams,
- CausticsParams());
- MOCK_CONST_METHOD0(GetOceanAnimationParams,
- OceanAnimationData());
- MOCK_CONST_METHOD1(GetHDRSetupParams,
- void(Vec4 pParams[5]));
- MOCK_METHOD0(ResetParticlesAndDecals,
- void());
- MOCK_METHOD1(CreateDecal,
- void(const CryEngineDecalInfo& Decal));
- MOCK_METHOD2(DeleteDecalsInRange,
- void(AABB* pAreaBox, IRenderNode* pEntity));
- MOCK_METHOD1(SetSunColor,
- void(Vec3 vColor));
- MOCK_METHOD0(GetSunAnimColor,
- Vec3());
- MOCK_METHOD1(SetSunAnimColor,
- void(const Vec3& color));
- MOCK_METHOD0(GetSunAnimSpeed,
- float());
- MOCK_METHOD1(SetSunAnimSpeed,
- void(float sunAnimSpeed));
- MOCK_METHOD0(GetSunAnimPhase,
- AZ::u8());
- MOCK_METHOD1(SetSunAnimPhase,
- void(AZ::u8 sunAnimPhase));
- MOCK_METHOD0(GetSunAnimIndex,
- AZ::u8());
- MOCK_METHOD1(SetSunAnimIndex,
- void(AZ::u8 sunAnimIndex));
- MOCK_METHOD1(SetRainParams,
- void(const SRainParams& rainParams));
- MOCK_METHOD1(GetRainParams,
- bool(SRainParams& rainParams));
- MOCK_METHOD5(SetSnowSurfaceParams,
- void(const Vec3& vCenter, float fRadius, float fSnowAmount, float fFrostAmount, float fSurfaceFreezing));
- MOCK_METHOD5(GetSnowSurfaceParams,
- bool(Vec3& vCenter, float& fRadius, float& fSnowAmount, float& fFrostAmount, float& fSurfaceFreezing));
- MOCK_METHOD7(SetSnowFallParams,
- void(int nSnowFlakeCount, float fSnowFlakeSize, float fSnowFallBrightness, float fSnowFallGravityScale, float fSnowFallWindScale, float fSnowFallTurbulence, float fSnowFallTurbulenceFreq));
- MOCK_METHOD7(GetSnowFallParams,
- bool(int& nSnowFlakeCount, float& fSnowFlakeSize, float& fSnowFallBrightness, float& fSnowFallGravityScale, float& fSnowFallWindScale, float& fSnowFallTurbulence, float& fSnowFallTurbulenceFreq));
- MOCK_METHOD1(SetMaxViewDistanceScale,
- void(float fScale));
- MOCK_METHOD1(GetMaxViewDistance,
- float(bool));
- MOCK_CONST_METHOD0(GetFrameLodInfo,
- const SFrameLodInfo&());
- MOCK_METHOD1(SetFrameLodInfo,
- void(const SFrameLodInfo& frameLodInfo));
- MOCK_METHOD1(SetFogColor,
- void(const Vec3& vFogColor));
- MOCK_METHOD0(GetFogColor,
- Vec3());
- MOCK_METHOD6(GetSkyLightParameters,
- void(Vec3& sunDir, Vec3& sunIntensity, float& Km, float& Kr, float& g, Vec3& rgbWaveLengths));
- MOCK_METHOD7(SetSkyLightParameters,
- void(const Vec3& sunDir, const Vec3& sunIntensity, float Km, float Kr, float g, const Vec3& rgbWaveLengths, bool forceImmediateUpdate));
- MOCK_CONST_METHOD0(GetLightsHDRDynamicPowerFactor,
- float());
- MOCK_CONST_METHOD3(IsTessellationAllowed,
- bool(const CRenderObject* pObj, const SRenderingPassInfo& passInfo, bool bIgnoreShadowPass));
- MOCK_METHOD3(SetRenderNodeMaterialAtPosition,
- void(EERType eNodeType, const Vec3& vPos, _smart_ptr pMat));
- MOCK_METHOD1(OverrideCameraPrecachePoint,
- void(const Vec3& vPos));
- MOCK_METHOD4(AddPrecachePoint,
- int(const Vec3& vPos, const Vec3& vDir, float fTimeOut, float fImportanceFactor));
- MOCK_METHOD1(ClearPrecachePoint,
- void(int id));
- MOCK_METHOD0(ClearAllPrecachePoints,
- void());
- MOCK_METHOD1(GetPrecacheRoundIds,
- void(int pRoundIds[MAX_STREAM_PREDICTION_ZONES]));
- MOCK_METHOD5(TraceFogVolumes,
- void(const Vec3& vPos, const AABB& objBBox, SFogVolumeData& fogVolData, const SRenderingPassInfo& passInfo, bool fogVolumeShadingQuality));
-
- MOCK_METHOD1(RemoveAllStaticObjects,
- void(int));
- MOCK_METHOD3(SetStatInstGroup,
- bool(int nGroupId, const IStatInstGroup& siGroup, int nSID));
- MOCK_METHOD3(GetStatInstGroup,
- bool(int, IStatInstGroup&, int));
- MOCK_METHOD3(OnExplosion,
- void(Vec3, float, bool));
- MOCK_METHOD1(SetPhysMaterialEnumerator,
- void(IPhysMaterialEnumerator* pPhysMaterialEnumerator));
- MOCK_METHOD0(GetPhysMaterialEnumerator,
- IPhysMaterialEnumerator*());
- MOCK_METHOD0(SetupDistanceFog,
- void());
- MOCK_METHOD1(LoadMissionDataFromXMLNode,
- void(const char* szMissionName));
- MOCK_METHOD2(LoadEnvironmentSettingsFromXML,
- void(XmlNodeRef, int));
- MOCK_METHOD0(LoadCompiledOctreeForEditor,
- bool());
- MOCK_CONST_METHOD0(GetSunDir,
- Vec3());
- MOCK_CONST_METHOD0(GetSunDirNormalized,
- Vec3());
- MOCK_CONST_METHOD0(GetRealtimeSunDirNormalized,
- Vec3());
- MOCK_METHOD0(GetDistanceToSectorWithWater,
- float());
- MOCK_CONST_METHOD0(GetSunColor,
- Vec3());
- MOCK_CONST_METHOD0(GetSSAOAmount,
- float());
- MOCK_CONST_METHOD0(GetSSAOContrast,
- float());
- MOCK_METHOD1(FreeRenderNodeState,
- void(IRenderNode* pEntity));
- MOCK_METHOD1(GetLevelFilePath,
- const char*(const char* szFileName));
- MOCK_METHOD4(DisplayInfo,
- void(float& fTextPosX, float& fTextPosY, float& fTextStepY, bool bEnhanced));
- MOCK_METHOD0(DisplayMemoryStatistics,
- void());
-
- // Can't mock methods with variable parameters so just create empty bodies for them.
- void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const char* format, ...) override {}
- void DrawTextRightAligned([[maybe_unused]] const float x, [[maybe_unused]] const float y, [[maybe_unused]] const float scale, [[maybe_unused]] const ColorF& color, [[maybe_unused]] const char* format, ...) override {}
-
- MOCK_METHOD3(DrawBBoxHelper
- , void (const Vec3& vMin, const Vec3& vMax, ColorB col));
- MOCK_METHOD2(DrawBBoxHelper
- , void (const AABB& box, ColorB col));
-
- MOCK_METHOD3(ActivatePortal,
- void(const Vec3& vPos, bool bActivate, const char* szEntityName));
- MOCK_CONST_METHOD1(GetMemoryUsage,
- void(ICrySizer* pSizer));
- MOCK_METHOD2(GetResourceMemoryUsage,
- void(ICrySizer* pSizer, const AABB& cstAABB));
- MOCK_METHOD1(CreateVisArea,
- IVisArea*(uint64 visGUID));
- MOCK_METHOD1(DeleteVisArea,
- void(IVisArea* pVisArea));
- MOCK_METHOD6(UpdateVisArea,
- void(IVisArea* pArea, const Vec3* pPoints, int nCount, const char* szName, const SVisAreaInfo& info, bool bReregisterObjects));
- MOCK_METHOD4(IsVisAreasConnected,
- bool(IVisArea* pArea1, IVisArea* pArea2, int nMaxRecursion, bool bSkipDisabledPortals));
- MOCK_METHOD0(CreateClipVolume,
- IClipVolume*());
- MOCK_METHOD1(DeleteClipVolume,
- void(IClipVolume* pClipVolume));
- MOCK_METHOD7(UpdateClipVolume,
- void(IClipVolume* pClipVolume, _smart_ptr pRenderMesh, IBSPTree3D* pBspTree, const Matrix34& worldTM, bool bActive, uint32 flags, const char* szName));
- MOCK_METHOD1(CreateRenderNode,
- IRenderNode*(EERType type));
- MOCK_METHOD1(DeleteRenderNode,
- void(IRenderNode* pRenderNode));
- MOCK_METHOD1(SetWind,
- void(const Vec3& vWind));
- MOCK_CONST_METHOD2(GetWind,
- Vec3(const AABB& box, bool bIndoors));
- MOCK_CONST_METHOD1(GetGlobalWind,
- Vec3(bool bIndoors));
- MOCK_CONST_METHOD4(SampleWind,
- bool(Vec3* pSamples, int nSamples, const AABB& volume, bool bIndoors));
- MOCK_METHOD1(GetVisAreaFromPos,
- IVisArea*(const Vec3& vPos));
- MOCK_METHOD2(IntersectsVisAreas,
- bool(const AABB& box, void** pNodeCache));
- MOCK_METHOD4(ClipToVisAreas,
- bool(IVisArea* pInside, Sphere& sphere, Vec3 const& vNormal, void* pNodeCache));
- MOCK_METHOD1(EnableOceanRendering,
- void(bool bOcean));
- MOCK_METHOD1(AddTextureLoadHandler,
- void(ITextureLoadHandler* pHandler));
- MOCK_METHOD1(RemoveTextureLoadHandler,
- void(ITextureLoadHandler* pHandler));
- MOCK_METHOD1(GetTextureLoadHandlerForImage,
- ITextureLoadHandler*(const char* ext));
- MOCK_METHOD0(CreateLightSource,
- struct ILightSource*());
- MOCK_METHOD1(DeleteLightSource,
- void(ILightSource* pLightSource));
- MOCK_METHOD0(GetLightEntities,
- const PodArray* ());
- MOCK_METHOD3(GetLightVolumes,
- void(threadID nThreadID, SLightVolume*& pLightVols, uint32& nNumVols));
- MOCK_METHOD4(RegisterVolumeForLighting,
- uint16(const Vec3& vPos, f32 fRadius, uint8 nClipVolumeRef, const SRenderingPassInfo& passInfo));
- MOCK_METHOD1(RestoreTerrainFromDisk,
- bool(int));
- MOCK_METHOD1(GetFilePath,
- const char*(const char* szFileName));
- MOCK_CONST_METHOD0(GetPostEffectGroups,
- class IPostEffectGroupManager*());
- MOCK_CONST_METHOD0(GetPostEffectBaseGroup,
- class IPostEffectGroup*());
- MOCK_CONST_METHOD3(SetPostEffectParam,
- void(const char* pParam, float fValue, bool bForceValue));
- MOCK_CONST_METHOD3(SetPostEffectParamVec4,
- void(const char* pParam, const Vec4& pValue, bool bForceValue));
- MOCK_CONST_METHOD2(SetPostEffectParamString,
- void(const char* pParam, const char* pszArg));
- MOCK_CONST_METHOD2(GetPostEffectParam,
- void(const char* pParam, float& fValue));
- MOCK_CONST_METHOD2(GetPostEffectParamVec4,
- void(const char* pParam, Vec4& pValue));
- MOCK_CONST_METHOD2(GetPostEffectParamString,
- void(const char* pParam, const char*& pszArg));
- MOCK_METHOD1(GetPostEffectID,
- int32(const char* pPostEffectName));
- MOCK_METHOD1(ResetPostEffects,
- void(bool));
- MOCK_METHOD0(DisablePostEffects,
- void());
- MOCK_METHOD1(SetShadowsGSMCache,
- void(bool bCache));
- MOCK_METHOD2(SetCachedShadowBounds,
- void(const AABB& shadowBounds, float fAdditionalCascadesScale));
- MOCK_METHOD1(SetRecomputeCachedShadows,
- void(uint));
- MOCK_METHOD0(CheckMemoryHeap,
- void());
- MOCK_METHOD1(DeleteEntityDecals,
- void(IRenderNode* pEntity));
- MOCK_METHOD0(LockCGFResources,
- void());
- MOCK_METHOD0(UnlockCGFResources,
- void());
- MOCK_METHOD0(FreeUnusedCGFResources,
- void());
- MOCK_METHOD0(CreateStatObj,
- IStatObj*());
- MOCK_METHOD1(CreateStatObjOptionalIndexedMesh,
- IStatObj*(bool createIndexedMesh));
- MOCK_METHOD0(CreateIndexedMesh,
- IIndexedMesh*());
- MOCK_METHOD1(SerializeState,
- void(TSerialize ser));
- MOCK_METHOD1(PostSerialize,
- void(bool bReading));
- MOCK_METHOD0(GetMaterialHelpers,
- IMaterialHelpers&());
- MOCK_METHOD0(GetMaterialManager,
- IMaterialManager*());
- MOCK_METHOD0(GetObjManager,
- IObjManager*());
- MOCK_METHOD1(CreateChunkfileContent,
- CContentCGF*(const char* filename));
- MOCK_METHOD1(ReleaseChunkfileContent,
- void(CContentCGF*));
- MOCK_METHOD4(LoadChunkFileContent,
- bool(CContentCGF* pCGF, const char* filename, bool bNoWarningMode, bool bCopyChunkFile));
- MOCK_METHOD6(LoadChunkFileContentFromMem,
- bool(CContentCGF* pCGF, const void* pData, size_t nDataLen, uint32 nLoadingFlags, bool bNoWarningMode, bool bCopyChunkFile));
- MOCK_METHOD1(CreateChunkFile,
- IChunkFile*(bool));
- MOCK_CONST_METHOD3(CreateChunkFileWriter,
- ChunkFile::IChunkFileWriter*(EChunkFileFormat eFormat, AZ::IO::IArchive* pPak, const char* filename));
- MOCK_CONST_METHOD1(ReleaseChunkFileWriter,
- void(ChunkFile::IChunkFileWriter* p));
- MOCK_METHOD2(CreateOcean,
- bool(_smart_ptr pTerrainWaterMat, float waterLevel));
- MOCK_METHOD0(DeleteOcean,
- void());
- MOCK_METHOD1(ChangeOceanMaterial,
- void(_smart_ptr pMat));
- MOCK_METHOD1(ChangeOceanWaterLevel,
- void(float fWaterLevel));
- MOCK_METHOD1(InitMaterialDefautMappingAxis
- , void(_smart_ptr pMat));
- MOCK_METHOD0(GetIVisAreaManager,
- IVisAreaManager*());
- MOCK_METHOD3(PrecacheLevel,
- void(bool bPrecacheAllVisAreas, Vec3* pPrecachePoints, int nPrecachePointsNum));
- MOCK_METHOD0(ProposeContentPrecache,
- void());
- MOCK_METHOD0(GetTimeOfDay,
- ITimeOfDay*());
- MOCK_METHOD1(SetSkyMaterialPath,
- void(const string& skyMaterialPath));
- MOCK_METHOD1(SetSkyLowSpecMaterialPath,
- void(const string& skyMaterialPath));
- MOCK_METHOD0(LoadSkyMaterial,
- void());
- MOCK_METHOD0(GetSkyMaterial,
- _smart_ptr());
- MOCK_METHOD1(SetSkyMaterial,
- void(_smart_ptr pSkyMat));
- MOCK_METHOD2(SetGlobalParameter,
- void(E3DEngineParameter param, const Vec3& v));
- MOCK_METHOD2(GetGlobalParameter,
- void(E3DEngineParameter param, Vec3& v));
- MOCK_METHOD1(SetShadowMode,
- void(EShadowMode shadowMode));
- MOCK_CONST_METHOD0(GetShadowMode,
- EShadowMode());
- MOCK_METHOD6(AddPerObjectShadow,
- void(IShadowCaster* pCaster, float fConstBias, float fSlopeBias, float fJitter, const Vec3& vBBoxScale, uint nTexSize));
- MOCK_METHOD1(RemovePerObjectShadow,
- void(IShadowCaster* pCaster));
- MOCK_METHOD1(GetPerObjectShadow,
- struct SPerObjectShadow*(IShadowCaster* pCaster));
- MOCK_METHOD2(GetCustomShadowMapFrustums,
- void(struct ShadowMapFrustum*& arrFrustums, int& nFrustumCount));
- MOCK_METHOD2(SaveStatObj,
- int(IStatObj* pStatObj, TSerialize ser));
- MOCK_METHOD1(LoadStatObj,
- IStatObj*(TSerialize ser));
- MOCK_METHOD2(CheckIntersectClouds,
- bool(const Vec3& p1, const Vec3& p2));
- MOCK_METHOD1(OnRenderMeshDeleted,
- void(IRenderMesh* pRenderMesh));
- MOCK_METHOD0(DebugDraw_UpdateDebugNode,
- void());
- MOCK_METHOD4(RayObjectsIntersection2D,
- bool(Vec3 vStart, Vec3 vEnd, Vec3& vHitPoint, EERType eERType));
- MOCK_METHOD3(RenderMeshRayIntersection,
- bool(IRenderMesh* pRenderMesh, SRayHitInfo& hitInfo, _smart_ptr pCustomMtl));
- MOCK_METHOD3(CheckCreateRNTmpData
- , void(CRNTmpData** ppInfo, IRenderNode* pRNode, const SRenderingPassInfo& passInfo));
- MOCK_METHOD1(FreeRNTmpData,
- void(CRNTmpData** ppInfo));
- MOCK_METHOD0(IsObjectTreeReady
- , bool());
- MOCK_METHOD0(GetIObjectTree
- , IOctreeNode*());
- MOCK_METHOD2(GetObjectsByType,
- uint32(EERType, IRenderNode**));
- MOCK_METHOD4(GetObjectsByTypeInBox,
- uint32(EERType objType, const AABB& bbox, IRenderNode** pObjects, ObjectTreeQueryFilterCallback filterCallback));
- MOCK_METHOD2(GetObjectsInBox,
- uint32(const AABB& bbox, IRenderNode** pObjects));
- MOCK_METHOD2(GetObjectsByFlags,
- uint32(uint, IRenderNode**));
- MOCK_METHOD4(GetObjectsByTypeInBox,
- void(EERType objType, const AABB& bbox, PodArray* pLstObjects, ObjectTreeQueryFilterCallback filterCallback));
- MOCK_METHOD2(OnObjectModified,
- void(IRenderNode* pRenderNode, uint dwFlags));
- MOCK_METHOD1(FillDebugFPSInfo,
- void(SDebugFPSInfo&));
- MOCK_METHOD0(GetLevelFolder,
- const char*());
- MOCK_METHOD0(IsAreaActivationInUse,
- bool());
- MOCK_METHOD3(RenderRenderNode_ShadowPass,
- void(IShadowCaster* pRNode, const SRenderingPassInfo& passInfo, AZ::LegacyJobExecutor* pJobExecutor));
- MOCK_METHOD0(GetOpticsManager,
- IOpticsManager*());
- MOCK_METHOD0(SyncProcessStreamingUpdate,
- void());
- MOCK_METHOD1(SetScreenshotCallback,
- void(IScreenshotCallback* pCallback));
- MOCK_METHOD8(ActivateObjectsLayer,
- void(uint16 nLayerId, bool bActivate, bool bPhys, bool bObjects, bool bStaticLights, const char* pLayerName, IGeneralMemoryHeap* pHeap, bool bCheckLayerActivation));
- MOCK_CONST_METHOD4(GetLayerMemoryUsage,
- void(uint16 nLayerId, ICrySizer* pSizer, int* pNumBrushes, int* pNumDecals));
- MOCK_METHOD2(SkipLayerLoading,
- void(uint16 nLayerId, bool bClearList));
- MOCK_METHOD2(PrecacheRenderNode,
- void(IRenderNode* pObj, float fEntDistanceReal));
- MOCK_METHOD0(GetDeferredPhysicsEventManager,
- IDeferredPhysicsEventManager*());
- MOCK_METHOD1(SetStreamableListener,
- void(IStreamedObjectListener* pListener));
- MOCK_METHOD1(GetRenderingPassCamera,
- CCamera*(const CCamera& rCamera));
- MOCK_METHOD3(GetSvoStaticTextures,
- void(I3DEngine::SSvoStaticTexInfo& svoInfo, PodArray* pLightsTI_S, PodArray* pLightsTI_D));
- MOCK_METHOD2(GetSvoBricksForUpdate,
- void(PodArray& arrNodeInfo, bool getDynamic));
-#if defined(USE_GEOM_CACHES)
- MOCK_METHOD1(LoadGeomCache,
- IGeomCache*(const char* szFileName));
- MOCK_METHOD1(FindGeomCacheByFilename,
- IGeomCache*(const char* szFileName));
-#endif
- MOCK_METHOD3(LoadDesignerObject,
- IStatObj*(int nVersion, const char* szBinaryStream, int size));
-
- MOCK_METHOD0(WaitForCullingJobsCompletion,
- void());
-};
-
diff --git a/Code/CryEngine/CryCommon/Mocks/IRendererMock.h b/Code/CryEngine/CryCommon/Mocks/IRendererMock.h
index 2021e96172..757c586261 100644
--- a/Code/CryEngine/CryCommon/Mocks/IRendererMock.h
+++ b/Code/CryEngine/CryCommon/Mocks/IRendererMock.h
@@ -12,11 +12,15 @@
#pragma once
#include
-#include // needed for SRenderingPassInfo definition
#include
#include
#include
+struct SRendItemSorter {};
+struct SRenderingPassInfo {};
+struct SClipVolumeBlendInfo {};
+struct SFogVolumeData {};
+
// the following was generated using google's python script to autogenerate mocks.
// however, it needed some hand-editing to make it work, so if you add functions to IRenderer,
// it will probably be better to just manually add them here than try to run the script again
diff --git a/Code/CryEngine/CryCommon/Mocks/ISystemMock.h b/Code/CryEngine/CryCommon/Mocks/ISystemMock.h
index 5edd84fd75..4d2e80a2f3 100644
--- a/Code/CryEngine/CryCommon/Mocks/ISystemMock.h
+++ b/Code/CryEngine/CryCommon/Mocks/ISystemMock.h
@@ -37,12 +37,6 @@ public:
void());
MOCK_METHOD0(NeedDoWorkDuringOcclusionChecks,
bool());
- MOCK_METHOD0(Render,
- void());
- MOCK_METHOD0(RenderBegin,
- void());
- MOCK_METHOD2(RenderEnd,
- void(bool, bool));
MOCK_METHOD2(SynchronousLoadingTick,
void(const char* pFunc, int line));
MOCK_METHOD0(RenderStatistics,
@@ -124,8 +118,6 @@ public:
IMovieSystem * ());
MOCK_METHOD0(GetIAudioSystem,
Audio::IAudioSystem * ());
- MOCK_METHOD0(GetI3DEngine,
- I3DEngine * ());
MOCK_METHOD0(GetIConsole,
::IConsole * ());
MOCK_METHOD0(GetIRemoteConsole,
diff --git a/Code/CryEngine/CryCommon/Mocks/StubTimer.h b/Code/CryEngine/CryCommon/Mocks/StubTimer.h
index fe3a11fb42..cd275ac17b 100644
--- a/Code/CryEngine/CryCommon/Mocks/StubTimer.h
+++ b/Code/CryEngine/CryCommon/Mocks/StubTimer.h
@@ -11,6 +11,8 @@
*/
#pragma once
+#include
+
//! Simple stub timer that exposes a single simple interface for setting the current time.
class StubTimer
: public ITimer
diff --git a/Code/CryEngine/CryCommon/WindowsUtils.h b/Code/CryEngine/CryCommon/WindowsUtils.h
deleted file mode 100644
index 96b3a86606..0000000000
--- a/Code/CryEngine/CryCommon/WindowsUtils.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-#pragma once
-
-#if defined(WIN32)
-#include "CryWindows.h"
-#include "IRenderer.h"
-#include "IImage.h"
-#include "smartptr.h"
-#include "ImageExtensionHelper.h"
-
-// Types supported by CreateResourceFromTexture
-enum EResourceType
-{
- eResourceType_IconBig,
- eResourceType_IconSmall,
- eResourceType_Cursor,
-};
-
-// Loads a (DDS) texture resource from the renderer into a Win32 GDI resource.
-// Returns a HICON that must be closed with DestroyIcon(), or NULL on failure.
-static HICON CreateResourceFromTexture(IRenderer* pRenderer, const char* path, EResourceType type)
-{
- if (!pRenderer || !path || !*path)
- {
- // Invalid parameter passed
- return NULL;
- }
-
- // Find the target dimensions of the GDI resource
- const int nRequestedWidth = GetSystemMetrics(type == eResourceType_IconBig ? SM_CXICON : type == eResourceType_IconSmall ? SM_CXSMICON : SM_CXCURSOR);
- const int nRequestedHeight = GetSystemMetrics(type == eResourceType_IconBig ? SM_CYICON : type == eResourceType_IconSmall ? SM_CYSMICON : SM_CYCURSOR);
- if (nRequestedWidth != nRequestedHeight || nRequestedHeight <= 0 || nRequestedWidth <= 0)
- {
- // Don't support non-squares icons or cursors
- return NULL;
- }
-
- // Load texture.
- // in this case, we want to fall back on a null, not substiture the missing texture.
- _smart_ptr pImage = pRenderer->EF_LoadImage(path, FIM_NOFALLBACKS);
- if (!pImage || pImage->mfGet_depth() != 1 || pImage->mfGet_NumSides() != 1 || pImage->mfGetTileMode() != eTM_None)
- {
- // Can't load texture, or texture is a cube-map or volume texture, or uses tiling of some kind
- return NULL;
- }
- byte* pImgRaw = pImage->mfGet_image(0);
- const ETEX_Format texFormat = pImage->mfGetFormat();
-
- // Pick first mip level smaller than the GDI resource
- int nMip = 0;
- size_t offset = 0;
- int nMipWidth = pImage->mfGet_width();
- int nMipHeight = pImage->mfGet_height();
- while (nMipWidth > nRequestedWidth)
- {
- ++nMip;
- offset += pRenderer->GetTextureFormatDataSize(nMipWidth, nMipHeight, 1, 1, texFormat);
- nMipWidth = max(nMipWidth / 2, 1);
- nMipHeight = max(nMipHeight / 2, 1);
- }
- pImgRaw += offset;
- if (nMip >= pImage->mfGet_numMips())
- {
- // No appropriate mip in the texture
- // Note: Consider creating a full mip-chain on the texture so this can't happen
- return NULL;
- }
- const size_t nRawSize = pRenderer->GetTextureFormatDataSize(nMipWidth, nMipHeight, 1, 1, texFormat);
-
-#if 0
- // Check that DDS indexing is correct here
- offset += nRawSize;
- for (int nIdx = nMip + 1; nIdx < pImage->mfGet_numMips(); ++nIdx)
- {
- const int w = max(nMipWidth >> (nIdx - nMip), 1);
- const int h = max(nMipHeight >> (nIdx - nMip), 1);
- offset += pRenderer->GetTextureFormatDataSize(w, h, 1, 1, texFormat);
- }
- assert(offset == pImage->mfGet_ImageSize());
-#endif
-
- // Type of bitmap to create
- BITMAPV5HEADER bi = { 0 };
- bi.bV5Size = sizeof(BITMAPV5HEADER);
- bi.bV5Width = nRequestedWidth;
- bi.bV5Height = -nRequestedHeight;
- bi.bV5Planes = 1;
- bi.bV5BitCount = 32;
- bi.bV5Compression = BI_BITFIELDS;
- // The following mask specification specifies a supported 32 BPP alpha format for Windows XP+
- bi.bV5AlphaMask = 0xFF000000;
- bi.bV5RedMask = 0x00FF0000;
- bi.bV5GreenMask = 0x0000FF00;
- bi.bV5BlueMask = 0x000000FF;
-
- // Create the DIB section with an alpha channel
- const HDC hdc = GetDC(NULL);
- void* lpBits;
- const HBITMAP hBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bi, DIB_RGB_COLORS, &lpBits, NULL, 0);
- ReleaseDC(NULL, hdc);
- if (!hBitmap || !lpBits)
- {
- // Can't allocate OS bitmap
- return NULL;
- }
- GdiFlush();
-
- // Decompress texture
- const bool bTryDecompress = texFormat != eTF_R8G8B8A8 && texFormat != eTF_B8G8R8A8 && texFormat != eTF_B8G8R8X8;
- byte* const pImgDecomp = bTryDecompress ? new byte[nMipWidth * nMipHeight * sizeof(int32)] : pImgRaw;
- const bool bImgDecompressed = bTryDecompress && pRenderer->DXTDecompress(pImgRaw, nRawSize, pImgDecomp, nMipWidth, nMipHeight, 1, texFormat, false, sizeof(int32));
-
- // Check which conversions need to be performed
- const bool bSRGB = (pImage->mfGet_Flags() & CImageExtensionHelper::EIF_SRGBRead) != 0;
- const bool bSwap = (texFormat == eTF_R8G8B8A8) || bTryDecompress;
-
- HICON result = NULL;
- if (!bTryDecompress || bImgDecompressed)
- {
- // Assign texture data with mismatching sizes
- // Note: Any pixels not in the selected mip will become 100% transparent black, no resizing is performed
- const size_t sourceRowStride = nMipWidth;
- const size_t targetRowStride = nRequestedWidth;
- const uint32* pSourceRow = (uint32*)pImgDecomp;
- uint32* pTargetRow = (uint32*)lpBits;
-
- assert(sourceRowStride <= targetRowStride);
- assert(nMipHeight <= nRequestedHeight);
- assert(pSourceRow != pTargetRow);
- assert(pSourceRow && pTargetRow);
-
- uint8 gammaTable[256];
- if (!bSRGB)
- {
- // Linear to sRGB table
- const float gamma = 1.0f / 2.2f;
- const float gammaMultiplier = 255.0f / powf(255.0f, gamma);
- for (int i = 0; i < 256; ++i)
- {
- gammaTable[i] = uint8(powf(float(i), gamma) * gammaMultiplier);
- }
- }
- else if (bSwap)
- {
- // sRGB to sRGB table (no change)
- for (int i = 0; i < 256; ++i)
- {
- gammaTable[i] = uint8(i);
- }
- }
-
- for (int y = 0; y < nMipHeight; ++y, pSourceRow += sourceRowStride, pTargetRow += targetRowStride)
- {
- if (!bSwap && bSRGB)
- {
- memcpy(pTargetRow, pSourceRow, sourceRowStride * sizeof(uint32));
- }
- else
- {
- const uint32* pSourceTexel = pSourceRow;
- uint32* pTargetTexel = pTargetRow;
- for (int x = 0; x < nMipWidth; ++x, ++pSourceTexel, ++pTargetTexel)
- {
- const uint8 red = gammaTable[uint8(*pSourceTexel >> 0)];
- const uint8 green = gammaTable[uint8(*pSourceTexel >> 8)];
- const uint8 blue = gammaTable[uint8(*pSourceTexel >> 16)];
- const uint32 alpha = *pSourceTexel & 0xFF000000;
- *pTargetTexel = (red << (bSwap ? 16 : 0)) | (green << 8) | (blue << (bSwap ? 0 : 16)) | alpha;
- }
- }
-
- // Fill remaining columns with zeros
- memset(pTargetRow + sourceRowStride, 0, (targetRowStride - sourceRowStride) * sizeof(uint32));
- }
-
- // Fill remaining rows with zeros
- for (int y = nMipHeight; y < nRequestedHeight; ++y)
- {
- memset(pTargetRow, 0, targetRowStride * sizeof(uint32));
- pTargetRow += targetRowStride;
- }
-
- // Convert to GDI icon
- ICONINFO iconinfo = {0};
- iconinfo.fIcon = type == eResourceType_Cursor ? FALSE : TRUE;
- iconinfo.hbmMask = ::CreateBitmap(nRequestedWidth, nRequestedHeight, 1, 1, NULL);
- iconinfo.hbmColor = hBitmap;
- result = ::CreateIconIndirect(&iconinfo);
- DeleteObject(iconinfo.hbmMask);
- }
-
- // Clean up
- DeleteObject(hBitmap);
- if (bTryDecompress)
- {
- delete[] pImgDecomp;
- }
- pImage.reset();
-
- return result;
-}
-
-#endif
diff --git a/Code/CryEngine/CryCommon/crycommon_files.cmake b/Code/CryEngine/CryCommon/crycommon_files.cmake
index ef49370c08..7d169c2643 100644
--- a/Code/CryEngine/CryCommon/crycommon_files.cmake
+++ b/Code/CryEngine/CryCommon/crycommon_files.cmake
@@ -14,9 +14,6 @@ set(FILES
CryCommon.cpp
Allocator.h
FinalizingSpline.h
- Gem.h
- I3DEngine.h
- I3DEngine_info.h
IAudioInterfacesCommonData.h
IAudioSystem.h
IChunkFile.h
@@ -86,7 +83,6 @@ set(FILES
ITexture.h
IThreadManager.h
IThreadTask.h
- ITimeOfDay.h
ITimer.h
IValidator.h
IVideoRenderer.h
@@ -143,7 +139,6 @@ set(FILES
CryAssert.h
CryCrc32.h
CryCustomTypes.h
- CryEngineDecalInfo.h
CryFile.h
CryFixedArray.h
CryFixedString.h
@@ -292,7 +287,6 @@ set(FILES
platform_impl.cpp
Win32specific.h
Win64specific.h
- WindowsUtils.h
CryExtension/CryCreateClassInstance.h
CryExtension/CryGUID.h
CryExtension/CryTypeID.h
@@ -317,7 +311,6 @@ set(FILES
CryPool/STLWrapper.h
CryPool/ThreadSafe.h
stl/STLAlignedAlloc.h
- ILocalMemoryUsage.h
Serialization/Assert.h
Serialization/BitVector.h
Serialization/BitVectorImpl.h
diff --git a/Code/CryEngine/CryCommon/crycommon_testing_files.cmake b/Code/CryEngine/CryCommon/crycommon_testing_files.cmake
index ca133c2497..d20a33f791 100644
--- a/Code/CryEngine/CryCommon/crycommon_testing_files.cmake
+++ b/Code/CryEngine/CryCommon/crycommon_testing_files.cmake
@@ -10,7 +10,6 @@
#
set(FILES
- Mocks/I3DEngineMock.h
Mocks/IAudioSystemMock.h
Mocks/IConsoleMock.h
Mocks/ICryPakMock.h
diff --git a/Code/CryEngine/CrySystem/CrySystem_precompiled.h b/Code/CryEngine/CrySystem/CrySystem_precompiled.h
index 6cf4c6005a..b446199b4e 100644
--- a/Code/CryEngine/CrySystem/CrySystem_precompiled.h
+++ b/Code/CryEngine/CrySystem/CrySystem_precompiled.h
@@ -102,7 +102,6 @@ inline int RoundToClosestMB(size_t memSize)
#include
#include
#include
-#include
#include
#include
#include
@@ -127,7 +126,6 @@ namespace AZ::IO
struct IArchive;
}
struct ICryFont;
-struct I3DEngine;
struct IMovieSystem;
struct IAudioSystem;
struct IPhysicalWorld;
diff --git a/Code/CryEngine/CrySystem/LevelSystem/LevelSystem.cpp b/Code/CryEngine/CrySystem/LevelSystem/LevelSystem.cpp
index 996dee7810..d31f122d9b 100644
--- a/Code/CryEngine/CrySystem/LevelSystem/LevelSystem.cpp
+++ b/Code/CryEngine/CrySystem/LevelSystem/LevelSystem.cpp
@@ -193,10 +193,6 @@ static void UnloadMap([[maybe_unused]] IConsoleCmdArgs* args)
if (gEnv->pSystem && gEnv->pSystem->GetILevelSystem() && !gEnv->IsEditor())
{
gEnv->pSystem->GetILevelSystem()->UnloadLevel();
- if (gEnv->p3DEngine)
- {
- gEnv->p3DEngine->LoadEmptyLevel();
- }
}
}
@@ -674,18 +670,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
pSpamDelay->Set(0.0f);
}
- if (gEnv->p3DEngine)
- {
- bool is3DEngineLoaded = gEnv->IsEditor() ? gEnv->p3DEngine->InitLevelForEditor(pLevelInfo->GetPath(), pLevelInfo->m_defaultGameTypeName.c_str())
- : gEnv->p3DEngine->LoadLevel(pLevelInfo->GetPath(), pLevelInfo->m_defaultGameTypeName.c_str());
- if (!is3DEngineLoaded)
- {
- OnLoadingError(levelName, "3DEngine failed to handle loading the level");
-
- return 0;
- }
- }
-
// Parse level specific config data.
AZStd::string const sLevelNameOnly(PathUtil::GetFileName(levelName));
@@ -760,14 +744,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
gEnv->pSystem->SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_LEVEL_LOAD_START_PRECACHE);
- //////////////////////////////////////////////////////////////////////////
- // Notify 3D engine that loading finished
- //////////////////////////////////////////////////////////////////////////
- if (gEnv->p3DEngine)
- {
- gEnv->p3DEngine->PostLoadLevel();
- }
-
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
gEnv->pConsole->SetScrollMax(600 / 2);
@@ -991,18 +967,6 @@ void CLevelSystem::UnloadLevel()
CTimeValue tBegin = gEnv->pTimer->GetAsyncTime();
- I3DEngine* p3DEngine = gEnv->p3DEngine;
- if (p3DEngine)
- {
- IDeferredPhysicsEventManager* pPhysEventManager = p3DEngine->GetDeferredPhysicsEventManager();
- if (pPhysEventManager)
- {
- // clear deferred physics queues before renderer, since we could have jobs running
- // which access a rendermesh
- pPhysEventManager->ClearDeferredEvents();
- }
- }
-
//AM: Flush render thread (Flush is not exposed - using EndFrame())
//We are about to delete resources that could be in use
if (gEnv->pRenderer)
@@ -1076,25 +1040,10 @@ void CLevelSystem::UnloadLevel()
SAFE_RELEASE(m_pCurrentLevel);
- /*
- Force Lua garbage collection before p3DEngine->UnloadLevel() and pRenderer->FreeResources(flags) are called.
- p3DEngine->UnloadLevel() will destroy particle emitters even if they're still referenced by Lua objects that are yet to be collected.
- (as per comment in 3dEngineLoad.cpp (line 501) - "Force to clean all particles that are left, even if still referenced.").
- Then, during the next GC cycle, Lua finally cleans up, the particle emitter smart pointers will be pointing to invalid memory).
- Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event), which is too late
- (after the render resources have been purged).
- This extra GC step takes a few ms more level unload time, which is a small price for fixing nasty crashes.
- If, however, we wanted to claim it back, we could potentially get rid of the GC step that is triggered by ESYSTEM_EVENT_LEVEL_POST_UNLOAD to break even.
- */
-
+ // Force Lua garbage collection (may no longer be needed now the legacy renderer has been removed).
+ // Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event).
EBUS_EVENT(AZ::ScriptSystemRequestBus, GarbageCollect);
- // Delete engine resources
- if (p3DEngine)
- {
- p3DEngine->UnloadLevel();
-
- }
// Force to clean render resources left after deleting all objects and materials.
IRenderer* pRenderer = gEnv->pRenderer;
if (pRenderer)
diff --git a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
index 67bf0a6c8e..4b6e210522 100644
--- a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
+++ b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
@@ -55,10 +55,6 @@ namespace LegacyLevelSystem
if (gEnv->pSystem && gEnv->pSystem->GetILevelSystem() && !gEnv->IsEditor())
{
gEnv->pSystem->GetILevelSystem()->UnloadLevel();
- if (gEnv->p3DEngine)
- {
- gEnv->p3DEngine->LoadEmptyLevel();
- }
}
}
@@ -262,22 +258,6 @@ namespace LegacyLevelSystem
pSpamDelay->Set(0.0f);
}
- if (gEnv->p3DEngine)
- {
- AZ::IO::PathView levelPath(levelName);
- AZStd::string parentPath(levelPath.ParentPath().Native());
-
- static constexpr const char* defaultGameTypeName = "Mission0";
- bool is3DEngineLoaded = gEnv->IsEditor() ? gEnv->p3DEngine->InitLevelForEditor(parentPath.c_str(), defaultGameTypeName)
- : gEnv->p3DEngine->LoadLevel(parentPath.c_str(), defaultGameTypeName);
- if (!is3DEngineLoaded)
- {
- OnLoadingError(levelName, "3DEngine failed to handle loading the level");
-
- return 0;
- }
- }
-
// Parse level specific config data.
AZStd::string const sLevelNameOnly(PathUtil::GetFileName(levelName));
@@ -340,14 +320,6 @@ namespace LegacyLevelSystem
gEnv->pSystem->SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_LEVEL_LOAD_START_PRECACHE);
- //////////////////////////////////////////////////////////////////////////
- // Notify 3D engine that loading finished
- //////////////////////////////////////////////////////////////////////////
- if (gEnv->p3DEngine)
- {
- gEnv->p3DEngine->PostLoadLevel();
- }
-
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
gEnv->pConsole->SetScrollMax(600 / 2);
@@ -569,18 +541,6 @@ namespace LegacyLevelSystem
CTimeValue tBegin = gEnv->pTimer->GetAsyncTime();
- I3DEngine* p3DEngine = gEnv->p3DEngine;
- if (p3DEngine)
- {
- IDeferredPhysicsEventManager* pPhysEventManager = p3DEngine->GetDeferredPhysicsEventManager();
- if (pPhysEventManager)
- {
- // clear deferred physics queues before renderer, since we could have jobs running
- // which access a rendermesh
- pPhysEventManager->ClearDeferredEvents();
- }
- }
-
// AM: Flush render thread (Flush is not exposed - using EndFrame())
// We are about to delete resources that could be in use
if (gEnv->pRenderer)
@@ -644,25 +604,10 @@ namespace LegacyLevelSystem
GetISystem()->GetIResourceManager()->UnloadLevel();
- /*
- Force Lua garbage collection before p3DEngine->UnloadLevel() and pRenderer->FreeResources(flags) are called.
- p3DEngine->UnloadLevel() will destroy particle emitters even if they're still referenced by Lua objects that are yet to be
- collected. (as per comment in 3dEngineLoad.cpp (line 501) - "Force to clean all particles that are left, even if still referenced.").
- Then, during the next GC cycle, Lua finally cleans up, the particle emitter smart pointers will be pointing to invalid memory).
- Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event), which is too late
- (after the render resources have been purged).
- This extra GC step takes a few ms more level unload time, which is a small price for fixing nasty crashes.
- If, however, we wanted to claim it back, we could potentially get rid of the GC step that is triggered by
- ESYSTEM_EVENT_LEVEL_POST_UNLOAD to break even.
- */
-
+ // Force Lua garbage collection (may no longer be needed now the legacy renderer has been removed).
+ // Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event).
EBUS_EVENT(AZ::ScriptSystemRequestBus, GarbageCollect);
- // Delete engine resources
- if (p3DEngine)
- {
- p3DEngine->UnloadLevel();
- }
// Force to clean render resources left after deleting all objects and materials.
IRenderer* pRenderer = gEnv->pRenderer;
if (pRenderer)
diff --git a/Code/CryEngine/CrySystem/PerfHUD.cpp b/Code/CryEngine/CrySystem/PerfHUD.cpp
index 23a5fc0ced..2aeabe2650 100644
--- a/Code/CryEngine/CrySystem/PerfHUD.cpp
+++ b/Code/CryEngine/CrySystem/PerfHUD.cpp
@@ -22,7 +22,6 @@
#include "MiniGUI/MiniMenu.h"
#include "MiniGUI/MiniTable.h"
#include
-#include
#include
#include "System.h"
@@ -853,21 +852,6 @@ void CPerfHUD::SaveStatsCallback([[maybe_unused]] void* data, [[maybe_unused]] b
// RENDER CALLBACKS
//////////////////////////////////////////////////////////////////////////
-/*
-void CPerfHUD::DisplayRenderInfoCallback(const Rect& rect)
-{
- IMiniGUIPtr pGUI;
- if (CryCreateClassInstanceForInterface( cryiidof(),pGUI ))
- {
- //right aligned display
- float x = rect.right;
- float y = rect.top;
- float step = 13.f;
-
- gEnv->p3DEngine->DisplayInfo(x, y, step, true);
- }
-}*/
-
void CPerfHUD::EnableWidget(ICryPerfHUDWidget::EWidgetID id, int mode)
{
const int nWidgets = m_widgets.size();
@@ -1530,26 +1514,6 @@ void CRenderStatsWidget::Update()
m_runtimeData.nFwdLights = 0;
m_runtimeData.nFwdShadowLights = 0;
- //////////////////////////////////////////////////////////////////////////
- if (gEnv->p3DEngine)
- {
- I3DEngine::SObjectsStreamingStatus objStats;
- gEnv->p3DEngine->GetObjectsStreamingStatus(objStats);
-
- float fMeshRequiredMB = (float)(objStats.nMemRequired) / (1024 * 1024);
- sprintf_s(entryBuffer, "Mesh Required: %.2f (%dMB)", fMeshRequiredMB, azlossy_cast(objStats.nMeshPoolSize));
- if (fMeshRequiredMB < objStats.nMeshPoolSize)
- {
- m_pInfoBox->AddEntry(entryBuffer, CPerfHUD::COL_NORM, CPerfHUD::TEXT_SIZE_NORM);
- }
- else
- {
- m_pInfoBox->AddEntry(entryBuffer, CPerfHUD::COL_ERROR, CPerfHUD::TEXT_SIZE_NORM);
- CryPerfHUDWarning(1.f, "Too Many Geometry: %.2fMB", fMeshRequiredMB);
- }
- }
-
-
//////////////////////////////////////////////////////////////////////////
if (gEnv->pRenderer)
{
@@ -1727,25 +1691,6 @@ CStreamingStatsWidget::CStreamingStatsWidget(IMiniCtrl* pParentMenu, ICryPerfHUD
//////////////////////////////////////////////////////////////////////////
void CStreamingStatsWidget::Update()
{
- char entryBuffer[CMiniInfoBox::MAX_TEXT_LENGTH] = {0};
-
- //Clear old entries
- m_pInfoBox->ClearEntries();
-
- I3DEngine::SObjectsStreamingStatus objStats;
- gEnv->p3DEngine->GetObjectsStreamingStatus(objStats);
-
- float fMeshRequiredMB = (float)(objStats.nMemRequired) / (1024 * 1024);
- sprintf_s(entryBuffer, "Mesh Required: %.2f (%dMB)", fMeshRequiredMB, objStats.nMeshPoolSize);
- if (fMeshRequiredMB < objStats.nMeshPoolSize)
- {
- m_pInfoBox->AddEntry(entryBuffer, CPerfHUD::COL_NORM, CPerfHUD::TEXT_SIZE_NORM);
- }
- else
- {
- m_pInfoBox->AddEntry(entryBuffer, CPerfHUD::COL_ERROR, CPerfHUD::TEXT_SIZE_NORM);
- CryPerfHUDWarning(1.f, "Too Many Geometry: %.2fMB", fMeshRequiredMB);
- }
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.cpp b/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.cpp
deleted file mode 100644
index 7eb86de966..0000000000
--- a/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.cpp
+++ /dev/null
@@ -1,1389 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-// Description : Visual helper for checking a local memory usage on maps
-
-/*
- TODO:
- - Procedural vegetation
-
- - Permanent mip-map problem (streaming will collect a permanent mip-maps when travelling)
- - ? Foliage render nodes
-
- must make a decision about the local / global problem:
- - Particle effects (must check the calculation)
- - Characters (calculation is DONE)
-
- - StatObj LOD streaming (I think that there is no LOD streaming, but i'm not sure about this)
- - Terrain texture streaming (not detail textures!) //It's not needed because this system using a fix-size pool
- - Animation streaming: completely different system, not need to measure now
- - IsoMesh streaming: completely different system, not need to measure now
-*/
-
-
-#include "CrySystem_precompiled.h"
-
-#include "LocalMemoryUsage.h"
-
-#include
-#include
-#include
-#include
-
-#include
-
-//#define MAX_LODS 6 // I want an engine-wide const :-(
-#define MAX_SLOTS 100 // GetSlotCount() is not working :-(
-#define BIG_NUMBER 1e20f
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace LocalMemoryUsageDrawHelper
-{
- enum eDrawRectParams
- {
- DSP_YDIR = 0,
- DSP_XDIR = 1,
- DSP_REVERSE_TRIANGLES = 2,
- DSP_REVERSE_ARROW = 4,
- };
-
- void DrawRect(IRenderer* pRenderer, const CCamera* camera, const Vec3& p1, const Vec3& p3, const ColorB& color, int params = 0)
- {
- Vec3 p2, p4, projectedPos;
- if (!(params & DSP_REVERSE_TRIANGLES))
- {
- if (params & DSP_XDIR)
- {
- p2 = Vec3(p1.x, p3.y, p1.z);
- p4 = Vec3(p3.x, p1.y, p3.z);
- }
- else
- {
- p2 = Vec3(p1.x, p3.y, p3.z);
- p4 = Vec3(p3.x, p1.y, p1.z);
- }
- }
- else
- {
- if (params & DSP_XDIR)
- {
- p4 = Vec3(p1.x, p3.y, p1.z);
- p2 = Vec3(p3.x, p1.y, p3.z);
- }
- else
- {
- p4 = Vec3(p1.x, p3.y, p3.z);
- p2 = Vec3(p3.x, p1.y, p1.z);
- }
- }
-
- if (camera->Project(p1, projectedPos) || camera->Project(p2, projectedPos) || camera->Project(p3, projectedPos) || camera->Project(p4, projectedPos))
- {
- IRenderAuxGeom* pRenderAuxGeom = pRenderer->GetIRenderAuxGeom();
-
- pRenderAuxGeom->DrawTriangle(p1, color, p2, color, p3, color);
- pRenderAuxGeom->DrawTriangle(p3, color, p4, color, p1, color);
- }
- }
-
- void DrawArrow(IRenderer* pRenderer, const CCamera* camera, Vec3 pStart, Vec3 pEnd, float width, float head, float lengthSub, const ColorB& color, int params = 0)
- {
- Vec3 p1, p2, p3, p4, p5, p6, p7, projectedPos;
-
- if (params & DSP_REVERSE_ARROW)
- {
- std::swap(pStart, pEnd);
- }
-
- Vec3 vParallel((pEnd - pStart).GetNormalized());
- Vec3 vOrto = vParallel.Cross(Vec3(0, 0, 1)).GetNormalized();
- pStart += vParallel * lengthSub;
- pEnd -= vParallel * lengthSub;
-
- p1 = pStart - (vOrto * width * 0.5f);
- p2 = pStart + (vOrto * width * 0.5f);
- p3 = (pEnd - vParallel * head) - (vOrto * width * 0.5f);
- p4 = (pEnd - vParallel * head) + (vOrto * width * 0.5f);
- p5 = (pEnd - vParallel * head * 1.5f) - (vOrto * head * 0.9f);
- p6 = (pEnd - vParallel * head * 1.5f) + (vOrto * head * 0.9f);
- p7 = pEnd;
-
- if (camera->Project(p1, projectedPos) || camera->Project(p7, projectedPos))
- {
- IRenderAuxGeom* pRenderAuxGeom = pRenderer->GetIRenderAuxGeom();
-
- pRenderAuxGeom->DrawTriangle(p1, color, p2, color, p4, color);
- pRenderAuxGeom->DrawTriangle(p4, color, p3, color, p1, color);
- pRenderAuxGeom->DrawTriangle(p3, color, p4, color, p7, color);
- pRenderAuxGeom->DrawTriangle(p4, color, p6, color, p7, color);
- pRenderAuxGeom->DrawTriangle(p5, color, p3, color, p7, color);
- }
- }
-
- #define DRAWHELPER_CIRCLE_POINT_NR 32
-
-
- static Vec3 s_CirclePoints[DRAWHELPER_CIRCLE_POINT_NR + 1];
- static bool s_CircleDataInited = false;
- void InitCircleData()
- {
- s_CircleDataInited = true;
- float angleDiff = 2.0f * 3.1415927f / DRAWHELPER_CIRCLE_POINT_NR;
-
- for (int i = 0; i < DRAWHELPER_CIRCLE_POINT_NR + 1; i++)
- {
- s_CirclePoints[i] = Vec3(cos(i * angleDiff), sin(i * angleDiff), 0.0f);
- }
- }
-
- void DrawCircle(IRenderer* pRenderer, [[maybe_unused]] const CCamera* camera, const Vec3& origo, float radius, float ratio, const ColorB& color1, const ColorB& color2)
- {
- if (!s_CircleDataInited)
- {
- InitCircleData();
- }
- float radius2 = radius * 0.90f;
-
- IRenderAuxGeom* pRenderAuxGeom = pRenderer->GetIRenderAuxGeom();
-
- Vec3 oldPoint = origo + s_CirclePoints[0] * radius;
- Vec3 oldPoint2 = origo + s_CirclePoints[0] * radius2;
-
- for (int i = 0; i < DRAWHELPER_CIRCLE_POINT_NR; i++)
- {
- Vec3 newPoint = origo + s_CirclePoints[i + 1] * radius;
- Vec3 newPoint2 = origo + s_CirclePoints[i + 1] * radius2;
- if (i < ratio * DRAWHELPER_CIRCLE_POINT_NR)
- {
- pRenderAuxGeom->DrawTriangle(origo, color1, oldPoint, color1, newPoint, color1);
- }
- else
- {
- //pRenderAuxGeom->DrawTriangle( origo, color2, oldPoint, color2, newPoint, color2 );
- pRenderAuxGeom->DrawTriangle(oldPoint2, color2, oldPoint, color2, newPoint, color2);
- pRenderAuxGeom->DrawTriangle(newPoint, color2, newPoint2, color2, oldPoint2, color2);
- }
- oldPoint = newPoint;
- oldPoint2 = newPoint2;
- }
- }
-}
-
-/*
-namespace Distance
-{
- // Distance: AABB_AABB
- //----------------------------------------------------------------------------------
- // Calculate the closest distance of a AABB to an another AABB in 3d-space.
- // The function returns the squared distance.
- // optionally the closest point on the hull is calculated
- //
- // Example:
- // float result = Distance::Point_AABBSq( aabb1, aabb2 );
- //----------------------------------------------------------------------------------
-
- ILINE float AABB_AABBSq( const AABB& aabb1, const AABB& aabb2 )
- {
- float fDist2 = 0;
- for(int i=0; i<3; ++i)
- {
- float max1 = aabb1.max[i];
- if(max1 < aabb2.min[i])
- {
- fDist2 += sqr(max1-aabb2.min[i]);
- }
- else
- {
- float min1 = aabb1.min[i];
- if(min1 > aabb2.max[i])
- {
- fDist2 += sqr(aabb2.max[i]-min1);
- }
- }
- }
- return fDist2;
- }
-
- // Distance: AABB_AABB_2D
- //----------------------------------------------------------------------------------
- // Calculate the closest distance of a AABB to an another AABB in 2d-space.
- // The function returns the squared distance.
- // optionally the closest point on the hull is calculated
- //
- // Example:
- // float result = Distance::AABB_AABB2DSq( aabb1, aabb2 );
- //----------------------------------------------------------------------------------
-
- ILINE float AABB_AABB2DSq( const AABB& aabb1, const AABB& aabb2 )
- {
- float fDist2 = 0;
- for(int i=0; i<2; ++i) //We are using only 2 of the dimensions!
- {
- float max1 = aabb1.max[i];
- if(max1 < aabb2.min[i])
- {
- fDist2 += sqr(max1-aabb2.min[i]);
- }
- else
- {
- float min1 = aabb1.min[i];
- if(min1 > aabb2.max[i])
- {
- fDist2 += sqr(aabb2.max[i]-min1);
- }
- }
- }
- return fDist2;
- }
-}
-*/
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-int CLocalMemoryUsage::SResource::m_arrMemoryUsage[LOCALMEMORY_SECTOR_PER_PASS];
-int CLocalMemoryUsage::SResource::m_arrPieces[LOCALMEMORY_SECTOR_PER_PASS];
-
-
-CLocalMemoryUsage::SResource::SResource()
-{
- m_used = true;
-}
-
-void CLocalMemoryUsage::SResource::Init(CLocalMemoryUsage* pLocalMemoryUsage)
-{
- m_pLocalMemoryUsage = pLocalMemoryUsage;
-
- StartChecking();
-}
-
-void CLocalMemoryUsage::SResource::StartChecking()
-{
- const RectI& actProcessedSectors = m_pLocalMemoryUsage->m_actProcessedSectors;
-
- float* pMipFactor = m_arrMipFactor;
- for (int i = 0; i < actProcessedSectors.w * actProcessedSectors.h; i++)
- {
- *pMipFactor = BIG_NUMBER;
- pMipFactor++;
- }
- bool* pRowDirty = m_arrRowDirty;
- for (int i = 0; i < LOCALMEMORY_SECTOR_PER_PASS; i++)
- {
- *pRowDirty = false;
- pRowDirty++;
- }
-}
-
-void CLocalMemoryUsage::SResource::CheckOnAllSectorsP1(const AABB& bounding, float maxViewDist, float scale, float mipFactor)
-{
- //FRAME_PROFILER("! CLocalMemoryUsage::SResource::CheckOnAllSectorsP1", GetISystem(), PROFILE_SYSTEM);
-
- float modifiedmaxViewDist = maxViewDist;
- float modifiedmaxViewDistSqr = sqr(modifiedmaxViewDist);
-
- const RectI& actProcessedSectors = m_pLocalMemoryUsage->m_actProcessedSectors;
-
- int xMin = (int)max(0, int((bounding.min.x - modifiedmaxViewDist) / LOCALMEMORY_SECTOR_SIZE ) - actProcessedSectors.x);
- int xMax = (int)min(actProcessedSectors.w, int((bounding.max.x + modifiedmaxViewDist) / LOCALMEMORY_SECTOR_SIZE + 1) - actProcessedSectors.x);
- int yMin = (int)max(0, int((bounding.min.y - modifiedmaxViewDist) / LOCALMEMORY_SECTOR_SIZE ) - actProcessedSectors.y);
- int yMax = (int)min(actProcessedSectors.h, int((bounding.max.y + modifiedmaxViewDist) / LOCALMEMORY_SECTOR_SIZE + 1) - actProcessedSectors.y);
-
- AABB sectorBounding(AABB::RESET);
- float sectorDistanceSqr;
- float fDistYSqr;
-
- for (int y = yMin; y < yMax; y++)
- {
- float* pMipFactor = &m_arrMipFactor[actProcessedSectors.w * y + xMin];
-
- sectorBounding.min.y = (y + actProcessedSectors.y) * LOCALMEMORY_SECTOR_SIZE;
- sectorBounding.max.y = sectorBounding.min.y + LOCALMEMORY_SECTOR_SIZE;
- sectorBounding.min.x = (xMin + actProcessedSectors.x) * LOCALMEMORY_SECTOR_SIZE;
-
- assert(y < LOCALMEMORY_SECTOR_PER_PASS);
- m_arrRowDirty[y] = true;
-
- //Calculating Y distance sqr
- {
- fDistYSqr = 0;
- if (bounding.max.y < sectorBounding.min.y)
- {
- fDistYSqr += sqr(bounding.max.y - sectorBounding.min.y);
- }
- else
- {
- if (bounding.min.y > sectorBounding.max.y)
- {
- fDistYSqr += sqr(sectorBounding.max.y - bounding.min.y);
- }
- }
- }
-
- for (int x = xMin; x < xMax; x++)
- {
- sectorBounding.max.x = sectorBounding.min.x + LOCALMEMORY_SECTOR_SIZE;
-
- //sectorDistanceSqr = Distance::AABB_AABB2DSq(bounding, sectorBounding);
-
- //Adding X distance sqr
- {
- sectorDistanceSqr = fDistYSqr;
- if (bounding.max.x < sectorBounding.min.x)
- {
- sectorDistanceSqr += sqr(bounding.max.x - sectorBounding.min.x);
- }
- else
- {
- if (bounding.min.x > sectorBounding.max.x)
- {
- sectorDistanceSqr += sqr(sectorBounding.max.x - bounding.min.x);
- }
- }
- }
-
- if (sectorDistanceSqr < modifiedmaxViewDistSqr)
- {
- *pMipFactor = min(*pMipFactor, sectorDistanceSqr * scale * scale * mipFactor);
- }
-
- pMipFactor++;
-
- sectorBounding.min.x = sectorBounding.max.x;
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CLocalMemoryUsage::STextureInfo::STextureInfo()
-{
- m_pTexture = NULL;
-
- //m_size = 0;
- //m_xSize = 0;
- //m_ySize = 0;
- //m_numMips = 0;
-}
-
-CLocalMemoryUsage::STextureInfo::~STextureInfo()
-{
- if (m_pTexture)
- {
- m_pTexture->Release();
- }
-}
-
-void CLocalMemoryUsage::STextureInfo::CheckOnAllSectorsP2()
-{
- int x, y, nMip, nStreamableMipNr, memoryUsage, xOldMemoryUsage, xOldPieces;
- bool nonZero;
- ITexture* pTexture;
-
- const RectI& actProcessedSectors = m_pLocalMemoryUsage->m_actProcessedSectors;
-
- bool wasDirty = false;
- for (y = 0; y < actProcessedSectors.h; y++)
- {
- int* pMemoryUsage = m_arrMemoryUsage;
- int* pPieces = m_arrPieces;
- if (m_arrRowDirty[y] || (wasDirty))
- {
- SSector* sector = &m_pLocalMemoryUsage->m_arrSectors[(y + actProcessedSectors.y) * LOCALMEMORY_SECTOR_NR_X + actProcessedSectors.x];
- float* pMipFactor = &m_arrMipFactor[y * actProcessedSectors.w ];
- xOldMemoryUsage = 0;
- xOldPieces = 0;
- for (x = 0; x < actProcessedSectors.w; x++)
- {
- nonZero = (*pMipFactor != BIG_NUMBER);
- if (nonZero) // One more row
- {
- pTexture = m_pTexture;
- if (!nonZero)
- {
- memoryUsage = 0;
- nStreamableMipNr = 0;
- }
- else
- {
- nMip = max(0, pTexture->StreamCalculateMipsSigned(*pMipFactor));
- memoryUsage = pTexture->GetStreamableMemoryUsage(nMip);
- nStreamableMipNr = pTexture->GetStreamableMipNumber() - nMip;
- }
-
- sector->m_memoryUsage_Textures += memoryUsage;
-
- xOldMemoryUsage = memoryUsage;
- *pMemoryUsage = memoryUsage;
- xOldPieces = nStreamableMipNr;
- *pPieces = nStreamableMipNr;
- }
- else
- {
- xOldMemoryUsage = 0;
- *pMemoryUsage = 0;
- xOldPieces = 0;
- *pPieces = 0;
- }
- sector++;
- pMipFactor++;
- pMemoryUsage++;
- pPieces++;
- }
- wasDirty = m_arrRowDirty[y];
- }
- else
- {
- for (x = 0; x < actProcessedSectors.w; x++)
- {
- *pMemoryUsage = 0;
- pMemoryUsage++;
- *pPieces = 0;
- pPieces++;
- }
- wasDirty = false;
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CLocalMemoryUsage::SMaterialInfo::SMaterialInfo()
-{
-}
-
-void CLocalMemoryUsage::SMaterialInfo::AddTextureInfo(STextureInfoAndTilingFactor textureInfo)
-{
- m_textures.push_back(textureInfo);
-}
-
-void CLocalMemoryUsage::SMaterialInfo::CheckOnAllSectorsP2()
-{
- int x, y;
-
- const RectI& actProcessedSectors = m_pLocalMemoryUsage->m_actProcessedSectors;
-
- for (y = 0; y < actProcessedSectors.h; y++)
- {
- if (m_arrRowDirty[y])
- {
- float* pMipFactor = &m_arrMipFactor[y * actProcessedSectors.w ];
- for (x = 0; x < actProcessedSectors.w; x++)
- {
- if (*pMipFactor != BIG_NUMBER)
- {
- //(Spidy) Send the material MinDistance values to textures
- for (TTextureVector::iterator it = m_textures.begin(); it != m_textures.end(); ++it)
- {
- STextureInfoAndTilingFactor& textureInfo = *it;
- textureInfo.m_pTextureInfo->m_arrRowDirty[y] = true;
-
- float& textureMipFactor = textureInfo.m_pTextureInfo->m_arrMipFactor[actProcessedSectors.w * y + x];
- textureMipFactor = min(textureMipFactor, *pMipFactor * textureInfo.m_tilingFactor);
- }
- }
- pMipFactor++;
- }
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CLocalMemoryUsage::SStatObjInfo::SStatObjInfo()
-{
- m_streamableContentMemoryUsage = 0;
-
- m_bSubObject = false;
- /*
- m_lodNr = 0;
- m_vertices = 0;
- m_indices = 0;
- m_meshSize = 0;
- m_physProxySize = 0;
- m_physPrimitives = 0;
- for( int i=0; i < MAX_LODS; i++)
- {
- m_indicesPerLod[i]=0;
- }
- */
-}
-
-void CLocalMemoryUsage::SStatObjInfo::CheckOnAllSectorsP2()
-{
- int x, y, memoryUsage, pieces, xOldMemoryUsage, xOldPieces;
- bool nonZero;
-
- const RectI& actProcessedSectors = m_pLocalMemoryUsage->m_actProcessedSectors;
-
- bool wasDirty = false;
- for (y = 0; y < actProcessedSectors.h; y++)
- {
- int* pMemoryUsage = m_arrMemoryUsage;
- int* pPieces = m_arrPieces;
- if (m_arrRowDirty[y])
- {
- SSector* sector = &m_pLocalMemoryUsage->m_arrSectors[(y + actProcessedSectors.y) * LOCALMEMORY_SECTOR_NR_X + actProcessedSectors.x];
- float* pMipFactor = &m_arrMipFactor[y * actProcessedSectors.w ];
- xOldMemoryUsage = 0;
- xOldPieces = 0;
- for (x = 0; x < actProcessedSectors.w; x++)
- {
- nonZero = (*pMipFactor != BIG_NUMBER);
- if (nonZero) // One more row
- {
- /*
- memoryUsage = 0;
- float minDistance = sqrt_tpl(minDistanceSqr);
- CStatObj* pStatObj = (CStatObj*)(m_pStatObj.get()); //(Spidy) Huh...
-
- //Iterate on all subobjects, like CStatObj::UpdateStreamableComponents
- float fSubObjectScale = 1.0f;
- //float fSubObjectScale = matSubObject.GetColumn0().GetLength(); //TODO
- int lod = pStatObj->GetLodFromScale(1.0f, fSubObjectScale, minDistance, false);
- //(Spidy) az objMatrix scale es a fLodRatioNorm mar bele vannak szamolva a minDistance-ba!
- memoryUsage = m_streamableContentMemoryUsage;
- */
- memoryUsage = m_streamableContentMemoryUsage;
- pieces = 1;
-
- if (!nonZero)
- {
- memoryUsage = 0;
- pieces = 0;
- }
-
- sector->m_memoryUsage_Geometry += memoryUsage;
-
- xOldMemoryUsage = memoryUsage;
- *pMemoryUsage = memoryUsage;
- xOldPieces = pieces;
- *pPieces = pieces;
- }
- else
- {
- xOldMemoryUsage = 0;
- *pMemoryUsage = 0;
- xOldPieces = 0;
- *pPieces = 0;
- }
- sector++;
- pMipFactor++;
- pMemoryUsage++;
- pPieces++;
- }
- wasDirty = m_arrRowDirty[y];
- }
- else
- {
- for (x = 0; x < actProcessedSectors.w; x++)
- {
- *pMemoryUsage = 0;
- pMemoryUsage++;
- *pPieces = 0;
- pPieces++;
- }
- wasDirty = false;
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CLocalMemoryUsage::SSector::SSector()
-{
- StartChecking();
-}
-
-void CLocalMemoryUsage::SSector::StartChecking()
-{
- m_memoryUsage_Textures = 0;
- m_memoryUsage_Geometry = 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-CLocalMemoryUsage::CLocalMemoryUsage()
-{
- REGISTER_CVAR(sys_LocalMemoryTextureLimit, 64, VF_NULL, "LocalMemoryUsage tool: Set the texture memory limit to check streaming (Mb/sec)");
- REGISTER_CVAR(sys_LocalMemoryGeometryLimit, 32, VF_NULL, "LocalMemoryUsage tool: Set the statobj geometry memory limit to check streaming (Mb/sec)");
- REGISTER_CVAR(sys_LocalMemoryTextureStreamingSpeedLimit, 10, VF_NULL, "LocalMemoryUsage tool: Texture streaming speed limit (approx, Mb/sec)");
- REGISTER_CVAR(sys_LocalMemoryGeometryStreamingSpeedLimit, 10, VF_NULL, "LocalMemoryUsage tool: Stat object geometry streaming speed limit (approx, Mb/sec)");
-
- REGISTER_CVAR(sys_LocalMemoryWarningRatio, 0.8f, VF_NULL, "LocalMemoryUsage tool: Warning ratio for streaming");
- REGISTER_CVAR(sys_LocalMemoryOuterViewDistance, 500.f, VF_NULL, "LocalMemoryUsage tool: View distance for debug draw");
- REGISTER_CVAR(sys_LocalMemoryInnerViewDistance, 100.f, VF_NULL, "LocalMemoryUsage tool: View distance for detailed debug draw");
-
- REGISTER_CVAR(sys_LocalMemoryStreamingSpeedObjectLength, 10.f, VF_NULL, "LocalMemoryUsage tool: Length of the streaming speed debug object");
- REGISTER_CVAR(sys_LocalMemoryStreamingSpeedObjectWidth, 1.5f, VF_NULL, "LocalMemoryUsage tool: Width of the streaming speed debug object");
- REGISTER_CVAR(sys_LocalMemoryObjectWidth, 6.f, VF_NULL, "LocalMemoryUsage tool: Width of the streaming buffer debug object");
- REGISTER_CVAR(sys_LocalMemoryObjectHeight, 2.f, VF_NULL, "LocalMemoryUsage tool: Height of the streaming buffer debug object");
- REGISTER_CVAR(sys_LocalMemoryObjectAlpha, 128, VF_NULL, "LocalMemoryUsage tool: Color alpha of the debug objects");
-
- REGISTER_CVAR(sys_LocalMemoryDiagramWidth, 0.5f, VF_NULL, "LocalMemoryUsage tool: Width of the diagrams OBSOLATE");
-
- REGISTER_CVAR(sys_LocalMemoryDiagramRadius, 2.5f, VF_NULL, "LocalMemoryUsage tool: Radius of the diagram");
- REGISTER_CVAR(sys_LocalMemoryDiagramDistance, -5.5f, VF_NULL, "LocalMemoryUsage tool: Distance of the diagram from the main debug object");
- REGISTER_CVAR(sys_LocalMemoryDiagramStreamingSpeedRadius, 1.0f, VF_NULL, "LocalMemoryUsage tool: Radius of the streaming speed diagram");
- REGISTER_CVAR(sys_LocalMemoryDiagramStreamingSpeedDistance, 2.2f, VF_NULL, "LocalMemoryUsage tool: Distance of the streaming speed diagram from the streaming speed debug line");
- REGISTER_CVAR(sys_LocalMemoryDiagramAlpha, 255, VF_NULL, "LocalMemoryUsage tool: Color alpha of the diagrams");
-
- REGISTER_CVAR(sys_LocalMemoryDrawText, 0, VF_NULL, "LocalMemoryUsage tool: If != 0, it will draw the numeric values");
- REGISTER_CVAR(sys_LocalMemoryLogText, 0, VF_NULL, "LocalMemoryUsage tool: If != 0, it will log the numeric values");
-
- REGISTER_CVAR(sys_LocalMemoryOptimalMSecPerSec, 100, VF_NULL, "LocalMemoryUsage tool: Optimal calculation time (MSec) per secundum");
- REGISTER_CVAR(sys_LocalMemoryMaxMSecBetweenCalls, 1000, VF_NULL, "LocalMemoryUsage tool: Maximal time difference (MSec) between calls");
-
- m_pStreamCgfPredicitionDistance = 0;
- m_pDebugDraw = 0;
- if (gEnv->pConsole)
- {
- m_pStreamCgfPredicitionDistance = gEnv->pConsole->GetCVar("e_StreamCgfPredicitionDistance");
- m_pDebugDraw = gEnv->pConsole->GetCVar("e_DebugDraw");
- }
-
- m_sectorNr.zero();
-
- m_actProcessedSectors = RectI(0, 0, 0, 0);
- m_actDrawedSectors = RectI(0, 0, 0, 0);
-
- m_AverageUpdateTime = 0.01f;
-
- m_sectorNr.x = LOCALMEMORY_SECTOR_NR_X; //TODO Check size of the world
- m_sectorNr.y = LOCALMEMORY_SECTOR_NR_Y;
-}
-
-CLocalMemoryUsage::~CLocalMemoryUsage()
-{
- DeleteGlobalData();
-}
-
-void CLocalMemoryUsage::DeleteGlobalData()
-{
- m_globalTextures.clear();
- m_globalMaterials.clear();
- m_globalStatObjs.clear();
-}
-
-void CLocalMemoryUsage::OnRender(IRenderer* pRenderer, const CCamera* camera)
-{
- if (!m_pDebugDraw || (m_pDebugDraw->GetIVal() != 17))
- {
- return;
- }
-
- const Matrix34& mat = camera->GetMatrix();
- Vec3 pos;
- Vec3 projectedPos;
- SSector* sector;
-
- SAuxGeomRenderFlags auxGeomRenderFlagsClose(e_Mode3D | e_AlphaBlended | e_DrawInFrontOn | e_FillModeSolid | e_CullModeBack | e_DepthWriteOff | e_DepthTestOff);
- SAuxGeomRenderFlags auxGeomRenderFlagsFar(e_Mode3D | e_AlphaBlended | e_DrawInFrontOff | e_FillModeSolid | e_CullModeBack | e_DepthWriteOff | e_DepthTestOn);
-
- IRenderAuxGeom* pRenderAuxGeom = pRenderer->GetIRenderAuxGeom();
-
- Vec3 cameraPos = mat.GetTranslation();
-
- int xMin = max(0, int((cameraPos.x - sys_LocalMemoryOuterViewDistance) / LOCALMEMORY_SECTOR_SIZE));
- int xMax = min(LOCALMEMORY_SECTOR_PER_PASS - 1, int((cameraPos.x + sys_LocalMemoryOuterViewDistance) / LOCALMEMORY_SECTOR_SIZE + 1));
- int yMin = max(0, int((cameraPos.y - sys_LocalMemoryOuterViewDistance) / LOCALMEMORY_SECTOR_SIZE));
- int yMax = min(LOCALMEMORY_SECTOR_PER_PASS - 1, int((cameraPos.y + sys_LocalMemoryOuterViewDistance) / LOCALMEMORY_SECTOR_SIZE + 1));
- m_actDrawedSectors.x = xMin;
- m_actDrawedSectors.y = yMin;
- m_actDrawedSectors.w = xMax - xMin + 1;
- m_actDrawedSectors.h = yMax - yMin + 1;
-
- CTimeValue actTime = gEnv->pTimer->GetAsyncTime();
- float timeSin = sin_tpl(actTime.GetSeconds() * 10.0f) * 0.5f + 0.5f;
-
- ColorB color;
- ColorB colorOK(LOCALMEMORY_COLOR_OK, sys_LocalMemoryObjectAlpha);
- ColorB colorWarning(LOCALMEMORY_COLOR_WARNING, sys_LocalMemoryObjectAlpha);
- ColorB colorError(LOCALMEMORY_COLOR_ERROR, uint8(sys_LocalMemoryObjectAlpha * timeSin));
- ColorB colorTexture(LOCALMEMORY_COLOR_TEXTURE, sys_LocalMemoryDiagramAlpha);
- ColorB colorGeometry(LOCALMEMORY_COLOR_GEOMETRY, sys_LocalMemoryDiagramAlpha);
- ColorB colorBlack(LOCALMEMORY_COLOR_BLACK);
- f32 fColorOK[4] = {LOCALMEMORY_FCOLOR_OK, 1};
- f32 fColorWarning[4] = {LOCALMEMORY_FCOLOR_WARNING, 1};
- f32 fColorError[4] = {LOCALMEMORY_FCOLOR_ERROR, 1};
- f32 fColorOther[4] = {LOCALMEMORY_FCOLOR_OTHER, 1};
-
- f32* pColor;
- Vec3 v0, v1, v2, v3, v4, vTextureDiagram, vTextureDiagram2, vGeometryDiagram, vGeometryDiagram2;
-
- float localMemoryTextureLimit = sys_LocalMemoryTextureLimit * 1024.f * 1024.f;
- float localMemoryGeometryLimit = sys_LocalMemoryGeometryLimit * 1024.f * 1024.f;
-
- //The assumption is that this is called on Main Thread, otherwise the loop
- //Should be wrapped inside a EnumerateHandlers lambda.
- auto terrain = AzFramework::Terrain::TerrainDataRequestBus::FindFirstHandler();
- const float defaultTerrainHeight = AzFramework::Terrain::TerrainDataRequests::GetDefaultTerrainHeight();
-
- for (int y = yMin; y < yMax; y++)
- {
- sector = &m_arrSectors[xMin + y * LOCALMEMORY_SECTOR_NR_X];
- for (int x = xMin; x < xMax; x++)
- {
- pos.x = (x + 0.5f) * LOCALMEMORY_SECTOR_SIZE;
- pos.y = (y + 0.5f) * LOCALMEMORY_SECTOR_SIZE;
- pos.z = terrain ? terrain->GetHeightFromFloats(pos.x, pos.y) : defaultTerrainHeight;
-
- if (m_pDebugDraw->GetIVal() == 17)
- {
- float textureRatio = sector->m_memoryUsage_Textures / localMemoryTextureLimit;
- float geometryRatio = sector->m_memoryUsage_Geometry / localMemoryGeometryLimit;
- float maxRatio = max(textureRatio, geometryRatio);
-
- v0 = pos;
- v1 = pos + Vec3(-sys_LocalMemoryObjectWidth, -sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectHeight);
- v2 = pos + Vec3(sys_LocalMemoryObjectWidth, -sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectHeight);
- v3 = pos + Vec3(sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectHeight);
- v4 = pos + Vec3(-sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectWidth, sys_LocalMemoryObjectHeight);
-
- if (camera->Project(v1, projectedPos) || camera->Project(v2, projectedPos) || camera->Project(v3, projectedPos) || camera->Project(v4, projectedPos))
- {
- vTextureDiagram = pos + Vec3(0.f, sys_LocalMemoryObjectWidth + sys_LocalMemoryDiagramDistance + sys_LocalMemoryDiagramRadius, sys_LocalMemoryObjectHeight);
- vGeometryDiagram = pos + Vec3(0.f, -sys_LocalMemoryObjectWidth - sys_LocalMemoryDiagramDistance - sys_LocalMemoryDiagramRadius, sys_LocalMemoryObjectHeight);
-
- if (maxRatio < sys_LocalMemoryWarningRatio)
- {
- color = colorOK;
- pColor = fColorOK;
- }
- else if (maxRatio < 1.0f)
- {
- color = colorWarning;
- pColor = fColorWarning;
- }
- else
- {
- color = colorError;
- pColor = fColorError;
- }
-
- bool close = (Distance::Point_Point2D(cameraPos, pos) < sys_LocalMemoryInnerViewDistance);
- if (close)
- {
- pRenderAuxGeom->SetRenderFlags(auxGeomRenderFlagsClose);
-
- static int xDebug = 14;
- static int yDebug = 19;
-
- if (sys_LocalMemoryDrawText)
- {
- camera->Project(pos, projectedPos);
-
- pRenderer->Draw2dLabel(projectedPos.x, projectedPos.y, 1.2f, pColor, true, "Text: %.2fMb Geom: %.2fMb", sector->m_memoryUsage_Textures / (1024.f * 1024.f), sector->m_memoryUsage_Geometry / (1024.f * 1024.f));
- /* For sector debugging
- pRenderer->Draw2dLabel(projectedPos.x, projectedPos.y, 1.2f, pColor, true, "Text: %.1fMb Geom: %.1fMb - %d : %d", sector->m_memoryUsage_Textures/(1024.f*1024.f), sector->m_memoryUsage_Geometry/(1024.f*1024.f), x, y);
-
- if( xDebug == x && yDebug == y )
- {
- float sx = projectedPos.x-80;
- float sy = projectedPos.y;
-
- for( TStatObjMap::iterator it = m_globalStatObjs.begin(); it != m_globalStatObjs.end(); ++it )
- {
- SStatObjInfo *statObjInfo = &it->second;
- IStatObj* pStatObj = statObjInfo->m_pStatObj;
-
- int memoryUsage = 0;
- float mipFactor = statObjInfo->m_arrMipFactor[y * m_actProcessedSectors.w + x];
- if( mipFactor != BIG_NUMBER )
- {
- memoryUsage = statObjInfo->m_streamableContentMemoryUsage;
- }
- sy+=15.f;
- pRenderer->Draw2dLabel(sx, sy, 1.2f, pColor, false, "Geom: %.2fMb %.4f Act:%s Orig:%s %s", memoryUsage/(1024.f*1024.f), mipFactor, pStatObj->GetFilePath(), statObjInfo->m_filePath, statObjInfo->m_bSubObject ? " SUBOBJECT" : "");
- //pRenderer->Draw2dLabel(sx, sy, 1.2f, pColor, false, "Geom: %.2fMb %.4f", memoryUsage/(1024.f*1024.f), mipFactor);
- }
- }
- //*/
- }
- if (sys_LocalMemoryLogText)
- {
- if (xDebug == x && yDebug == y)
- {
- for (TTextureMap::iterator it = m_globalTextures.begin(); it != m_globalTextures.end(); ++it)
- {
- STextureInfo* textureObjInfo = &it->second;
- ITexture* pTexture = textureObjInfo->m_pTexture;
-
- float mipFactor = textureObjInfo->m_arrMipFactor[y * m_actProcessedSectors.w + x];
- if (mipFactor != BIG_NUMBER)
- {
- CryLog("Texture: %s %dX%d mipfactor:%.4f", pTexture->GetName(), pTexture->GetWidth(), pTexture->GetHeight(), mipFactor);
- }
- }
- sys_LocalMemoryLogText = false; //Log only once!
- }
- }
- }
- else
- {
- pRenderAuxGeom->SetRenderFlags(auxGeomRenderFlagsFar);
- }
-
- pRenderAuxGeom->DrawTriangle(v1, color, v2, color, v3, color);
- pRenderAuxGeom->DrawTriangle(v3, color, v4, color, v1, color);
-
- pRenderAuxGeom->DrawTriangle(v0, color, v1, color, v4, color);
- pRenderAuxGeom->DrawTriangle(v0, color, v2, color, v1, color);
- pRenderAuxGeom->DrawTriangle(v0, color, v3, color, v2, color);
- pRenderAuxGeom->DrawTriangle(v0, color, v4, color, v3, color);
-
- if (close)
- {
- LocalMemoryUsageDrawHelper::DrawCircle(pRenderer, camera, vTextureDiagram, sys_LocalMemoryDiagramRadius, textureRatio, colorTexture, colorBlack);
- LocalMemoryUsageDrawHelper::DrawCircle(pRenderer, camera, vGeometryDiagram, sys_LocalMemoryDiagramRadius, geometryRatio, colorGeometry, colorBlack);
- }
- }
- }
-
- sector++;
- }
- }
-}
-
-void CLocalMemoryUsage::OnUpdate()
-{
- if (!m_pDebugDraw || (m_pDebugDraw->GetIVal() != 17))
- {
- return;
- }
-
- //CryLogAlways("OnUpdate start-----------------------------------------");
- CTimeValue actTime = gEnv->pTimer->GetAsyncTime();
-
- float callTimeDiff = (actTime - m_LastCallTime).GetSeconds();
- float neededCallTimeDiff = m_AverageUpdateTime / (sys_LocalMemoryOptimalMSecPerSec / 1000.f);
-
- if (callTimeDiff < neededCallTimeDiff && callTimeDiff < sys_LocalMemoryMaxMSecBetweenCalls / 1000.f)
- {
- return;
- }
-
- DeleteUnusedResources();
-
- m_LastCallTime = actTime;
-
- {
- FRAME_PROFILER("! LocalMemoryUsege::Update - Start", GetISystem(), PROFILE_SYSTEM);
- //StartChecking(RectI(0,0,m_sectorNr.x, m_sectorNr.y));
- StartChecking(m_actDrawedSectors);
- }
-
- {
- FRAME_PROFILER("! LocalMemoryUsege::Update - CollectGeometry P1", GetISystem(), PROFILE_SYSTEM);
- CollectGeometryP1();
- }
-
- {
- FRAME_PROFILER("! LocalMemoryUsege::Update - Materials P2", GetISystem(), PROFILE_SYSTEM);
- //We must iterate on materials first
- for (TMaterialMap::iterator it = m_globalMaterials.begin(); it != m_globalMaterials.end(); ++it)
- {
- it->second.CheckOnAllSectorsP2();
- }
- }
- {
- FRAME_PROFILER("! LocalMemoryUsege::Update - Textures P2", GetISystem(), PROFILE_SYSTEM);
- for (TTextureMap::iterator it = m_globalTextures.begin(); it != m_globalTextures.end(); ++it)
- {
- it->second.CheckOnAllSectorsP2();
- }
- }
- {
- FRAME_PROFILER("! LocalMemoryUsege::Update - StatObjects P2", GetISystem(), PROFILE_SYSTEM);
- for (TStatObjMap::iterator it = m_globalStatObjs.begin(); it != m_globalStatObjs.end(); ++it)
- {
- it->second.CheckOnAllSectorsP2();
- }
- }
-
- CTimeValue endTime = gEnv->pTimer->GetAsyncTime();
- m_AverageUpdateTime = LERP(m_AverageUpdateTime, (endTime - actTime).GetSeconds(), 0.5f);
-
- //CryLogAlways("OnUpdate end***");
-}
-
-void CLocalMemoryUsage::DeleteUnusedResources()
-{
- FRAME_PROFILER("! LocalMemoryUsege::Update - Deleting unused resources", GetISystem(), PROFILE_SYSTEM);
-
- // Clear the used flags
- for (TStatObjMap::iterator it = m_globalStatObjs.begin(); it != m_globalStatObjs.end(); ++it)
- {
- it->second.m_used = false;
- }
-
- // Iterate on used StatObjs
- int nCount;
- gEnv->p3DEngine->GetLoadedStatObjArray(NULL, nCount);
- std::vector objectsArray;
- objectsArray.resize(nCount);
- if (nCount > 0)
- {
- gEnv->p3DEngine->GetLoadedStatObjArray(&objectsArray[0], nCount);
- }
-
- for (std::vector::iterator it = objectsArray.begin(); it != objectsArray.end(); ++it)
- {
- IStatObj* pStatObj = *it;
- TStatObjMap::iterator findIt = m_globalStatObjs.find((INT_PTR)pStatObj);
-
- if (findIt != m_globalStatObjs.end() && strcmp(pStatObj->GetFilePath(), findIt->second.m_filePath) == 0 && !findIt->second.m_bSubObject)
- {
- findIt->second.m_used = true;
- }
-
- if (pStatObj->GetFlags() & STATIC_OBJECT_COMPOUND)
- {
- for (int k = 0; k < pStatObj->GetSubObjectCount(); k++)
- {
- if (!pStatObj->GetSubObject(k))
- {
- continue;
- }
-
- IStatObj* pSubStatObj = pStatObj->GetSubObject(k)->pStatObj;
-
- if (pSubStatObj)
- {
- findIt = m_globalStatObjs.find((INT_PTR)pSubStatObj);
-
- if (findIt != m_globalStatObjs.end() && strcmp(pSubStatObj->GetFilePath(), findIt->second.m_filePath) == 0 && findIt->second.m_bSubObject)
- {
- findIt->second.m_used = true;
- }
- }
- }
- }
- }
-
- // Erase non-used StatObjs
- bool changed = true;
- while (changed)
- {
- changed = false;
- for (TStatObjMap::iterator it = m_globalStatObjs.begin(); it != m_globalStatObjs.end(); ++it)
- {
- if (!it->second.m_used)
- {
- m_globalStatObjs.erase(it);
- changed = true;
- break;
- }
- }
- }
- /*
- for( TTextureMap::iterator it = m_globalTextures.begin(); it != m_globalTextures.end(); ++it )
- it->second.m_used = false;
-
- bool changed = true;
- while( changed )
- {
- changed = false;
- for( TTextureMap::iterator it = m_globalTextures.begin(); it != m_globalTextures.end(); ++it )
- {
- if( !it->second.m_used )
- {
- m_globalTextures.erase(it);
- changed = true;
- break;
- }
- }
- }
-
- for( TMaterialMap::iterator it = m_globalMaterials.begin(); it != m_globalMaterials.end(); ++it )
- it->second.m_used = false;
-
- changed = true;
- while( changed )
- {
- changed = false;
- for( TMaterialMap::iterator it = m_globalMaterials.begin(); it != m_globalMaterials.end(); ++it )
- {
- if( !it->second.m_used )
- {
- m_globalMaterials.erase(it);
- changed = true;
- break;
- }
- }
- }
- //*/
-}
-void CLocalMemoryUsage::StartChecking(const RectI& actProcessedSectors)
-{
- m_actProcessedSectors = actProcessedSectors;
-
- for (int y = 0; y < m_sectorNr.y; y++)
- {
- SSector* sector = &m_arrSectors[y * LOCALMEMORY_SECTOR_NR_X];
- for (int x = 0; x < m_sectorNr.x; x++)
- {
- sector->StartChecking();
- sector++;
- }
- }
-
- {
- for (TTextureMap::iterator it = m_globalTextures.begin(); it != m_globalTextures.end(); ++it)
- {
- //FRAME_PROFILER("! LocalMemoryUsege::StartChecking - Textures", GetISystem(), PROFILE_SYSTEM);
- it->second.StartChecking();
- }
- }
- {
- for (TMaterialMap::iterator it = m_globalMaterials.begin(); it != m_globalMaterials.end(); ++it)
- {
- //FRAME_PROFILER("! LocalMemoryUsege::StartChecking - Materials", GetISystem(), PROFILE_SYSTEM);
- it->second.StartChecking();
- }
- }
- {
- for (TStatObjMap::iterator it = m_globalStatObjs.begin(); it != m_globalStatObjs.end(); ++it)
- {
- //FRAME_PROFILER("! LocalMemoryUsege::StartChecking - StatObjects", GetISystem(), PROFILE_SYSTEM);
- it->second.StartChecking();
- }
- }
-}
-
-void CLocalMemoryUsage::CollectGeometryP1()
-{
- ISystem* pSystem = GetISystem();
- I3DEngine* p3DEngine = pSystem->GetI3DEngine();
-
- // iterate through all instances
- std::vector renderNodes;
-
- uint32 dwCount = 0;
-
- dwCount += p3DEngine->GetObjectsByType(eERType_Light);
-
- dwCount += p3DEngine->GetObjectsByType(eERType_RenderComponent);
- dwCount += p3DEngine->GetObjectsByType(eERType_SkinnedMeshRenderComponent);
- dwCount += p3DEngine->GetObjectsByType(eERType_StaticMeshRenderComponent);
- dwCount += p3DEngine->GetObjectsByType(eERType_DynamicMeshRenderComponent);
- dwCount += p3DEngine->GetObjectsByType(eERType_Decal);
-
- if (dwCount > 0)
- {
- renderNodes.resize(dwCount + 1);
- dwCount = 0;
-
- dwCount += p3DEngine->GetObjectsByType(eERType_Light, &renderNodes[dwCount]);
- dwCount += p3DEngine->GetObjectsByType(eERType_RenderComponent, &renderNodes[dwCount]);
- dwCount += p3DEngine->GetObjectsByType(eERType_StaticMeshRenderComponent, &renderNodes[dwCount]);
- dwCount += p3DEngine->GetObjectsByType(eERType_DynamicMeshRenderComponent, &renderNodes[dwCount]);
- dwCount += p3DEngine->GetObjectsByType(eERType_SkinnedMeshRenderComponent, &renderNodes[dwCount]);
- dwCount += p3DEngine->GetObjectsByType(eERType_Decal, &renderNodes[dwCount]);
-
- AABB objBox;
-
- for (uint32 dwI = 0; dwI < dwCount; ++dwI)
- {
- IRenderNode* pRenderNode = renderNodes[dwI];
-
- if (pRenderNode->m_fWSMaxViewDist < 0.01f)
- {
- continue;
- }
-
- float objScale = 1.f;
- if (pRenderNode->GetRenderNodeType() == eERType_Decal)
- {
- IDecalRenderNode* pDecal = (IDecalRenderNode*)pRenderNode;
- objScale = max(0.001f, pDecal->GetMatrix().GetColumn0().GetLength());
- }
- else if (pRenderNode->GetRenderNodeType() == eERType_FogVolume)
- {
- objScale = max(0.001f, ((IFogVolumeRenderNode*)pRenderNode)->GetMatrix().GetColumn0().GetLength());
- }
-
- float maxViewDist = pRenderNode->m_fWSMaxViewDist;
- pRenderNode->FillBBox(objBox);
-
- _smart_ptr pRenderNodeMat = pRenderNode->GetMaterialOverride();
-
- {
- IStatObj* pStatObj = pRenderNode->GetEntityStatObj();
-
- if (pStatObj != NULL)
- {
- CheckStatObjMaterialP1(pStatObj, pRenderNodeMat, objBox, maxViewDist, objScale);
- }
- else
- {
- CheckMeshMaterialP1(pRenderNode->GetRenderMesh(0), pRenderNodeMat, objBox, maxViewDist, objScale);
- }
- }
-
- for (int dwSlot = 0; dwSlot < pRenderNode->GetSlotCount(); ++dwSlot)
- {
- _smart_ptr pSlotMat = pRenderNode->GetEntitySlotMaterial(dwSlot);
- if (!pSlotMat)
- {
- pSlotMat = pRenderNodeMat;
- }
-
- Matrix34A matParent;
-
- if (IStatObj* pStatObj = pRenderNode->GetEntityStatObj(dwSlot, 0, &matParent, true))
- {
- CheckStatObjP1(pStatObj, pRenderNode, objBox, maxViewDist, objScale);
-
- _smart_ptr pStatObjMat = pStatObj->GetMaterial();
- CheckStatObjMaterialP1(pStatObj, pSlotMat ? pSlotMat : pStatObjMat, objBox, maxViewDist, objScale);
- }
- }
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-PREFAST_SUPPRESS_WARNING(6262);
-CLocalMemoryUsage::SStatObjInfo* CLocalMemoryUsage::CheckStatObjP1(IStatObj* pStatObj, [[maybe_unused]] IRenderNode* pRenderNode, AABB bounding, float maxViewDist, float scale)
-{
- if (!pStatObj)
- {
- return NULL;
- }
-
- if (strncmp(pStatObj->GetFilePath(), "%level%", 7) == 0) //HACK %LEVEL% brushes
- {
- return NULL;
- }
-
- SStatObjInfo* pStatObjInfo = NULL;
-
- TStatObjMap::iterator iter = m_globalStatObjs.find((INT_PTR)pStatObj);
- if (iter != m_globalStatObjs.end())
- {
- pStatObjInfo = &iter->second;
- pStatObjInfo->m_streamableContentMemoryUsage = pStatObj->GetStreamableContentMemoryUsage(); //TODO TEMP
- }
- else
- {
- {
- FRAME_PROFILER("! CLocalMemoryUsage::CheckStatObjP1 HASH", GetISystem(), PROFILE_SYSTEM);
- PREFAST_SUPPRESS_WARNING(6262)
- pStatObjInfo = &m_globalStatObjs[(INT_PTR)pStatObj];
- }
-
- pStatObjInfo->Init(this);
- pStatObjInfo->m_streamableContentMemoryUsage = pStatObj->GetStreamableContentMemoryUsage();
- //pStatObjInfo->m_pStatObj = pStatObj;
- pStatObjInfo->m_filePath = pStatObj->GetFilePath();
- pStatObjInfo->m_bSubObject = pStatObj->IsSubObject();
- //CollectStatObjInfo_Recursive( pStatObjInfo, pStatObj );
- }
-
- pStatObjInfo->CheckOnAllSectorsP1(bounding, maxViewDist, scale, 1.0f);
-
- return pStatObjInfo;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-PREFAST_SUPPRESS_WARNING(6262);
-void CLocalMemoryUsage::CheckMaterialP1(_smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale, float mipFactor)
-{
- if (pMaterial)
- {
- SMaterialInfo* pMaterialInfo = NULL;
-
- TMaterialMap::iterator iter = m_globalMaterials.find((INT_PTR)pMaterial.get());
- if (iter != m_globalMaterials.end())
- {
- pMaterialInfo = &iter->second;
- }
- else
- {
- {
- FRAME_PROFILER("! CLocalMemoryUsage::CheckMaterialP1 HASH", GetISystem(), PROFILE_SYSTEM);
- PREFAST_SUPPRESS_WARNING(6262)
- pMaterialInfo = &m_globalMaterials[(INT_PTR)pMaterial.get()];
- }
- pMaterialInfo->Init(this);
- //pMaterialInfo->m_pMaterial=pMaterial;
- CollectMaterialInfo_Recursive(pMaterialInfo, pMaterial);
- }
-
- pMaterialInfo->CheckOnAllSectorsP1(bounding, maxViewDist, scale, mipFactor);
- }
-}
-
-PREFAST_SUPPRESS_WARNING(6262);
-void CLocalMemoryUsage::CheckChunkMaterialP1(_smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale, CRenderChunk* pRenderChunk)
-{
- _smart_ptr pCurrentMaterial = pMaterial;
-
- if (pRenderChunk != NULL)
- {
- if (pRenderChunk->m_nMatID < pMaterial->GetSubMtlCount())
- {
- pCurrentMaterial = pMaterial->GetSubMtl(pRenderChunk->m_nMatID);
- }
-
- if (pCurrentMaterial != NULL)
- {
- CheckMaterialP1(pCurrentMaterial, bounding, maxViewDist, scale, pRenderChunk->m_texelAreaDensity);
- }
- }
- else
- {
- CheckMaterialP1(pCurrentMaterial, bounding, maxViewDist, scale, 1.f);
- }
-}
-
-PREFAST_SUPPRESS_WARNING(6262);
-void CLocalMemoryUsage::CheckMeshMaterialP1(IRenderMesh* pRenderMesh, _smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale)
-{
- if (pRenderMesh)
- {
- if (pMaterial)
- {
- TRenderChunkArray* pChunks = &pRenderMesh->GetChunks();
-
- if (pChunks != NULL)
- {
- for (unsigned int i = 0; i < pChunks->size(); i++)
- {
- CheckChunkMaterialP1(pMaterial, bounding, maxViewDist, scale, &(*pChunks)[i]);
- }
- }
-
- pChunks = &pRenderMesh->GetChunksSkinned();
- for (unsigned int i = 0; i < pChunks->size(); i++)
- {
- CheckChunkMaterialP1(pMaterial, bounding, maxViewDist, scale, &(*pChunks)[i]);
- }
- }
- }
- else
- {
- if (pMaterial)
- {
- CheckChunkMaterialP1(pMaterial, bounding, maxViewDist, scale, NULL);
- }
- }
-}
-
-void CLocalMemoryUsage::CheckStatObjMaterialP1(IStatObj* pStatObj, _smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale)
-{
- if (pStatObj)
- {
- for (int i = 0; i < pStatObj->GetSubObjectCount(); i++)
- {
- CheckStatObjMaterialP1(pStatObj->GetSubObject(i)->pStatObj, pMaterial, bounding, scale, maxViewDist);
- }
-
- CheckMeshMaterialP1(pStatObj->GetRenderMesh(), pMaterial, bounding, maxViewDist, scale);
- }
-}
-
-void CLocalMemoryUsage::CollectMaterialInfo_Recursive(SMaterialInfo* materialInfo, _smart_ptr pMaterial)
-{
- SShaderItem& rItem = pMaterial->GetShaderItem();
-
- uint32 dwSubMatCount = pMaterial->GetSubMtlCount();
-
- for (uint32 dwSubMat = 0; dwSubMat < dwSubMatCount; ++dwSubMat)
- {
- _smart_ptr pSub = pMaterial->GetSubMtl(dwSubMat);
-
- if (pSub)
- {
- CollectMaterialInfo_Recursive(materialInfo, pSub);
- }
- }
-
- // this pMaterial
- if (rItem.m_pShaderResources)
- {
- for (auto iter = rItem.m_pShaderResources->GetTexturesResourceMap()->begin();
- iter != rItem.m_pShaderResources->GetTexturesResourceMap()->end(); ++iter)
- {
- const SEfResTexture* pTextureRes = &iter->second;
-
- if (pTextureRes->m_Sampler.m_pITex)
- {
- ITexture* pTexture = pTextureRes->m_Sampler.m_pITex;
- if (pTexture && pTexture->GetStreamableMipNumber() > 0)
- {
- STextureInfoAndTilingFactor textureInfo;
-
- textureInfo.m_pTextureInfo = GetTextureInfo(pTexture);
- textureInfo.m_tilingFactor = pTextureRes->GetTiling(0) * pTextureRes->GetTiling(1);
-
- materialInfo->AddTextureInfo(textureInfo);
- }
- }
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-PREFAST_SUPPRESS_WARNING(6262)
-CLocalMemoryUsage::STextureInfo * CLocalMemoryUsage::GetTextureInfo(ITexture * pTexture)
-{
- if (!pTexture)
- {
- return NULL;
- }
-
- TTextureMap::iterator iter = m_globalTextures.find((INT_PTR)pTexture);
- if (iter != m_globalTextures.end())
- {
- return &iter->second;
- }
-
- //FUNCTION_PROFILER(GetISystem(), PROFILE_SYSTEM);
- STextureInfo* pTextureInfo;
- {
- FRAME_PROFILER("! CLocalMemoryUsage::CheckStatObjP1 HASH", GetISystem(), PROFILE_SYSTEM);
- PREFAST_SUPPRESS_WARNING(6262)
- pTextureInfo = &m_globalTextures[(INT_PTR)pTexture];
- }
- pTextureInfo->Init(this);
- pTextureInfo->m_pTexture = pTexture;
- pTexture->AddRef();
-
- //Collect informations
- //pTextureInfo->m_size = pTexture->GetDeviceDataSize();
- //pTextureInfo->m_xSize = pTexture->GetWidth();
- //pTextureInfo->m_ySize = pTexture->GetHeight();
- //pTextureInfo->m_numMips = pTexture->GetNumMips();
-
- return pTextureInfo;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.h b/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.h
deleted file mode 100644
index 450e2eb2f9..0000000000
--- a/Code/CryEngine/CrySystem/Statistics/LocalMemoryUsage.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
-* its licensors.
-*
-* For complete copyright and license terms please see the LICENSE at the root of this
-* distribution (the "License"). All use of this software is governed by the License,
-* or, if provided, by the license below or the license accompanying this file. Do not
-* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*
-*/
-// Original file Copyright Crytek GMBH or its affiliates, used under license.
-
-// Description : Visual helper for checking a local memory usage on maps
-
-
-#ifndef CRYINCLUDE_CRYSYSTEM_STATISTICS_LOCALMEMORYUSAGE_H
-#define CRYINCLUDE_CRYSYSTEM_STATISTICS_LOCALMEMORYUSAGE_H
-#pragma once
-
-
-#include "../CryCommon/Cry_Geo.h"
-#include "ILocalMemoryUsage.h"
-#include "TimeValue.h"
-
-#define LOCALMEMORY_SECTOR_SIZE 32.f //Size of one sector
-#define LOCALMEMORY_SECTOR_NR_X 128 //4096 / LOCALMEMORY_SECTOR_SIZE Sector number of the world (x)
-#define LOCALMEMORY_SECTOR_NR_Y 128 //4096 / LOCALMEMORY_SECTOR_SIZE Sector number of the world (y)
-#define LOCALMEMORY_SECTOR_PER_PASS 128 //4096 / 32 Sector nr for one calculation pass. Now it is the whole world;
-
-//Sector number must be = LOCALMEMORY_SECTOR_PER_PASS * n
-
-#define LOCALMEMORY_COLOR_OK 0, 255, 0
-#define LOCALMEMORY_COLOR_WARNING 255, 255, 0
-#define LOCALMEMORY_COLOR_ERROR 255, 0, 0
-#define LOCALMEMORY_COLOR_TEXTURE 0, 0, 255
-#define LOCALMEMORY_COLOR_GEOMETRY 0, 0, 0
-#define LOCALMEMORY_COLOR_BLACK 0, 0, 0, 192
-#define LOCALMEMORY_FCOLOR_OK 0, 1, 0
-#define LOCALMEMORY_FCOLOR_WARNING 1, 1, 0
-#define LOCALMEMORY_FCOLOR_ERROR 1, 0, 0
-#define LOCALMEMORY_FCOLOR_OTHER 0, 0, 1
-
-struct IMaterial;
-struct IStatObj;
-struct IRenderMesh;
-struct IRenderNode;
-struct CRenderChunk;
-class CCamera;
-
-#include
-
-struct CLocalMemoryUsage
- : public ILocalMemoryUsage
-{
-private:
-
- struct STextureInfo;
- struct SMaterialInfo;
- struct SStatObjInfo;
-
- typedef std__hash_map TTextureMap; // Type: hash map of textures
- typedef std__hash_map TMaterialMap; // Type: hash map of materials
- typedef std__hash_map TStatObjMap; // Type: hash map of stat objects
-
- //*******************
-
- struct SResource
- {
- CLocalMemoryUsage* m_pLocalMemoryUsage; // Inner pointer to the singleton (we can use gEnv->pLocalMemoryUsage with type cast instead this)
-
- float m_arrMipFactor[LOCALMEMORY_SECTOR_PER_PASS * LOCALMEMORY_SECTOR_PER_PASS]; // Mipmap factor based on minimum distance of the resource from the sector (bounding box distance)
- bool m_arrRowDirty[LOCALMEMORY_SECTOR_PER_PASS]; // Dirty flag for m_arrMipFactor rows
- bool m_used;
-
- static int m_arrMemoryUsage[LOCALMEMORY_SECTOR_PER_PASS]; // Memory usage of the resource in sectors (last row)
- static int m_arrPieces[LOCALMEMORY_SECTOR_PER_PASS]; // Pieces nr of the resource in sectors (last row)
-
- virtual void StartChecking(); // Called every frame first
- void CheckOnAllSectorsP1(const AABB& bounding, float maxViewDist, float viewDistMultiplierForLOD, float mipFactor); // Calculates the minimum of sector bounding vs renderobject bounding distances
-
- SResource();
- virtual void Init(CLocalMemoryUsage* pLocalMemoryUsage);
- //If we will needed a destructor, it must be virtual!
- };
-
- //*******************
-
- struct STextureInfo
- : public SResource
- {
- ITexture* m_pTexture; // Texture pointer
- //int m_size; // For later use - Used memory
- //int m_xSize; // For later use - Texture x size
- //int m_ySize; // For later use - Texture y size
- //int m_numMips; // For later use - Number of mip maps
-
- void CheckOnAllSectorsP2(); // Calculate memory usage using distances
-
- STextureInfo();
- ~STextureInfo();
- };
-
- //*******************
-
- struct STextureInfoAndTilingFactor
- {
- STextureInfo* m_pTextureInfo;
- float m_tilingFactor;
- };
-
- typedef std::vector TTextureVector; // Type: vector of textures
-
- struct SMaterialInfo
- : public SResource
- {
- //_smart_ptr m_pMaterial; // For later use
- TTextureVector m_textures; // Used textures
-
- SMaterialInfo();
-
- void AddTextureInfo(STextureInfoAndTilingFactor texture);// Add a new texture (unique)
- void CheckOnAllSectorsP2(); // Forward distance informations to textures
- };
-
- //*******************
-
- struct SStatObjInfo
- : public SResource
- {
- int m_streamableContentMemoryUsage; // Total streamable memory usage
- //IStatObj *m_pStatObj; //TODO kiszedni
- string m_filePath; // The original file name and path of the StatObj
- bool m_bSubObject; // Is the original StatObj a subobject?
- /*
- int m_lodNr; // For later use
- int m_vertices;
- int m_meshSize;
- int m_physProxySize;
- int m_physPrimitives;
- int m_indices;
- int m_indicesPerLod[MAX_LODS];
- */
-
- SStatObjInfo();
- void CheckOnAllSectorsP2(); // Calculate memory usage using distances
- };
-
- //*******************
-
- struct SSector
- {
- SSector();
-
- void StartChecking(); // Called every frame first
-
- int m_memoryUsage_Textures; // Sum of texture memory usage
-
- int m_memoryUsage_Geometry; // Sum of geometry memory usage
- };
-
- //*******************
- PREFAST_SUPPRESS_WARNING(6262);
- TTextureMap m_globalTextures; // Hash map of resources: textures
- PREFAST_SUPPRESS_WARNING(6262);
- TMaterialMap m_globalMaterials; // Hash map of resources: materials
- PREFAST_SUPPRESS_WARNING(6262);
- TStatObjMap m_globalStatObjs; // Hash map of resources: stat objects
-
- ICVar* m_pStreamCgfPredicitionDistance; // Config: additional object distance for streaming
- ICVar* m_pDebugDraw; // Config: debug draw mode
-
- int sys_LocalMemoryTextureLimit; // Config: texture limit for streaming
- int sys_LocalMemoryGeometryLimit; // Config: stat object geometry limit for streaming
- int sys_LocalMemoryTextureStreamingSpeedLimit; // Config: texture streaming speed limit (approx)
- int sys_LocalMemoryGeometryStreamingSpeedLimit; // Config: stat object geometry streaming speed limit (approx)
-
- float sys_LocalMemoryWarningRatio; // Config: Warning ratio for streaming
- float sys_LocalMemoryOuterViewDistance; // Config: View distance for debug draw
- float sys_LocalMemoryInnerViewDistance; // Config: View distance for detailed debug draw
-
- float sys_LocalMemoryObjectWidth; // Config: Width of the debug object
- float sys_LocalMemoryObjectHeight; // Config: Height of the debug object
- int sys_LocalMemoryObjectAlpha; // Config: Color alpha of the debug object
-
- float sys_LocalMemoryStreamingSpeedObjectLength; // Config: Length of the streaming speed debug object
- float sys_LocalMemoryStreamingSpeedObjectWidth; // Config: Width of the streaming speed debug object
-
- float sys_LocalMemoryDiagramWidth; // Config: Width of the diagram
-
- float sys_LocalMemoryDiagramRadius; // Config: Radius of the diagram
- float sys_LocalMemoryDiagramDistance; // Config: Distance of the diagram from the main debug object
- float sys_LocalMemoryDiagramStreamingSpeedRadius; // Config: Radius of the streaming speed diagram
- float sys_LocalMemoryDiagramStreamingSpeedDistance; // Config: Distance of the streaming speed diagram from the streaming speed debug line
- int sys_LocalMemoryDiagramAlpha; // Config: Color alpha of the diagram
-
- int sys_LocalMemoryDrawText; // Config: If != 0, it will draw the numeric values
- int sys_LocalMemoryLogText; // Config: If != 0, it will log the numeric values
-
- int sys_LocalMemoryOptimalMSecPerSec; // Config: Optimal calculation time (MSec) per secundum
- int sys_LocalMemoryMaxMSecBetweenCalls; // Config: Maximal time difference (MSec) between calls
-
- RectI m_actProcessedSectors; // Processed sectors (now it is the whole world)
- RectI m_actDrawedSectors; // Processed sectors (now it is the whole world)
-
- Vec2i m_sectorNr; // Sector x and y number
-
- float m_AverageUpdateTime; // Avarage Update() time (MSec)
- CTimeValue m_LastCallTime; // Last call time of Update()
-
- SSector m_arrSectors[LOCALMEMORY_SECTOR_NR_X * LOCALMEMORY_SECTOR_NR_Y]; // Sectors
-
-public:
-
- CLocalMemoryUsage();
- ~CLocalMemoryUsage();
-
- virtual void OnRender(IRenderer* pRenderer, const CCamera* camera);
- virtual void OnUpdate();
- virtual void DeleteGlobalData(); // Deletes the m_globalXXX hash maps
-
-private:
- void DeleteUnusedResources(); // Delete the non-used resources (especially StatObjs)
- void StartChecking(const RectI& actProcessedSectors); // Called every frame first
- void CollectGeometryP1(); // Calculates the minimum of sector bounding vs renderobject bounding distances
-
- // Get / create StatObjInfo then run Pass1
- SStatObjInfo* CheckStatObjP1(IStatObj* pStatObj, IRenderNode* pRenderNode, AABB bounding, float maxViewDist, float scale);
- //void CollectStatObjInfo_Recursive( SStatObjInfo* statObjInfo, IStatObj *pStatObj );
- //void CollectGeometryInfo( SStatObjInfo* statObjInfo, IStatObj *pStatObj );
-
- // Get / create MaterialInfo then run Pass1
- void CheckMaterialP1(_smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale, float mipFactor);
- void CheckChunkMaterialP1(_smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale, CRenderChunk* pRenderChunk);
- void CheckMeshMaterialP1(IRenderMesh* pRenderMesh, _smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale);
- void CheckStatObjMaterialP1(IStatObj* pStatObj, _smart_ptr pMaterial, AABB bounding, float maxViewDist, float scale);
- // Collects textures used by the material
- void CollectMaterialInfo_Recursive(SMaterialInfo* materialInfo, _smart_ptr pMaterial);
-
- // Get / create TextureInfo
- STextureInfo* GetTextureInfo(ITexture* pTexture);
-};
-
-#undef MAX_LODS
-#endif // CRYINCLUDE_CRYSYSTEM_STATISTICS_LOCALMEMORYUSAGE_H
diff --git a/Code/CryEngine/CrySystem/System.cpp b/Code/CryEngine/CrySystem/System.cpp
index a48f63afdf..af9b674f6a 100644
--- a/Code/CryEngine/CrySystem/System.cpp
+++ b/Code/CryEngine/CrySystem/System.cpp
@@ -31,7 +31,6 @@
#include
#include
#include
-#include
#include
@@ -120,8 +119,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#include AZ_RESTRICTED_FILE(System_cpp)
#endif
-
-#include
#include
#include
#include
@@ -132,7 +129,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#include
#include "VisRegTest.h"
#include
-#include
#include
@@ -155,7 +151,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#include "Serialization/ArchiveHost.h"
#include "SystemEventDispatcher.h"
#include "ServerThrottle.h"
-#include "ILocalMemoryUsage.h"
#include "ResourceManager.h"
#include "HMDBus.h"
#include "OverloadSceneManager/OverloadSceneManager.h"
@@ -683,15 +678,6 @@ void CSystem::ShutDown()
// Shutdown any running VR devices.
EBUS_EVENT(AZ::VR::HMDInitRequestBus, Shutdown);
-
- //////////////////////////////////////////////////////////////////////////
- // Clear 3D Engine resources.
- if (m_env.p3DEngine)
- {
- m_env.p3DEngine->UnloadLevel();
- }
- //////////////////////////////////////////////////////////////////////////
-
// Shutdown resource manager.
m_pResourceManager->Shutdown();
@@ -707,7 +693,6 @@ void CSystem::ShutDown()
SAFE_DELETE(m_env.pServiceNetwork);
SAFE_RELEASE(m_env.pLyShine);
SAFE_RELEASE(m_env.pCryFont);
- SAFE_RELEASE(m_env.p3DEngine); // depends on EntitySystem
if (m_env.pConsole)
{
((CXConsole*)m_env.pConsole)->FreeRenderResources();
@@ -1162,31 +1147,6 @@ void CSystem::SleepIfInactive()
{
return;
}
-
-#if defined(WIN32)
- if (!AZ::Interface::Get())
- {
- WIN_HWND hRendWnd = GetIRenderer()->GetHWND();
- if (!hRendWnd)
- {
- return;
- }
-
- AZ_TRACE_METHOD();
- // Loop here waiting for window to be activated.
- for (int nLoops = 0; nLoops < 5; nLoops++)
- {
- WIN_HWND hActiveWnd = ::GetActiveWindow();
- if (hActiveWnd == hRendWnd)
- {
- break;
- }
-
- AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::PumpSystemEventLoopUntilEmpty);
- Sleep(5);
- }
- }
-#endif
}
//////////////////////////////////////////////////////////////////////////
@@ -1257,8 +1217,6 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
return false;
}
- RenderBegin();
-
#ifndef EXCLUDE_UPDATE_ON_CONSOLE
// do the dedicated sleep earlier than the frame profiler to avoid having it counted
if (gEnv->IsDedicated())
@@ -1321,11 +1279,6 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
GetIRemoteConsole()->Update();
#endif
- if (gEnv->pLocalMemoryUsage != NULL)
- {
- gEnv->pLocalMemoryUsage->OnUpdate();
- }
-
if (!gEnv->IsEditor() && gEnv->pRenderer)
{
// If the dimensions of the render target change,
@@ -1516,11 +1469,6 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
//update time subsystem
m_Time.UpdateOnFrameStart();
- if (m_env.p3DEngine)
- {
- m_env.p3DEngine->OnFrameStart();
- }
-
//////////////////////////////////////////////////////////////////////
// update rate limiter for dedicated server
if (m_pServerThrottle.get())
@@ -1677,7 +1625,7 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
}
//////////////////////////////////////////////////////////////////////
-bool CSystem::UpdatePostTickBus(int updateFlags, int nPauseMode)
+bool CSystem::UpdatePostTickBus(int updateFlags, int /*nPauseMode*/)
{
CTimeValue updateStart = gEnv->pTimer->GetAsyncTime();
@@ -1689,44 +1637,6 @@ bool CSystem::UpdatePostTickBus(int updateFlags, int nPauseMode)
UpdateMovieSystem(updateFlags, fMovieFrameTime, false);
}
- //////////////////////////////////////////////////////////////////////
- //update process (3D engine)
- if (!(updateFlags & ESYSUPDATE_EDITOR) && !m_bNoUpdate && m_env.p3DEngine)
- {
- FRAME_PROFILER("SysUpdate:Update3DEngine", this, PROFILE_SYSTEM);
-
- if (ITimeOfDay* pTOD = m_env.p3DEngine->GetTimeOfDay())
- {
- pTOD->Tick();
- }
-
- if (m_env.p3DEngine)
- {
- m_env.p3DEngine->Tick(); // clear per frame temp data
- }
- if (m_pProcess && (m_pProcess->GetFlags() & PROC_3DENGINE))
- {
- if ((nPauseMode != 1))
- {
- if (!IsEquivalent(m_ViewCamera.GetPosition(), Vec3(0, 0, 0), VEC_EPSILON))
- {
- if (m_env.p3DEngine)
- {
- // m_env.p3DEngine->SetCamera(m_ViewCamera);
- m_pProcess->Update();
- }
- }
- }
- }
- else
- {
- if (m_pProcess)
- {
- m_pProcess->Update();
- }
- }
- }
-
//////////////////////////////////////////////////////////////////////
//update sound system part 2
if (!g_cvars.sys_deferAudioUpdateOptim && !m_bNoUpdate)
@@ -1774,41 +1684,8 @@ bool CSystem::UpdatePostTickBus(int updateFlags, int nPauseMode)
gEnv->pCryPak->DisableRuntimeFileAccess(true);
}
- // If it's in editing mode (in editor) the render is done in RenderViewport so we skip rendering here.
- if (!gEnv->IsEditing() && gEnv->pRenderer && gEnv->p3DEngine)
- {
- if (GetIViewSystem())
- {
- GetIViewSystem()->Update(min(gEnv->pTimer->GetFrameTime(), 0.1f));
- }
-
- // Begin occlusion job after setting the correct camera.
- gEnv->p3DEngine->PrepareOcclusion(GetViewCamera());
-
- CrySystemNotificationBus::Broadcast(&CrySystemNotifications::OnPreRender);
-
- // Also broadcast for anyone else that needs to draw global debug to do so now
- AzFramework::DebugDisplayEventBus::Broadcast(&AzFramework::DebugDisplayEvents::DrawGlobalDebugInfo);
-
- Render();
-
- gEnv->p3DEngine->EndOcclusion();
-
- CrySystemNotificationBus::Broadcast(&CrySystemNotifications::OnPostRender);
-
- RenderEnd();
-
- gEnv->p3DEngine->SyncProcessStreamingUpdate();
-
- if (NeedDoWorkDuringOcclusionChecks())
- {
- DoWorkDuringOcclusionChecks();
- }
-
- // Sync the work that must be done in the main thread by the end of frame.
- gEnv->pRenderer->GetGenerateShadowRendItemJobExecutor()->WaitForCompletion();
- gEnv->pRenderer->GetGenerateRendItemJobExecutor()->WaitForCompletion();
- }
+ // Also broadcast for anyone else that needs to draw global debug to do so now
+ AzFramework::DebugDisplayEventBus::Broadcast(&AzFramework::DebugDisplayEvents::DrawGlobalDebugInfo);
return !IsQuitting();
}
diff --git a/Code/CryEngine/CrySystem/System.h b/Code/CryEngine/CrySystem/System.h
index e4fcc82552..f5235f2ea8 100644
--- a/Code/CryEngine/CrySystem/System.h
+++ b/Code/CryEngine/CrySystem/System.h
@@ -408,13 +408,6 @@ public:
virtual void DoWorkDuringOcclusionChecks();
virtual bool NeedDoWorkDuringOcclusionChecks() { return m_bNeedDoWorkDuringOcclusionChecks; }
- //! Begin rendering frame.
- void RenderBegin();
- //! Render subsystems.
- void Render();
- //! End rendering frame and swap back buffer.
- void RenderEnd(bool bRenderStats = true, bool bMainWindow = true);
-
//Called when the renderer finishes rendering the scene
void OnScene3DEnd() override;
@@ -429,11 +422,6 @@ public:
//! Update screen and call some important tick functions during loading.
void SynchronousLoadingTick(const char* pFunc, int line);
- //! Renders the statistics; this is called from RenderEnd, but if the
- //! Host application (Editor) doesn't employ the Render cycle in ISystem,
- //! it may call this method to render the essential statistics
- void RenderStatistics() override;
-
uint32 GetUsedMemory();
virtual void DumpMemoryUsageStatistics(bool bUseKB);
@@ -469,7 +457,6 @@ public:
AZ::IO::IArchive* GetIPak() { return m_env.pCryPak; };
IConsole* GetIConsole() { return m_env.pConsole; };
IRemoteConsole* GetIRemoteConsole();
- I3DEngine* GetI3DEngine(){ return m_env.p3DEngine; }
IMovieSystem* GetIMovieSystem() { return m_env.pMovieSystem; };
IMemoryManager* GetIMemoryManager(){ return m_pMemoryManager; }
IThreadManager* GetIThreadManager() override {return m_env.pThreadManager; }
@@ -696,9 +683,6 @@ private:
void CreateRendererVars(const SSystemInitParams& startupParams);
void CreateSystemVars();
void CreateAudioVars();
- void RenderStats();
- void RenderOverscanBorders();
- void RenderMemStats();
AZStd::unique_ptr LoadDLL(const char* dllName);
diff --git a/Code/CryEngine/CrySystem/SystemInit.cpp b/Code/CryEngine/CrySystem/SystemInit.cpp
index d293f9ca80..22445ec4a5 100644
--- a/Code/CryEngine/CrySystem/SystemInit.cpp
+++ b/Code/CryEngine/CrySystem/SystemInit.cpp
@@ -68,7 +68,6 @@
#include
#include
#include
-#include
#include
#include
@@ -87,7 +86,6 @@
#endif //WIN32
-#include
#include
#include
#include
@@ -108,7 +106,6 @@
#include "PhysRenderer.h"
#include "LocalizedStringManager.h"
#include "SystemEventDispatcher.h"
-#include "Statistics/LocalMemoryUsage.h"
#include "ThreadConfigManager.h"
#include "Validator.h"
#include "ServerThrottle.h"
@@ -769,11 +766,6 @@ static void LoadDetectedSpec(ICVar* pVar)
GetISystem()->SetConfigSpec(static_cast(spec), platform, false);
- if (gEnv->p3DEngine)
- {
- gEnv->p3DEngine->GetMaterialManager()->RefreshMaterialRuntime();
- }
-
no_recursive = false;
}
@@ -2462,21 +2454,6 @@ AZ_POP_DISABLE_WARNING
m_env.pRenderer->SetViewport(0, 0, screenWidth, screenHeight);
- // Skip splash screen rendering
- if (!AZ::Interface::Get())
- {
- // make sure it's rendered in full screen mode when triple buffering is enabled as well
- for (size_t n = 0; n < 3; n++)
- {
- m_env.pRenderer->BeginFrame();
- m_env.pRenderer->SetCullMode(R_CULL_NONE);
- m_env.pRenderer->SetState(GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA | GS_NODEPTHTEST);
- m_env.pRenderer->Draw2dImageStretchMode(true);
- m_env.pRenderer->Draw2dImage(x * vx, y * vy, w * vx, h * vy, pTex->GetTextureID(), 0.0f, 1.0f, 1.0f, 0.0f);
- m_env.pRenderer->Draw2dImageStretchMode(false);
- m_env.pRenderer->EndFrame();
- }
- }
#if defined(AZ_PLATFORM_IOS) || defined(AZ_PLATFORM_MAC)
// Pump system events in order to update the screen
AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::PumpSystemEventLoopUntilEmpty);
@@ -2804,12 +2781,6 @@ AZ_POP_DISABLE_WARNING
m_env.pRenderer->TryFlush();
}
-#if !defined(RELEASE)
- m_env.pLocalMemoryUsage = new CLocalMemoryUsage();
-#else
- m_env.pLocalMemoryUsage = nullptr;
-#endif
-
if (g_cvars.sys_float_exceptions > 0)
{
if (g_cvars.sys_float_exceptions == 3 && gEnv->IsEditor()) // Turn off float exceptions in editor if sys_float_exceptions = 3
diff --git a/Code/CryEngine/CrySystem/SystemRender.cpp b/Code/CryEngine/CrySystem/SystemRender.cpp
index a544cef4a5..68045a86ea 100644
--- a/Code/CryEngine/CrySystem/SystemRender.cpp
+++ b/Code/CryEngine/CrySystem/SystemRender.cpp
@@ -31,7 +31,6 @@
#include
#include "Log.h"
#include "XConsole.h"
-#include
#include
#include "PhysRenderer.h"
#include
@@ -222,92 +221,6 @@ void CSystem::CreateRendererVars(const SSystemInitParams& startupParams)
"Usage: r_OverscanBordersDrawDebugView [0=off/1=show]");
}
-//////////////////////////////////////////////////////////////////////////
-void CSystem::RenderBegin()
-{
- FUNCTION_PROFILER_FAST(GetISystem(), PROFILE_SYSTEM, g_bProfilerEnabled);
-
- if (m_bIgnoreUpdates)
- {
- return;
- }
-
- bool rndAvail = m_env.pRenderer != 0;
-
- //////////////////////////////////////////////////////////////////////
- //start the rendering pipeline
- if (rndAvail)
- {
- m_env.pRenderer->BeginFrame();
- }
-
- gEnv->nMainFrameID = (rndAvail) ? m_env.pRenderer->GetFrameID(false) : 0;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-void CSystem::RenderEnd([[maybe_unused]] bool bRenderStats, bool bMainWindow)
-{
- {
- FUNCTION_PROFILER_FAST(GetISystem(), PROFILE_SYSTEM, g_bProfilerEnabled);
-
- if (m_bIgnoreUpdates)
- {
- return;
- }
-
- if (!m_env.pRenderer)
- {
- return;
- }
-
- if (bMainWindow) // we don't do this in UI Editor window for example
- {
-#if !defined (_RELEASE)
- // Flush render data and swap buffers.
- m_env.pRenderer->RenderDebug(bRenderStats);
-#endif
-
-#if defined(USE_PERFHUD)
- if (m_pPerfHUD)
- {
- m_pPerfHUD->Draw();
- }
- if (m_pMiniGUI)
- {
- m_pMiniGUI->Draw();
- }
-#endif
-
- if (!gEnv->pSystem->GetILevelSystem() || !gEnv->pSystem->GetILevelSystem()->IsLevelLoaded())
- {
- IConsole* console = GetIConsole();
-
- //Same goes for the console. When no level is loaded, it's okay to render it outside of the renderer
- //so that users can load maps or change settings.
- if (console != nullptr)
- {
- console->Draw();
- }
- }
- }
-
- m_env.pRenderer->ForceGC(); // XXX Rename this
- m_env.pRenderer->EndFrame();
-
-
- if (IConsole* pConsole = GetIConsole())
- {
- // if we have pending cvar calculation, execute it here
- // since we know cvars will be correct here after ->EndFrame().
- if (!pConsole->IsHashCalculated())
- {
- pConsole->CalcCheatVarHash();
- }
- }
- }
-}
-
void CSystem::OnScene3DEnd()
{
//Render Console
@@ -391,231 +304,3 @@ void CSystem::DisplayErrorMessage(const char* acMessage,
#endif
m_ErrorMessages.push_back(message);
}
-
-//! Renders the statistics; this is called from RenderEnd, but if the
-//! Host application (Editor) doesn't employ the Render cycle in ISystem,
-//! it may call this method to render the essential statistics
-//////////////////////////////////////////////////////////////////////////
-void CSystem::RenderStatistics()
-{
- RenderStats();
-}
-
-//////////////////////////////////////////////////////////////////////
-void CSystem::Render()
-{
- if (m_bIgnoreUpdates)
- {
- return;
- }
-
- //check what is the current process
- if (!m_pProcess)
- {
- return; //should never happen
- }
- //check if the game is in pause or
- //in menu mode
- //bool bPause=false;
- //if (m_pProcess->GetFlags() & PROC_MENU)
- // bPause=true;
-
- FUNCTION_PROFILER_FAST(GetISystem(), PROFILE_SYSTEM, g_bProfilerEnabled);
-
- //////////////////////////////////////////////////////////////////////
- //draw
- m_env.p3DEngine->PreWorldStreamUpdate(m_ViewCamera);
-
- if (m_pProcess)
- {
- if (m_pProcess->GetFlags() & PROC_3DENGINE)
- {
- if (!gEnv->IsEditing()) // Editor calls it's own rendering update
- {
- if (m_env.p3DEngine && !m_env.IsFMVPlaying())
- {
- if (!IsEquivalent(m_ViewCamera.GetPosition(), Vec3(0, 0, 0), VEC_EPSILON) || // never pass undefined camera to p3DEngine->RenderWorld()
- gEnv->IsDedicated() || (gEnv->pRenderer && gEnv->pRenderer->IsPost3DRendererEnabled()))
- {
- GetIRenderer()->SetViewport(0, 0, GetIRenderer()->GetWidth(), GetIRenderer()->GetHeight());
- m_env.p3DEngine->RenderWorld(SHDF_ALLOW_WATER | SHDF_ALLOWPOSTPROCESS | SHDF_ALLOWHDR | SHDF_ZPASS | SHDF_ALLOW_AO, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_ViewCamera), __FUNCTION__);
- }
- else
- {
- if (gEnv->pRenderer)
- {
- // force rendering of black screen to be sure we don't only render the clear color (which is the fog color by default)
- gEnv->pRenderer->SetState(GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA | GS_NODEPTHTEST);
- gEnv->pRenderer->Draw2dImage(0, 0, 800, 600, -1, 0.0f, 0.0f, 1.0f, 1.0f, 0.f,
- 0.0f, 0.0f, 0.0f, 1.0f, 0.f);
- }
- }
- }
-#if !defined(_RELEASE)
- if (m_pVisRegTest)
- {
- m_pVisRegTest->AfterRender();
- }
-#endif
-
- if (m_env.pMovieSystem)
- {
- m_env.pMovieSystem->Render();
- }
- }
- }
- else
- {
- GetIRenderer()->SetViewport(0, 0, GetIRenderer()->GetWidth(), GetIRenderer()->GetHeight());
- m_pProcess->RenderWorld(SHDF_ALLOW_WATER | SHDF_ALLOWPOSTPROCESS | SHDF_ALLOWHDR | SHDF_ZPASS | SHDF_ALLOW_AO, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_ViewCamera), __FUNCTION__);
- }
- }
-
- m_env.p3DEngine->WorldStreamUpdate();
-
- gEnv->pRenderer->SwitchToNativeResolutionBackbuffer();
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-void CSystem::RenderStats()
-{
-#if defined(ENABLE_PROFILING_CODE)
-#ifndef _RELEASE
- // if we rendered an error message on screen during the last frame, then sleep now
- // to force hard stall for 3sec
- if (m_bHasRenderedErrorMessage && !gEnv->IsEditor() && !IsLoading())
- {
- // DO NOT REMOVE OR COMMENT THIS OUT!
- // If you hit this, then you most likely have invalid (synchronous) file accesses
- // which must be fixed in order to not stall the entire game.
- Sleep(3000);
- m_bHasRenderedErrorMessage = false;
- }
-#endif
-
- // render info messages on screen
- float fTextPosX = 5.0f;
- float fTextPosY = -10;
- float fTextStepY = 13;
-
- float fFrameTime = gEnv->pTimer->GetRealFrameTime();
- TErrorMessages::iterator itnext;
- for (TErrorMessages::iterator it = m_ErrorMessages.begin(); it != m_ErrorMessages.end(); it = itnext)
- {
- itnext = it;
- ++itnext;
- SErrorMessage& message = *it;
-
- SDrawTextInfo ti;
- ti.flags = eDrawText_FixedSize | eDrawText_2D | eDrawText_Monospace;
- memcpy(ti.color, message.m_Color, 4 * sizeof(float));
- ti.xscale = ti.yscale = 1.4f;
- m_env.pRenderer->DrawTextQueued(Vec3(fTextPosX, fTextPosY += fTextStepY, 1.0f), ti, message.m_Message.c_str());
-
- if (!IsLoading())
- {
- message.m_fTimeToShow -= fFrameTime;
- }
-
- if (message.m_HardFailure)
- {
- m_bHasRenderedErrorMessage = true;
- }
-
- if (message.m_fTimeToShow < 0.0f)
- {
- m_ErrorMessages.erase(it);
- }
- }
-#endif
-
- if (!m_env.pConsole)
- {
- return;
- }
-
-#ifndef _RELEASE
- if (m_rOverscanBordersDrawDebugView)
- {
- RenderOverscanBorders();
- }
-#endif
-
- int iDisplayInfo = m_rDisplayInfo->GetIVal();
- if (iDisplayInfo == 0)
- {
- return;
- }
-
- // Draw engine stats
- if (m_env.p3DEngine)
- {
- // Draw 3dengine stats and get last text cursor position
- float nTextPosX = 101 - 20, nTextPosY = -2, nTextStepY = 3;
- m_env.p3DEngine->DisplayInfo(nTextPosX, nTextPosY, nTextStepY, iDisplayInfo != 1);
-
- // Dump Open 3D Engine CPU and GPU memory statistics to screen
- m_env.p3DEngine->DisplayMemoryStatistics();
-
- #if defined(ENABLE_LW_PROFILERS)
- if (m_rDisplayInfo->GetIVal() == 2)
- {
- m_env.pRenderer->TextToScreen(nTextPosX, nTextPosY += nTextStepY, "SysMem %.1f mb",
- float(DumpMMStats(false)) / 1024.f);
- }
- #endif
-
- #if 0
- for (int i = 0; i < NUM_POOLS; ++i)
- {
- int used = (g_pPakHeap->m_iBigPoolUsed[i] ? (int)g_pPakHeap->m_iBigPoolSize[i] : 0);
- int size = (int)g_pPakHeap->m_iBigPoolSize[i];
- float fC1[4] = {1, 1, 0, 1};
- m_env.pRenderer->Draw2dLabel(10, 100.0f + i * 16, 2.1f, fC1, false, "BigPool %d: %d bytes of %d bytes used", i, used, size);
- }
- #endif
- }
-}
-
-void CSystem::RenderOverscanBorders()
-{
-#ifndef _RELEASE
-
- if (m_env.pRenderer && m_rOverscanBordersDrawDebugView)
- {
- int iOverscanBordersDrawDebugView = m_rOverscanBordersDrawDebugView->GetIVal();
- if (iOverscanBordersDrawDebugView)
- {
- const int texId = -1;
- const float uv = 0.0f;
- const float rot = 0.0f;
- const int whiteTextureId = m_env.pRenderer->GetWhiteTextureId();
-
- const float r = 1.0f;
- const float g = 1.0f;
- const float b = 1.0f;
- const float a = 0.2f;
-
- Vec2 overscanBorders = Vec2(0.0f, 0.0f);
- m_env.pRenderer->EF_Query(EFQ_OverscanBorders, overscanBorders);
-
- const float overscanBorderWidth = overscanBorders.x * VIRTUAL_SCREEN_WIDTH;
- const float overscanBorderHeight = overscanBorders.y * VIRTUAL_SCREEN_HEIGHT;
-
- const float xPos = overscanBorderWidth;
- const float yPos = overscanBorderHeight;
- const float width = VIRTUAL_SCREEN_WIDTH - (2.0f * overscanBorderWidth);
- const float height = VIRTUAL_SCREEN_HEIGHT - (2.0f * overscanBorderHeight);
-
- m_env.pRenderer->SetState(GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA | GS_NODEPTHTEST);
- m_env.pRenderer->Draw2dImage(xPos, yPos,
- width, height,
- whiteTextureId,
- uv, uv, uv, uv,
- rot,
- r, g, b, a);
- }
- }
-#endif
-}
diff --git a/Code/CryEngine/CrySystem/SystemWin32.cpp b/Code/CryEngine/CrySystem/SystemWin32.cpp
index 974e578f38..ce352966ac 100644
--- a/Code/CryEngine/CrySystem/SystemWin32.cpp
+++ b/Code/CryEngine/CrySystem/SystemWin32.cpp
@@ -15,7 +15,6 @@
#include "System.h"
#include
-#include
#include
#include
#include
@@ -302,23 +301,6 @@ void CSystem::CollectMemStats (ICrySizer* pSizer, MemStatsPurposeEnum nPurpose,
}
}
-
- if (m_env.p3DEngine)
- {
- SIZER_COMPONENT_NAME(pSizer, "Cry3DEngine");
- {
- m_env.p3DEngine->GetMemoryUsage (pSizer);
- {
- SIZER_COMPONENT_NAME (pSizer, "$Allocations waste");
- const SmallModuleInfo* info = FindModuleInfo(stats, "Cry3DEngine.dll");
- if (info)
- {
- pSizer->AddObject(info, info->memInfo.allocated - info->memInfo.requested);
- }
- }
- }
- }
-
if (m_env.pRenderer)
{
SIZER_COMPONENT_NAME(pSizer, "CryRenderer");
diff --git a/Code/CryEngine/CrySystem/ViewSystem/View.cpp b/Code/CryEngine/CrySystem/ViewSystem/View.cpp
index 384d1c76f5..f8b84bea19 100644
--- a/Code/CryEngine/CrySystem/ViewSystem/View.cpp
+++ b/Code/CryEngine/CrySystem/ViewSystem/View.cpp
@@ -98,7 +98,7 @@ void CView::Update(float frameTime, bool isActive)
//see if the view have to use a custom near clipping plane
const float nearPlane = (m_viewParams.nearplane >= CAMERA_MIN_NEAR) ? (m_viewParams.nearplane) : fNearZ;
- const float farPlane = (m_viewParams.farplane > 0.f) ? m_viewParams.farplane : gEnv->p3DEngine->GetMaxViewDistance();
+ const float farPlane = (m_viewParams.farplane > 0.f) ? m_viewParams.farplane : DEFAULT_FAR;
float fov = (m_viewParams.fov < 0.001f) ? DEFAULT_FOV : m_viewParams.fov;
// [VR] specific
diff --git a/Code/CryEngine/CrySystem/ViewSystem/ViewSystem.cpp b/Code/CryEngine/CrySystem/ViewSystem/ViewSystem.cpp
index 65581662c3..13f7f5b82d 100644
--- a/Code/CryEngine/CrySystem/ViewSystem/ViewSystem.cpp
+++ b/Code/CryEngine/CrySystem/ViewSystem/ViewSystem.cpp
@@ -533,11 +533,6 @@ void CViewSystem::BeginCutScene(IAnimSequence* pSeq, [[maybe_unused]] unsigned l
{
m_cutsceneCount++;
- if (m_cutsceneCount == 1)
- {
- gEnv->p3DEngine->ResetPostEffects();
- }
-
VS_CALL_LISTENERS(OnBeginCutScene(pSeq, bResetFX));
}
@@ -546,11 +541,6 @@ void CViewSystem::EndCutScene(IAnimSequence* pSeq, [[maybe_unused]] unsigned lon
{
m_cutsceneCount -= (m_cutsceneCount > 0);
- if (m_cutsceneCount == 0)
- {
- gEnv->p3DEngine->ResetPostEffects();
- }
-
ClearCutsceneViews();
VS_CALL_LISTENERS(OnEndCutScene(pSeq));
diff --git a/Code/CryEngine/CrySystem/VisRegTest.cpp b/Code/CryEngine/CrySystem/VisRegTest.cpp
index 81ef205b47..206d8f349a 100644
--- a/Code/CryEngine/CrySystem/VisRegTest.cpp
+++ b/Code/CryEngine/CrySystem/VisRegTest.cpp
@@ -18,7 +18,6 @@
#include "VisRegTest.h"
#include "ISystem.h"
-#include "I3DEngine.h"
#include "IRenderer.h"
#include "IConsole.h"
#include "ITimer.h"
diff --git a/Code/CryEngine/CrySystem/crysystem_files.cmake b/Code/CryEngine/CrySystem/crysystem_files.cmake
index 23ad644041..bfc7b092fd 100644
--- a/Code/CryEngine/CrySystem/crysystem_files.cmake
+++ b/Code/CryEngine/CrySystem/crysystem_files.cmake
@@ -57,7 +57,6 @@ set(FILES
UnixConsole.h
SystemInit.h
Serialization/MemoryReader.h
- Statistics/LocalMemoryUsage.h
MemoryFragmentationProfiler.h
XML/ReadWriteXMLSink.h
Serialization/ArchiveHost.h
@@ -151,7 +150,6 @@ set(FILES
MiniGUI/MiniInfoBox.h
MiniGUI/MiniMenu.h
MiniGUI/MiniTable.h
- Statistics/LocalMemoryUsage.cpp
ZLibCompressor.cpp
ZLibCompressor.h
SoftCode/SoftCodeMgr.cpp
diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetContainer.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetContainer.cpp
index 4e7a19c197..2ff6143912 100644
--- a/Code/Framework/AzCore/AzCore/Asset/AssetContainer.cpp
+++ b/Code/Framework/AzCore/AzCore/Asset/AssetContainer.cpp
@@ -239,8 +239,13 @@ namespace AZ
return;
}
- CheckReady();
m_initComplete = true;
+
+ // *After* setting initComplete to true, check to see if the assets are already ready.
+ // This check needs to wait until after setting initComplete because if they *are* ready, we want the final call to
+ // RemoveWaitingAsset to trigger the OnAssetContainerReady/Canceled event. If we call CheckReady() *before* setting
+ // initComplete, if all the assets are ready, the event will never get triggered.
+ CheckReady();
}
bool AssetContainer::IsReady() const
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x3.h b/Code/Framework/AzCore/AzCore/Math/Matrix3x3.h
index e1736e1444..973bb52df3 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix3x3.h
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x3.h
@@ -142,27 +142,44 @@ namespace AZ
void SetBasis(const Vector3& basisX, const Vector3& basisY, const Vector3& basisZ);
//! @}
- Matrix3x3 operator*(const Matrix3x3& rhs) const;
-
//! Calculates (this->GetTranspose() * rhs).
Matrix3x3 TransposedMultiply(const Matrix3x3& rhs) const;
//! Post-multiplies the matrix by a vector.
Vector3 operator*(const Vector3& rhs) const;
- Matrix3x3 operator+(const Matrix3x3& rhs) const;
- Matrix3x3 operator-(const Matrix3x3& rhs) const;
-
- Matrix3x3 operator*(float multiplier) const;
- Matrix3x3 operator/(float divisor) const;
+ //! Operator for matrix-matrix addition.
+ //! @{
+ [[nodiscard]] Matrix3x3 operator+(const Matrix3x3& rhs) const;
+ Matrix3x3& operator+=(const Matrix3x3& rhs);
+ //! @}
- Matrix3x3 operator-() const;
+ //! Operator for matrix-matrix substraction.
+ //! @{
+ [[nodiscard]] Matrix3x3 operator-(const Matrix3x3& rhs) const;
+ Matrix3x3& operator-=(const Matrix3x3& rhs);
+ //! @}
+ //! Operator for matrix-matrix multiplication.
+ //! @{
+ [[nodiscard]] Matrix3x3 operator*(const Matrix3x3& rhs) const;
Matrix3x3& operator*=(const Matrix3x3& rhs);
- Matrix3x3& operator+=(const Matrix3x3& rhs);
- Matrix3x3& operator-=(const Matrix3x3& rhs);
+ //! @}
+
+ //! Operator for multiplying all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix3x3 operator*(float multiplier) const;
Matrix3x3& operator*=(float multiplier);
+ //! @}
+
+ //! Operator for dividing all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix3x3 operator/(float divisor) const;
Matrix3x3& operator/=(float divisor);
+ //! @}
+
+ //! Operator for negating all matrix's elements
+ [[nodiscard]] Matrix3x3 operator-() const;
bool operator==(const Matrix3x3& rhs) const;
bool operator!=(const Matrix3x3& rhs) const;
@@ -187,7 +204,10 @@ namespace AZ
//! @}
//! Gets the scale part of the transformation, i.e. the length of the scale components.
- Vector3 RetrieveScale() const;
+ [[nodiscard]] Vector3 RetrieveScale() const;
+
+ //! Gets the squared scale part of the transformation (the squared length of the basis vectors).
+ [[nodiscard]] Vector3 RetrieveScaleSq() const;
//! Gets the scale part of the transformation as in RetrieveScale, and also removes this scaling from the matrix.
Vector3 ExtractScale();
@@ -195,6 +215,9 @@ namespace AZ
//! Quick multiplication by a scale matrix, equivalent to m*=Matrix3x3::CreateScale(scale).
void MultiplyByScale(const Vector3& scale);
+ //! Returns a matrix with the reciprocal scale, keeping the same rotation and translation.
+ [[nodiscard]] Matrix3x3 GetReciprocalScaled() const;
+
//! Polar decomposition, M=U*H, U is orthogonal (unitary) and H is symmetric (hermitian).
//! This function returns the orthogonal part only
Matrix3x3 GetPolarDecomposition() const;
@@ -241,7 +264,9 @@ namespace AZ
//! Note that this is not the usual multiplication order for transformations.
Vector3& operator*=(Vector3& lhs, const Matrix3x3& rhs);
+ //! Pre-multiplies the matrix by a scalar.
Matrix3x3 operator*(float lhs, const Matrix3x3& rhs);
-}
+
+} // namespace AZ
#include
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x3.inl b/Code/Framework/AzCore/AzCore/Math/Matrix3x3.inl
index ff92da1398..6b4dccf3c1 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix3x3.inl
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x3.inl
@@ -392,14 +392,6 @@ namespace AZ
}
- AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator*(const Matrix3x3& rhs) const
- {
- Matrix3x3 result;
- Simd::Vec3::Mat3x3Multiply(GetSimdValues(), rhs.GetSimdValues(), result.GetSimdValues());
- return result;
- }
-
-
AZ_MATH_INLINE Matrix3x3 Matrix3x3::TransposedMultiply(const Matrix3x3& rhs) const
{
Matrix3x3 result;
@@ -416,44 +408,45 @@ namespace AZ
AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator+(const Matrix3x3& rhs) const
{
- return Matrix3x3(Simd::Vec3::Add(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue())
- , Simd::Vec3::Add(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue())
- , Simd::Vec3::Add(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue()));
+ return Matrix3x3
+ (
+ Simd::Vec3::Add(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec3::Add(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec3::Add(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
+ );
}
- AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator-(const Matrix3x3& rhs) const
+ AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator+=(const Matrix3x3& rhs)
{
- return Matrix3x3(Simd::Vec3::Sub(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue())
- , Simd::Vec3::Sub(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue())
- , Simd::Vec3::Sub(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue()));
+ *this = *this + rhs;
+ return *this;
}
- AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator*(float multiplier) const
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator-(const Matrix3x3& rhs) const
{
- const Simd::Vec3::FloatType mulVec = Simd::Vec3::Splat(multiplier);
- return Matrix3x3(Simd::Vec3::Mul(m_rows[0].GetSimdValue(), mulVec)
- , Simd::Vec3::Mul(m_rows[1].GetSimdValue(), mulVec)
- , Simd::Vec3::Mul(m_rows[2].GetSimdValue(), mulVec));
+ return Matrix3x3
+ (
+ Simd::Vec3::Sub(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec3::Sub(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec3::Sub(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
+ );
}
- AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator/(float divisor) const
+ AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator-=(const Matrix3x3& rhs)
{
- const Simd::Vec3::FloatType divVec = Simd::Vec3::Splat(divisor);
- return Matrix3x3(Simd::Vec3::Div(m_rows[0].GetSimdValue(), divVec)
- , Simd::Vec3::Div(m_rows[1].GetSimdValue(), divVec)
- , Simd::Vec3::Div(m_rows[2].GetSimdValue(), divVec));
+ *this = *this - rhs;
+ return *this;
}
- AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator-() const
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator*(const Matrix3x3& rhs) const
{
- const Simd::Vec3::FloatType zeroVec = Simd::Vec3::ZeroFloat();
- return Matrix3x3(Simd::Vec3::Sub(zeroVec, m_rows[0].GetSimdValue())
- , Simd::Vec3::Sub(zeroVec, m_rows[1].GetSimdValue())
- , Simd::Vec3::Sub(zeroVec, m_rows[2].GetSimdValue()));
+ Matrix3x3 result;
+ Simd::Vec3::Mat3x3Multiply(GetSimdValues(), rhs.GetSimdValues(), result.GetSimdValues());
+ return result;
}
@@ -464,24 +457,34 @@ namespace AZ
}
- AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator+=(const Matrix3x3& rhs)
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator*(float multiplier) const
{
- *this = *this + rhs;
- return *this;
+ const Simd::Vec3::FloatType mulVec = Simd::Vec3::Splat(multiplier);
+ return Matrix3x3
+ (
+ Simd::Vec3::Mul(m_rows[0].GetSimdValue(), mulVec),
+ Simd::Vec3::Mul(m_rows[1].GetSimdValue(), mulVec),
+ Simd::Vec3::Mul(m_rows[2].GetSimdValue(), mulVec)
+ );
}
- AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator-=(const Matrix3x3& rhs)
+ AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator*=(float multiplier)
{
- *this = *this - rhs;
+ *this = *this * multiplier;
return *this;
}
- AZ_MATH_INLINE Matrix3x3& Matrix3x3::operator*=(float multiplier)
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator/(float divisor) const
{
- *this = *this * multiplier;
- return *this;
+ const Simd::Vec3::FloatType divVec = Simd::Vec3::Splat(divisor);
+ return Matrix3x3
+ (
+ Simd::Vec3::Div(m_rows[0].GetSimdValue(), divVec),
+ Simd::Vec3::Div(m_rows[1].GetSimdValue(), divVec),
+ Simd::Vec3::Div(m_rows[2].GetSimdValue(), divVec)
+ );
}
@@ -492,6 +495,18 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::operator-() const
+ {
+ const Simd::Vec3::FloatType zeroVec = Simd::Vec3::ZeroFloat();
+ return Matrix3x3
+ (
+ Simd::Vec3::Sub(zeroVec, m_rows[0].GetSimdValue()),
+ Simd::Vec3::Sub(zeroVec, m_rows[1].GetSimdValue()),
+ Simd::Vec3::Sub(zeroVec, m_rows[2].GetSimdValue())
+ );
+ }
+
+
AZ_MATH_INLINE bool Matrix3x3::operator==(const Matrix3x3& rhs) const
{
return (Simd::Vec3::CmpAllEq(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue())
@@ -552,6 +567,12 @@ namespace AZ
}
+ AZ_MATH_INLINE Vector3 Matrix3x3::RetrieveScaleSq() const
+ {
+ return Vector3(GetBasisX().GetLengthSq(), GetBasisY().GetLengthSq(), GetBasisZ().GetLengthSq());
+ }
+
+
AZ_MATH_INLINE Vector3 Matrix3x3::ExtractScale()
{
const Vector3 x = GetBasisX();
@@ -584,6 +605,14 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix3x3 Matrix3x3::GetReciprocalScaled() const
+ {
+ Matrix3x3 result = *this;
+ result.MultiplyByScale(RetrieveScaleSq().GetReciprocal());
+ return result;
+ }
+
+
AZ_MATH_INLINE void Matrix3x3::GetPolarDecomposition(Matrix3x3* orthogonalOut, Matrix3x3* symmetricOut) const
{
*orthogonalOut = GetPolarDecomposition();
@@ -679,8 +708,6 @@ namespace AZ
AZ_MATH_INLINE Matrix3x3 operator*(float lhs, const Matrix3x3& rhs)
{
- const Simd::Vec3::FloatType lhsVec = Simd::Vec3::Splat(lhs);
- const Simd::Vec3::FloatType* rows = rhs.GetSimdValues();
- return Matrix3x3(Simd::Vec3::Mul(lhsVec, rows[0]), Simd::Vec3::Mul(lhsVec, rows[1]), Simd::Vec3::Mul(lhsVec, rows[2]));
+ return rhs * lhs;
}
-}
+} // namespace AZ
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.h b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.h
index 8773d4ea6a..a18f1e7565 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.h
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.h
@@ -225,11 +225,38 @@ namespace AZ
//! Sets the three basis vectors and the translation.
void SetBasisAndTranslation(const Vector3& basisX, const Vector3& basisY, const Vector3& basisZ, const Vector3& translation);
+ //! Operator for matrix-matrix addition.
+ //! @{
+ [[nodiscard]] Matrix3x4 operator+(const Matrix3x4& rhs) const;
+ Matrix3x4& operator+=(const Matrix3x4& rhs);
+ //! @}
+
+ //! Operator for matrix-matrix substraction.
+ //! @{
+ [[nodiscard]] Matrix3x4 operator-(const Matrix3x4& rhs) const;
+ Matrix3x4& operator-=(const Matrix3x4& rhs);
+ //! @}
+
//! Operator for matrix-matrix multiplication.
+ //! @{
[[nodiscard]] Matrix3x4 operator*(const Matrix3x4& rhs) const;
-
- //! Compound assignment operator for matrix-matrix multiplication.
Matrix3x4& operator*=(const Matrix3x4& rhs);
+ //! @}
+
+ //! Operator for multiplying all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix3x4 operator*(float multiplier) const;
+ Matrix3x4& operator*=(float multiplier);
+ //! @}
+
+ //! Operator for dividing all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix3x4 operator/(float divisor) const;
+ Matrix3x4& operator/=(float divisor);
+ //! @}
+
+ //! Operator for negating all matrix's elements
+ [[nodiscard]] Matrix3x4 operator-() const;
//! Operator for transforming a Vector3.
[[nodiscard]] Vector3 operator*(const Vector3& rhs) const;
@@ -274,12 +301,18 @@ namespace AZ
//! Gets the scale part of the transformation (the length of the basis vectors).
[[nodiscard]] Vector3 RetrieveScale() const;
+ //! Gets the squared scale part of the transformation (the squared length of the basis vectors).
+ [[nodiscard]] Vector3 RetrieveScaleSq() const;
+
//! Gets the scale part of the transformation as in RetrieveScale, and also removes this scaling from the matrix.
Vector3 ExtractScale();
//! Multiplies the basis vectors of the matrix by the elements of the scale specified.
void MultiplyByScale(const Vector3& scale);
+ //! Returns a matrix with the reciprocal scale, keeping the same rotation and translation.
+ [[nodiscard]] Matrix3x4 GetReciprocalScaled() const;
+
//! Tests if the 3x3 part of the matrix is orthogonal.
bool IsOrthogonal(float tolerance = Constants::Tolerance) const;
@@ -335,6 +368,10 @@ namespace AZ
Vector4 m_rows[RowCount];
};
+
+ //! Pre-multiplies the matrix by a scalar.
+ Matrix3x4 operator*(float lhs, const Matrix3x4& rhs);
+
} // namespace AZ
#include
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.inl b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.inl
index bd310d293e..781dcf9b66 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.inl
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.inl
@@ -472,6 +472,42 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator+(const Matrix3x4& rhs) const
+ {
+ return Matrix3x4
+ (
+ Simd::Vec4::Add(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec4::Add(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec4::Add(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4& Matrix3x4::operator+=(const Matrix3x4& rhs)
+ {
+ *this = *this + rhs;
+ return *this;
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator-(const Matrix3x4& rhs) const
+ {
+ return Matrix3x4
+ (
+ Simd::Vec4::Sub(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec4::Sub(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec4::Sub(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4& Matrix3x4::operator-=(const Matrix3x4& rhs)
+ {
+ *this = *this - rhs;
+ return *this;
+ }
+
+
AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator*(const Matrix3x4& rhs) const
{
Matrix3x4 result;
@@ -487,6 +523,56 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator*(float multiplier) const
+ {
+ const Simd::Vec4::FloatType mulVec = Simd::Vec4::Splat(multiplier);
+ return Matrix3x4
+ (
+ Simd::Vec4::Mul(m_rows[0].GetSimdValue(), mulVec),
+ Simd::Vec4::Mul(m_rows[1].GetSimdValue(), mulVec),
+ Simd::Vec4::Mul(m_rows[2].GetSimdValue(), mulVec)
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4& Matrix3x4::operator*=(float multiplier)
+ {
+ *this = *this * multiplier;
+ return *this;
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator/(float divisor) const
+ {
+ const Simd::Vec4::FloatType divVec = Simd::Vec4::Splat(divisor);
+ return Matrix3x4
+ (
+ Simd::Vec4::Div(m_rows[0].GetSimdValue(), divVec),
+ Simd::Vec4::Div(m_rows[1].GetSimdValue(), divVec),
+ Simd::Vec4::Div(m_rows[2].GetSimdValue(), divVec)
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4& Matrix3x4::operator/=(float divisor)
+ {
+ *this = *this / divisor;
+ return *this;
+ }
+
+
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::operator-() const
+ {
+ const Simd::Vec4::FloatType zeroVec = Simd::Vec4::ZeroFloat();
+ return Matrix3x4
+ (
+ Simd::Vec4::Sub(zeroVec, m_rows[0].GetSimdValue()),
+ Simd::Vec4::Sub(zeroVec, m_rows[1].GetSimdValue()),
+ Simd::Vec4::Sub(zeroVec, m_rows[2].GetSimdValue())
+ );
+ }
+
+
AZ_MATH_INLINE Vector3 Matrix3x4::operator*(const Vector3& rhs) const
{
return Vector3
@@ -583,6 +669,12 @@ namespace AZ
}
+ AZ_MATH_INLINE Vector3 Matrix3x4::RetrieveScaleSq() const
+ {
+ return Vector3(GetColumn(0).GetLengthSq(), GetColumn(1).GetLengthSq(), GetColumn(2).GetLengthSq());
+ }
+
+
AZ_MATH_INLINE Vector3 Matrix3x4::ExtractScale()
{
const Vector3 scale = RetrieveScale();
@@ -600,6 +692,14 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix3x4 Matrix3x4::GetReciprocalScaled() const
+ {
+ Matrix3x4 result = *this;
+ result.MultiplyByScale(RetrieveScaleSq().GetReciprocal());
+ return result;
+ }
+
+
AZ_MATH_INLINE void Matrix3x4::Orthogonalize()
{
*this = GetOrthogonalized();
@@ -660,4 +760,10 @@ namespace AZ
{
return reinterpret_cast(m_rows);
}
+
+
+ AZ_MATH_INLINE Matrix3x4 operator*(float lhs, const Matrix3x4& rhs)
+ {
+ return rhs * lhs;
+ }
} // namespace AZ
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.h b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.h
index 1612f8c962..a94b3c7ae2 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.h
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.h
@@ -171,14 +171,38 @@ namespace AZ
void SetTranslation(const Vector3& v);
//! @}
- Matrix4x4 operator+(const Matrix4x4& rhs) const;
+ //! Operator for matrix-matrix addition.
+ //! @{
+ [[nodiscard]] Matrix4x4 operator+(const Matrix4x4& rhs) const;
Matrix4x4& operator+=(const Matrix4x4& rhs);
+ //! @}
- Matrix4x4 operator-(const Matrix4x4& rhs) const;
+ //! Operator for matrix-matrix substraction.
+ //! @{
+ [[nodiscard]] Matrix4x4 operator-(const Matrix4x4& rhs) const;
Matrix4x4& operator-=(const Matrix4x4& rhs);
+ //! @}
- Matrix4x4 operator*(const Matrix4x4& rhs) const;
+ //! Operator for matrix-matrix multiplication.
+ //! @{
+ [[nodiscard]] Matrix4x4 operator*(const Matrix4x4& rhs) const;
Matrix4x4& operator*=(const Matrix4x4& rhs);
+ //! @}
+
+ //! Operator for multiplying all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix4x4 operator*(float multiplier) const;
+ Matrix4x4& operator*=(float multiplier);
+ //! @}
+
+ //! Operator for dividing all matrix's elements with a scalar
+ //! @{
+ [[nodiscard]] Matrix4x4 operator/(float divisor) const;
+ Matrix4x4& operator/=(float divisor);
+ //! @}
+
+ //! Operator for negating all matrix's elements
+ [[nodiscard]] Matrix4x4 operator-() const;
//! Post-multiplies the matrix by a vector.
//! Assumes that the w-component of the Vector3 is 1.0.
@@ -222,7 +246,10 @@ namespace AZ
//! @}
//! Gets the scale part of the transformation, i.e. the length of the scale components.
- Vector3 RetrieveScale() const;
+ [[nodiscard]] Vector3 RetrieveScale() const;
+
+ //! Gets the squared scale part of the transformation (the squared length of the basis vectors).
+ [[nodiscard]] Vector3 RetrieveScaleSq() const;
//! Gets the scale part of the transformation as in RetrieveScale, and also removes this scaling from the matrix.
Vector3 ExtractScale();
@@ -230,6 +257,9 @@ namespace AZ
//! Quick multiplication by a scale matrix, equivalent to m*=Matrix4x4::CreateScale(scale).
void MultiplyByScale(const Vector3& scale);
+ //! Returns a matrix with the reciprocal scale, keeping the same rotation and translation.
+ [[nodiscard]] Matrix4x4 GetReciprocalScaled() const;
+
bool IsClose(const Matrix4x4& rhs, float tolerance = Constants::Tolerance) const;
bool operator==(const Matrix4x4& rhs) const;
@@ -270,6 +300,10 @@ namespace AZ
//! Pre-multiplies the matrix by a vector in-place.
//! Note that this is not the usual multiplication order for transformations.
Vector4& operator*=(Vector4& lhs, const Matrix4x4& rhs);
-}
+
+ //! Pre-multiplies the matrix by a scalar.
+ Matrix4x4 operator*(float lhs, const Matrix4x4& rhs);
+
+} // namespace AZ
#include
diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.inl b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.inl
index 3c4572accd..e32ebe31af 100644
--- a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.inl
+++ b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.inl
@@ -480,20 +480,12 @@ namespace AZ
AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator+(const Matrix4x4& rhs) const
{
return Matrix4x4
- ( Simd::Vec4::Add(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue())
- , Simd::Vec4::Add(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue())
- , Simd::Vec4::Add(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
- , Simd::Vec4::Add(m_rows[3].GetSimdValue(), rhs.m_rows[3].GetSimdValue()));
- }
-
-
- AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator-(const Matrix4x4& rhs) const
- {
- return Matrix4x4
- ( Simd::Vec4::Sub(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue())
- , Simd::Vec4::Sub(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue())
- , Simd::Vec4::Sub(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue())
- , Simd::Vec4::Sub(m_rows[3].GetSimdValue(), rhs.m_rows[3].GetSimdValue()));
+ (
+ Simd::Vec4::Add(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec4::Add(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec4::Add(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue()),
+ Simd::Vec4::Add(m_rows[3].GetSimdValue(), rhs.m_rows[3].GetSimdValue())
+ );
}
AZ_MATH_INLINE Matrix4x4& Matrix4x4::operator+=(const Matrix4x4& rhs)
@@ -502,6 +494,18 @@ namespace AZ
return *this;
}
+
+ AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator-(const Matrix4x4& rhs) const
+ {
+ return Matrix4x4
+ (
+ Simd::Vec4::Sub(m_rows[0].GetSimdValue(), rhs.m_rows[0].GetSimdValue()),
+ Simd::Vec4::Sub(m_rows[1].GetSimdValue(), rhs.m_rows[1].GetSimdValue()),
+ Simd::Vec4::Sub(m_rows[2].GetSimdValue(), rhs.m_rows[2].GetSimdValue()),
+ Simd::Vec4::Sub(m_rows[3].GetSimdValue(), rhs.m_rows[3].GetSimdValue())
+ );
+ }
+
AZ_MATH_INLINE Matrix4x4& Matrix4x4::operator-=(const Matrix4x4& rhs)
{
*this = *this - rhs;
@@ -523,6 +527,59 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator*(float multiplier) const
+ {
+ const Simd::Vec4::FloatType mulVec = Simd::Vec4::Splat(multiplier);
+ return Matrix4x4
+ (
+ Simd::Vec4::Mul(m_rows[0].GetSimdValue(), mulVec),
+ Simd::Vec4::Mul(m_rows[1].GetSimdValue(), mulVec),
+ Simd::Vec4::Mul(m_rows[2].GetSimdValue(), mulVec),
+ Simd::Vec4::Mul(m_rows[3].GetSimdValue(), mulVec)
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix4x4& Matrix4x4::operator*=(float multiplier)
+ {
+ *this = *this * multiplier;
+ return *this;
+ }
+
+
+ AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator/(float divisor) const
+ {
+ const Simd::Vec4::FloatType divVec = Simd::Vec4::Splat(divisor);
+ return Matrix4x4
+ (
+ Simd::Vec4::Div(m_rows[0].GetSimdValue(), divVec),
+ Simd::Vec4::Div(m_rows[1].GetSimdValue(), divVec),
+ Simd::Vec4::Div(m_rows[2].GetSimdValue(), divVec),
+ Simd::Vec4::Div(m_rows[3].GetSimdValue(), divVec)
+ );
+ }
+
+
+ AZ_MATH_INLINE Matrix4x4& Matrix4x4::operator/=(float divisor)
+ {
+ *this = *this / divisor;
+ return *this;
+ }
+
+
+ AZ_MATH_INLINE Matrix4x4 Matrix4x4::operator-() const
+ {
+ const Simd::Vec4::FloatType zeroVec = Simd::Vec4::ZeroFloat();
+ return Matrix4x4
+ (
+ Simd::Vec4::Sub(zeroVec, m_rows[0].GetSimdValue()),
+ Simd::Vec4::Sub(zeroVec, m_rows[1].GetSimdValue()),
+ Simd::Vec4::Sub(zeroVec, m_rows[2].GetSimdValue()),
+ Simd::Vec4::Sub(zeroVec, m_rows[3].GetSimdValue())
+ );
+ }
+
+
AZ_MATH_INLINE Vector3 Matrix4x4::operator*(const Vector3& rhs) const
{
return Vector3(Simd::Vec4::Mat4x4TransformPoint3(GetSimdValues(), rhs.GetSimdValue()));
@@ -595,6 +652,12 @@ namespace AZ
}
+ AZ_MATH_INLINE Vector3 Matrix4x4::RetrieveScaleSq() const
+ {
+ return Vector3(GetBasisX().GetLengthSq(), GetBasisY().GetLengthSq(), GetBasisZ().GetLengthSq());
+ }
+
+
AZ_MATH_INLINE Vector3 Matrix4x4::ExtractScale()
{
Vector4 x = GetBasisX();
@@ -619,6 +682,14 @@ namespace AZ
}
+ AZ_MATH_INLINE Matrix4x4 Matrix4x4::GetReciprocalScaled() const
+ {
+ Matrix4x4 result = *this;
+ result.MultiplyByScale(RetrieveScaleSq().GetReciprocal());
+ return result;
+ }
+
+
AZ_MATH_INLINE bool Matrix4x4::IsClose(const Matrix4x4& rhs, float tolerance) const
{
const Simd::Vec4::FloatType vecTolerance = Simd::Vec4::Splat(tolerance);
@@ -702,4 +773,10 @@ namespace AZ
lhs = lhs * rhs;
return lhs;
}
-}
+
+
+ AZ_MATH_INLINE Matrix4x4 operator*(float lhs, const Matrix4x4& rhs)
+ {
+ return rhs * lhs;
+ }
+} // namespace AZ
diff --git a/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl b/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl
index ab92604266..079c70c878 100644
--- a/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl
+++ b/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl
@@ -816,7 +816,7 @@ namespace AZ
template
static void ReflectUnpackMethodFold(BehaviorContext::ClassBuilder& builder)
{
- AZStd::string methodName = AZStd::string::format("Get%ld", Index);
+ const AZStd::string methodName = AZStd::string::format("Get%zu", Index);
builder->Method(methodName.data(), [](ContainerType& value) { return AZStd::get(value); })
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::ScriptCanvasAttributes::TupleGetFunctionIndex, Index)
diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp
index f2e9bb866f..8d0da9e54a 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp
+++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp
@@ -97,7 +97,8 @@ namespace AZ
return context.Report(Tasks::RetrieveInfo, Outcomes::Unknown,
AZStd::string::format("Failed to retrieve rtti information for %s.", classData->m_name));
}
- AZ_Assert(classData->m_azRtti->GetTypeId() == typeId, "Type id mismatch during deserialization of a json file. (%s vs %s)");
+ AZ_Assert(classData->m_azRtti->GetTypeId() == typeId, "Type id mismatch during deserialization of a json file. (%s vs %s)",
+ classData->m_azRtti->GetTypeId().ToString().c_str(), typeId.ToString().c_str());
void** objectPtr = reinterpret_cast(object);
bool isNull = *objectPtr == nullptr;
@@ -512,27 +513,24 @@ namespace AZ
if (*object)
{
const AZ::Uuid& actualClassId = rtti.GetActualUuid(*object);
- if (actualClassId != objectType)
+ const SerializeContext::ClassData* actualClassData = context.GetSerializeContext()->FindClassData(actualClassId);
+ if (!actualClassData)
{
- const SerializeContext::ClassData* actualClassData = context.GetSerializeContext()->FindClassData(actualClassId);
- if (!actualClassData)
- {
- status = context.Report(Tasks::RetrieveInfo, Outcomes::Unknown,
- AZStd::string::format("Unable to find serialization information for type %s.", actualClassId.ToString().c_str()));
- return ResolvePointerResult::FullyProcessed;
- }
+ status = context.Report(Tasks::RetrieveInfo, Outcomes::Unknown,
+ AZStd::string::format("Unable to find serialization information for type %s.", actualClassId.ToString().c_str()));
+ return ResolvePointerResult::FullyProcessed;
+ }
- if (actualClassData->m_factory)
- {
- actualClassData->m_factory->Destroy(*object);
- *object = nullptr;
- }
- else
- {
- status = context.Report(Tasks::RetrieveInfo, Outcomes::Catastrophic,
- "Unable to find the factory needed to clear out the default value.");
- return ResolvePointerResult::FullyProcessed;
- }
+ if (actualClassData->m_factory)
+ {
+ actualClassData->m_factory->Destroy(*object);
+ *object = nullptr;
+ }
+ else
+ {
+ status = context.Report(Tasks::RetrieveInfo, Outcomes::Catastrophic,
+ "Unable to find the factory needed to clear out the default value.");
+ return ResolvePointerResult::FullyProcessed;
}
}
status = ResultCode(Tasks::ReadField, Outcomes::Success);
diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h
index 5746005832..cf73d8dc56 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h
+++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h
@@ -38,6 +38,20 @@ namespace AZ
};
//! Core class to handle serialization to and from json documents.
+ //! The Json Serialization works by taking a default constructed object and then apply the information found in the JSON document
+ //! on top of that object. This allows the Json Serialization to avoid storing default values and helps guarantee that the final
+ //! object is in a valid state even if non-fatal issues are encountered.
+ //! Note on containers: Containers such as vector or map are always considered to be empty even if there's entries in the provided
+ //! default object. During deserialization entries will be appended to any existing values. A flag is provided to automatically
+ //! clear containers during deserialization.
+ //! Note on maps: If the key for map containers such as unordered_map can be interpret as a string the Json Serialization will use
+ //! a JSON Object to store the data in instead of an array with key/value objects.
+ //! Note on pointers: The Json Serialization assumes that are always constructed, so a default JSON value of "{}" is interpret as
+ //! creating a new default instance even if the default value is a null pointer. A JSON Null needs to be explicitly stored in
+ //! the JSON Document in order to default or explicitly set a pointer to null.
+ //! Note on pointer memory: Objects created/destroyed by the Json Serialization for pointers require that the AZ_CLASS_ALLOCATOR is
+ //! declared and the object is created using aznew or memory is allocated using azmalloc. Without these the application may
+ //! crash if the Json Serialization tries to create or destroy an object pointed to by a pointer.
class JsonSerialization final
{
public:
diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/SmartPointerSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/SmartPointerSerializer.cpp
index 0180e99592..9e707f8644 100644
--- a/Code/Framework/AzCore/AzCore/Serialization/Json/SmartPointerSerializer.cpp
+++ b/Code/Framework/AzCore/AzCore/Serialization/Json/SmartPointerSerializer.cpp
@@ -23,13 +23,6 @@ namespace AZ
{
namespace JSR = JsonSerializationResult;
- if (IsExplicitDefault(inputValue))
- {
- // Do nothing if the input is an explicit default.
- return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::DefaultsUsed,
- "Default value for smart pointer requested so no change was made.");
- }
-
const SerializeContext::ClassData* containerClass = context.GetSerializeContext()->FindClassData(outputValueTypeId);
if (!containerClass)
{
@@ -153,8 +146,7 @@ namespace AZ
if (defaultValue)
{
- bool typesMatch = false;
- auto defaultInputCallback = [&defaultValue, &inputPtrType, &typesMatch]
+ auto defaultInputCallback = [&defaultValue]
(void* elementPtr, const Uuid&, const SerializeContext::ClassData*, const SerializeContext::ClassElement*)
{
defaultValue = elementPtr;
@@ -164,11 +156,6 @@ namespace AZ
}
JSR::ResultCode result = ContinueStoring(outputValue, inputValue, defaultValue, inputPtrType, context, Flags::ResolvePointer);
- if (result.GetOutcome() == JSR::Outcomes::DefaultsUsed)
- {
- outputValue = GetExplicitDefault();
- return context.Report(result, "Smart pointer used all defaults.");
- }
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted ?
"Successfully processed smart pointer." : "A problem occurred while processing a smart pointer.");
}
diff --git a/Code/Framework/AzCore/Tests/Asset/AssetManagerStreamingTests.cpp b/Code/Framework/AzCore/Tests/Asset/AssetManagerStreamingTests.cpp
index 807288ff82..c55a95cf2a 100644
--- a/Code/Framework/AzCore/Tests/Asset/AssetManagerStreamingTests.cpp
+++ b/Code/Framework/AzCore/Tests/Asset/AssetManagerStreamingTests.cpp
@@ -330,4 +330,163 @@ namespace UnitTest
}
}
-}
+ // The AssetManagerStreamerImmediateCompletionTests class adjusts the asset loading to force it to complete immediately,
+ // while still within the callstack for GetAsset(). This can be used to test various conditions in which the load thread
+ // completes more rapidly than expected, and can expose subtle race conditions.
+ // There are a few key things that this class does to make this work:
+ // - The file I/O streamer is mocked
+ // - The asset stream data is mocked to a 0-byte length for the asset so that the stream load will bypass the I/O streamer and
+ // just immediately return completion.
+ // - The number of JobManager threads is set to 0, forcing jobs to execute synchronously inline when they are started.
+ // With these changes, GetAssetInternal() will queue the stream, which will immediately call the callback that creates LoadAssetJob,
+ // which immediately executes in-place to process the asset due to the synchronous JobManager.
+ // Note that if we just created the asset in a Ready state, most of the asset loading code is completely bypassed, and so we
+ // wouldn't be able to test for race conditions in the AssetContainer.
+ //
+ // This class also unregisters the catalog and asset handler before shutting down the asset manager. This is done to catch
+ // any outstanding asset references that exist due to loads not completing and cleaning up successfully.
+ struct AssetManagerStreamerImmediateCompletionTests : public BaseAssetManagerTest,
+ public AZ::Data::AssetCatalogRequestBus::Handler,
+ public AZ::Data::AssetHandler,
+ public AZ::Data::AssetCatalog
+ {
+ static inline const AZ::Uuid TestAssetId{"{E970B177-5F45-44EB-A2C4-9F29D9A0B2A2}"};
+ static inline constexpr AZStd::string_view TestAssetPath = "test";
+
+ void SetUp() override
+ {
+ BaseAssetManagerTest::SetUp();
+ AssetManager::Descriptor desc;
+ AssetManager::Create(desc);
+
+ // Register the handler and catalog after creation, because we intend to destroy them before AssetManager destruction.
+ // The specific asset we load is irrelevant, so register EmptyAsset.
+ AZ::Data::AssetManager::Instance().RegisterHandler(this, AZ::AzTypeInfo::Uuid());
+ AZ::Data::AssetManager::Instance().RegisterCatalog(this, AZ::AzTypeInfo::Uuid());
+
+ // Intercept messages for finding assets by name so that we can mock out the asset we're loading.
+ AZ::Data::AssetCatalogRequestBus::Handler::BusConnect();
+ }
+
+ void TearDown() override
+ {
+ // Unregister before destroying AssetManager.
+ // This will catch any assets that got stuck in a loading state without getting cleaned up.
+ AZ::Data::AssetManager::Instance().UnregisterCatalog(this);
+ AZ::Data::AssetManager::Instance().UnregisterHandler(this);
+
+ AZ::Data::AssetCatalogRequestBus::Handler::BusDisconnect();
+
+ AssetManager::Destroy();
+ BaseAssetManagerTest::TearDown();
+ }
+
+ size_t GetNumJobManagerThreads() const override
+ {
+ // Return 0 threads so that the Job Manager executes jobs synchronously inline. This lets us finish a load while still
+ // in the callstack that initiates the load.
+ return 0;
+ }
+
+ // Create a mock streamer instead of a real one, since we don't really want to load an asset.
+ IO::IStreamer* CreateStreamer() override
+ {
+ m_mockStreamer = AZStd::make_unique();
+ return &(m_mockStreamer->m_mockStreamer);
+ }
+
+ void DestroyStreamer([[maybe_unused]] IO::IStreamer* streamer) override
+ {
+ m_mockStreamer = nullptr;
+ }
+
+ // AssetHandler implementation
+
+ // Minimalist mock to create a new EmptyAsset with the desired asset ID.
+ AZ::Data::AssetPtr CreateAsset(const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override
+ {
+ return new EmptyAsset(id);
+ }
+
+ void DestroyAsset(AZ::Data::AssetPtr ptr) override
+ {
+ delete ptr;
+ }
+
+ // The mocked-out Asset Catalog handles EmptyAsset types.
+ void GetHandledAssetTypes(AZStd::vector& assetTypes) override
+ {
+ assetTypes.push_back(AZ::AzTypeInfo::Uuid());
+ }
+
+ // This is a mocked-out load, so just immediately return completion without doing anything.
+ AZ::Data::AssetHandler::LoadResult LoadAssetData(
+ [[maybe_unused]] const AZ::Data::Asset& asset,
+ [[maybe_unused]] AZStd::shared_ptr stream,
+ [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB)
+ {
+ return AZ::Data::AssetHandler::LoadResult::LoadComplete;
+ }
+
+ // AssetCatalogRequestBus implementation
+
+ // Minimalist mocks to provide our desired asset path or asset id
+ AZStd::string GetAssetPathById([[maybe_unused]] const AZ::Data::AssetId& id) override
+ {
+ return TestAssetPath;
+ }
+ AZ::Data::AssetId GetAssetIdByPath(
+ [[maybe_unused]] const char* path, [[maybe_unused]] const AZ::Data::AssetType& typeToRegister,
+ [[maybe_unused]] bool autoRegisterIfNotFound) override
+ {
+ return TestAssetId;
+ }
+
+ // Return the mocked-out information for our test asset
+ AZ::Data::AssetInfo GetAssetInfoById([[maybe_unused]] const AZ::Data::AssetId& id) override
+ {
+ AZ::Data::AssetInfo assetInfo;
+ assetInfo.m_assetId = TestAssetId;
+ assetInfo.m_assetType = AZ::AzTypeInfo::Uuid();
+ assetInfo.m_relativePath = TestAssetPath;
+ return assetInfo;
+ }
+
+ // AssetCatalog implementation
+
+ // Set the mocked-out asset load to have a 0-byte length so that the load skips I/O and immediately returns success
+ AZ::Data::AssetStreamInfo GetStreamInfoForLoad(
+ [[maybe_unused]] const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override
+ {
+ EXPECT_TRUE(type == AZ::AzTypeInfo::Uuid());
+ AZ::Data::AssetStreamInfo info;
+ info.m_dataOffset = 0;
+ info.m_streamName = TestAssetPath;
+ info.m_dataLen = 0;
+ info.m_streamFlags = AZ::IO::OpenMode::ModeRead;
+
+ return info;
+ }
+
+ AZStd::unique_ptr m_mockStreamer;
+ };
+
+ // This test will verify that even if the asset loading stream/job returns immediately, all of the loading
+ // code works successfully. The test here is fairly simple - it just loads the asset and verifies that it
+ // loaded successfully. The bulk of the test is really in the setup class above, where the load is forced
+ // to complete immediately. Also, the true failure condition is caught in the setup class too, which is
+ // the presence of any assets at the point that the asset handler is unregistered. If they're present, then
+ // the immediate load wasn't truly successful, as it left around extra references to the asset that haven't
+ // been cleaned up.
+ TEST_F(AssetManagerStreamerImmediateCompletionTests, LoadAssetWithImmediateJobCompletion_WorksSuccessfully)
+ {
+ AZ::Data::AssetLoadParameters loadParams;
+
+ auto testAsset =
+ AssetManager::Instance().GetAsset(TestAssetId, AZ::Data::AssetLoadBehavior::Default, loadParams);
+
+ AZ::Data::AssetManager::Instance().DispatchEvents();
+ EXPECT_TRUE(testAsset.IsReady());
+ }
+
+} // namespace UnitTest
diff --git a/Code/Framework/AzCore/Tests/Asset/TestAssetTypes.h b/Code/Framework/AzCore/Tests/Asset/TestAssetTypes.h
index 83f3909676..d4267972ec 100644
--- a/Code/Framework/AzCore/Tests/Asset/TestAssetTypes.h
+++ b/Code/Framework/AzCore/Tests/Asset/TestAssetTypes.h
@@ -24,6 +24,13 @@ namespace UnitTest
public:
AZ_CLASS_ALLOCATOR(EmptyAsset, AZ::SystemAllocator, 0);
AZ_RTTI(EmptyAsset, "{098E3F7F-13AC-414B-9B4E-49B5AD1BD7FE}", AZ::Data::AssetData);
+
+ EmptyAsset(
+ const AZ::Data::AssetId& assetId = AZ::Data::AssetId(),
+ AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded)
+ : AZ::Data::AssetData(assetId, status)
+ {
+ }
};
// EmptyAssetWithNoHandler: no data contained within, and no AssetHandler registered for this type
diff --git a/Code/Framework/AzCore/Tests/Math/Matrix3x3Tests.cpp b/Code/Framework/AzCore/Tests/Math/Matrix3x3Tests.cpp
index a849cfdaab..efa0ee531c 100644
--- a/Code/Framework/AzCore/Tests/Math/Matrix3x3Tests.cpp
+++ b/Code/Framework/AzCore/Tests/Math/Matrix3x3Tests.cpp
@@ -14,6 +14,7 @@
#include
#include
#include