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/Code/Platform/Mac/runtime_dependencies.cmake b/AutomatedTesting/Gem/Code/Platform/Mac/runtime_dependencies.cmake
index 4d5680a30d..f9d1e60dda 100644
--- a/AutomatedTesting/Gem/Code/Platform/Mac/runtime_dependencies.cmake
+++ b/AutomatedTesting/Gem/Code/Platform/Mac/runtime_dependencies.cmake
@@ -8,3 +8,8 @@
# 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.
#
+
+set(GEM_DEPENDENCIES
+ Gem::Atom_RHI_Metal.Private
+ Gem::Atom_RHI_Null.Private
+)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/Code/Platform/Mac/tool_dependencies.cmake b/AutomatedTesting/Gem/Code/Platform/Mac/tool_dependencies.cmake
index 4d5680a30d..ee7be9ac6d 100644
--- a/AutomatedTesting/Gem/Code/Platform/Mac/tool_dependencies.cmake
+++ b/AutomatedTesting/Gem/Code/Platform/Mac/tool_dependencies.cmake
@@ -8,3 +8,10 @@
# 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.
#
+
+set(GEM_DEPENDENCIES
+ Gem::Atom_RHI_Null.Private
+ Gem::Atom_RHI_Null.Builders
+ Gem::Atom_RHI_Metal.Private
+ Gem::Atom_RHI_Metal.Builders
+)
\ No newline at end of file
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test.py b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test.py
deleted file mode 100755
index 41ae0608a4..0000000000
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test.py
+++ /dev/null
@@ -1,75 +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.
-"""
-
-#
-# This is a pytest module to test the in-Editor Python API from ViewPane.h
-#
-import pytest
-pytest.importorskip('ly_test_tools')
-
-import sys
-import os
-sys.path.append(os.path.dirname(__file__))
-from hydra_utils import launch_test_case
-
-
-@pytest.mark.SUITE_sandbox
-@pytest.mark.parametrize('launcher_platform', ['windows_editor'])
-@pytest.mark.parametrize('project', ['AutomatedTesting'])
-@pytest.mark.parametrize('level', ['auto_test'])
-class TestLegacyCryMaterialsCommandsAutomation(object):
-
- def test_Legacy_CryMaterials(self, request, editor, level, launcher_platform):
-
- unexpected_lines=[]
- expected_lines = [
- # "Material Settings/Shader updated correctly", # Disabled, SPEC-3590
- # "Material Settings/Surface Type updated correctly", # Disabled, SPEC-3590
- "Texture Maps/Diffuse/Tiling/IsTileU updated correctly",
- "Texture Maps/Diffuse/Tiling/TileU updated correctly",
- "Texture Maps/Diffuse/Rotator/Type updated correctly",
- "Texture Maps/Diffuse/Rotator/Amplitude updated correctly",
- "Texture Maps/Diffuse/Oscillator/AmplitudeU updated correctly",
- "Opacity Settings/Opacity updated correctly",
- "Opacity Settings/AlphaTest updated correctly",
- "Opacity Settings/Additive updated correctly",
- "Lighting Settings/Diffuse Color updated correctly",
- "Lighting Settings/Specular Color updated correctly",
- "Lighting Settings/Emissive Intensity updated correctly",
- "Lighting Settings/Emissive Color updated correctly",
- "Advanced/Allow layer activation updated correctly",
- "Advanced/2 Sided updated correctly",
- "Advanced/No Shadow updated correctly",
- "Advanced/Use Scattering updated correctly",
- "Advanced/Hide After Breaking updated correctly",
- "Advanced/Fog Volume Shading Quality High updated correctly",
- "Advanced/Blend Terrain Color updated correctly",
- "Advanced/Voxel Coverage updated correctly",
- "Advanced/Propagate Opacity Settings updated correctly",
- "Advanced/Propagate Lighting Settings updated correctly",
- "Advanced/Propagate Advanced Settings updated correctly",
- "Advanced/Propagate Texture Maps updated correctly",
- "Advanced/Propagate Shader Params updated correctly",
- "Advanced/Propagate Shader Generation updated correctly",
- "Advanced/Propagate Vertex Deformation updated correctly",
- # "Shader Params/Blend Factor updated correctly", # Disabled, SPEC-3590
- # "Shader Params/Indirect bounce color updated correctly", # Disabled, SPEC-3590
- "Vertex Deformation/Type updated correctly",
- "Vertex Deformation/Wave Length X updated correctly",
- "Vertex Deformation/Wave X/Level updated correctly",
- "Vertex Deformation/Wave X/Amplitude updated correctly",
- "Vertex Deformation/Wave X/Phase updated correctly",
- "Vertex Deformation/Wave X/Frequency updated correctly"
- ]
-
- test_case_file = os.path.join(os.path.dirname(__file__), 'CryMaterialsCommands_test_case.py')
- launch_test_case(editor, test_case_file, expected_lines, unexpected_lines)
-
diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test_case.py b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test_case.py
deleted file mode 100755
index 913b1ace24..0000000000
--- a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CryMaterialsCommands_test_case.py
+++ /dev/null
@@ -1,116 +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.
-"""
-
-# Tests the legacy Python API for CryMaterials while the Editor is running
-
-import azlmbr.bus as bus
-import azlmbr.editor as editor
-import azlmbr.legacy.material as material
-import azlmbr.math as math
-
-materialName = 'materials/ter_layer_green'
-print(f'Starting CryMaterial test case using material {materialName}')
-
-
-def MaterialPropertyTest(property, value, doReset=True):
- try:
- # get old value and attempt to set new value
- oldValue = material.get_property(materialName, property)
- if oldValue == value:
- print(f'>>> `{property}` already set to {oldValue}')
- return
- material.set_property(materialName, property, value)
-
- # test that the set new value worked
- newValue = material.get_property(materialName, property)
- if oldValue != newValue:
- print(f"{property} updated correctly")
-
- # reset back to old value
- if doReset:
- material.set_property(materialName, property, oldValue)
- except:
- print(f'!!! hit an exception when setting `{property}` to {value}')
-
-
-color = math.Color()
-color.r = 255.0
-color.g = 128.0
-color.b = 64.0
-color.a = 0.0
-
-# Material Settings
-# MaterialPropertyTest("Material Settings/Shader", "Geometrybeam") # Disabled, SPEC-3590
-# MaterialPropertyTest("Material Settings/Surface Type", "grass") # Disabled, SPEC-3590
-
-# Texture Maps
-MaterialPropertyTest("Texture Maps/Diffuse/Tiling/IsTileU", False)
-MaterialPropertyTest("Texture Maps/Diffuse/Tiling/IsTileV", False)
-MaterialPropertyTest("Texture Maps/Diffuse/Tiling/TileU", 0.42)
-MaterialPropertyTest("Texture Maps/Diffuse/Rotator/Type", 'Oscillated Rotation')
-MaterialPropertyTest("Texture Maps/Diffuse/Rotator/Amplitude", 42.0)
-MaterialPropertyTest("Texture Maps/Diffuse/Oscillator/TypeU", 'Fixed Moving')
-MaterialPropertyTest("Texture Maps/Diffuse/Oscillator/AmplitudeU", 42.0)
-
-# Vertex Deformation
-MaterialPropertyTest("Vertex Deformation/Type", 'Sin Wave')
-MaterialPropertyTest("Vertex Deformation/Wave Length X", 42.0)
-MaterialPropertyTest("Vertex Deformation/Type", 'Perlin 3D')
-MaterialPropertyTest("Vertex Deformation/Noise Scale", math.Vector3(1.1, 2.2, 3.3))
-
-# Opacity Settings
-MaterialPropertyTest("Opacity Settings/Opacity", 42)
-MaterialPropertyTest("Opacity Settings/AlphaTest", 2)
-MaterialPropertyTest("Opacity Settings/Additive", True)
-
-# Lighting Settings
-MaterialPropertyTest("Lighting Settings/Diffuse Color", color)
-MaterialPropertyTest("Lighting Settings/Specular Color", color)
-MaterialPropertyTest("Lighting Settings/Emissive Intensity", 42.0)
-MaterialPropertyTest("Lighting Settings/Emissive Color", color)
-MaterialPropertyTest("Lighting Settings/Specular Level", 2.0)
-
-# Advanced
-MaterialPropertyTest("Advanced/Allow layer activation", False)
-MaterialPropertyTest("Advanced/2 Sided", True)
-MaterialPropertyTest("Advanced/No Shadow", True)
-MaterialPropertyTest("Advanced/Use Scattering", True)
-MaterialPropertyTest("Advanced/Hide After Breaking", True)
-MaterialPropertyTest("Advanced/Fog Volume Shading Quality High", True)
-MaterialPropertyTest("Advanced/Blend Terrain Color", True)
-MaterialPropertyTest("Advanced/Voxel Coverage", 0.42)
-# --- MaterialPropertyTest("Advanced/Link to Material", "materials/ter_layer_blue") # Works, but clears on UI refresh
-MaterialPropertyTest("Advanced/Propagate Opacity Settings", True)
-MaterialPropertyTest("Advanced/Propagate Lighting Settings", True)
-MaterialPropertyTest("Advanced/Propagate Advanced Settings", True)
-MaterialPropertyTest("Advanced/Propagate Texture Maps", True)
-MaterialPropertyTest("Advanced/Propagate Shader Params", True)
-MaterialPropertyTest("Advanced/Propagate Shader Generation", True)
-MaterialPropertyTest("Advanced/Propagate Vertex Deformation", True)
-
-# Shader parameters vary with each Shader, just testing a couple of them...
-# MaterialPropertyTest("Shader Params/Blend Factor", 7.0, False) # Disabled, SPEC-3590
-# MaterialPropertyTest("Shader Params/Indirect bounce color", color, False) # Disabled, SPEC-3590
-
-### These values are reset to False when set. Left them here commented for reference.
-# MaterialPropertyTest("Shader Generation Params/Dust & Turbulence", True)
-# MaterialPropertyTest("Shader Generation Params/Receive Shadows", True)
-# MaterialPropertyTest("Shader Generation Params/UV Vignetting", True)
-
-# Vertex Deformation
-MaterialPropertyTest("Vertex Deformation/Type", "Sin Wave")
-MaterialPropertyTest("Vertex Deformation/Wave Length X", 42.0)
-MaterialPropertyTest("Vertex Deformation/Wave X/Level", 42.0)
-MaterialPropertyTest("Vertex Deformation/Wave X/Amplitude", 42.0)
-MaterialPropertyTest("Vertex Deformation/Wave X/Phase", 42.0)
-MaterialPropertyTest("Vertex Deformation/Wave X/Frequency", 42.0)
-
-editor.EditorToolsApplicationRequestBus(bus.Broadcast, 'ExitNoPrompt')
diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py
index 062c449ab7..e701ff8d16 100644
--- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py
+++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py
@@ -161,20 +161,6 @@ def run():
# Deletion/Undo/Redo test
verify_deletion_undo_redo(self.component_name, entity_obj)
- # Area Light Component
- area_light = "Area Light"
- ComponentTests(
- area_light, lambda entity_obj: verify_required_component_addition(
- entity_obj, ["Capsule Shape"], area_light))
-
- # Decal Component
- material_asset_path = os.path.join("AutomatedTesting", "Materials", "basic_grey.material")
- material_asset = asset.AssetCatalogRequestBus(
- bus.Broadcast, "GetAssetIdByPath", material_asset_path, math.Uuid(), False)
- ComponentTests(
- "Decal (Atom)", lambda entity_obj: verify_set_property(
- entity_obj, "Controller|Configuration|Material", material_asset))
-
# DepthOfField Component
camera_entity = hydra.Entity("camera_entity")
camera_entity.create_entity(math.Vector3(512.0, 512.0, 34.0), ["Camera"])
@@ -185,6 +171,14 @@ def run():
lambda entity_obj: verify_set_property(
entity_obj, "Controller|Configuration|Camera Entity", camera_entity.id))
+ # Decal Component
+ material_asset_path = os.path.join("AutomatedTesting", "Materials", "basic_grey.material")
+ material_asset = asset.AssetCatalogRequestBus(
+ bus.Broadcast, "GetAssetIdByPath", material_asset_path, math.Uuid(), False)
+ ComponentTests(
+ "Decal (Atom)", lambda entity_obj: verify_set_property(
+ entity_obj, "Controller|Configuration|Material", material_asset))
+
# Directional Light Component
ComponentTests(
"Directional Light",
@@ -213,9 +207,6 @@ def run():
# Physical Sky Component
ComponentTests("Physical Sky")
- # Point Light Component
- ComponentTests("Point Light")
-
# PostFX Layer Component
ComponentTests("PostFX Layer")
diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py
index 16139e3f66..aafa2ff9b7 100644
--- a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py
+++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py
@@ -27,194 +27,6 @@ TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
@pytest.mark.parametrize("level", ["auto_test"])
class TestAtomEditorComponentsMain(object):
- @pytest.mark.test_case_id(
- "C32078117", # Area Light
- "C32078130", # Display Mapper
- "C32078129", # Light
- "C32078131", # Radius Weight Modifier
- "C32078127", # PostFX Layer
- "C32078126", # Point Light
- "C32078125", # Physical Sky
- "C32078115", # Global Skylight (IBL)
- "C32078121", # Exposure Control
- "C32078120", # Directional Light
- "C32078119", # DepthOfField
- "C32078118") # Decal
- def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
- cfg_args = [level]
-
- expected_lines = [
- # Area Light Component
- "Area Light Entity successfully created",
- "Area Light_test: Component added to the entity: True",
- "Area Light_test: Component removed after UNDO: True",
- "Area Light_test: Component added after REDO: True",
- "Area Light_test: Entered game mode: True",
- "Area Light_test: Entity enabled after adding required components: True",
- "Area Light_test: Entity is hidden: True",
- "Area Light_test: Entity is shown: True",
- "Area Light_test: Entity deleted: True",
- "Area Light_test: UNDO entity deletion works: True",
- "Area Light_test: REDO entity deletion works: True",
- # Decal Component
- "Decal (Atom) Entity successfully created",
- "Decal (Atom)_test: Component added to the entity: True",
- "Decal (Atom)_test: Component removed after UNDO: True",
- "Decal (Atom)_test: Component added after REDO: True",
- "Decal (Atom)_test: Entered game mode: True",
- "Decal (Atom)_test: Exit game mode: True",
- "Decal (Atom) Controller|Configuration|Material: SUCCESS",
- "Decal (Atom)_test: Entity is hidden: True",
- "Decal (Atom)_test: Entity is shown: True",
- "Decal (Atom)_test: Entity deleted: True",
- "Decal (Atom)_test: UNDO entity deletion works: True",
- "Decal (Atom)_test: REDO entity deletion works: True",
- # DepthOfField Component
- "DepthOfField Entity successfully created",
- "DepthOfField_test: Component added to the entity: True",
- "DepthOfField_test: Component removed after UNDO: True",
- "DepthOfField_test: Component added after REDO: True",
- "DepthOfField_test: Entered game mode: True",
- "DepthOfField_test: Exit game mode: True",
- "DepthOfField_test: Entity disabled initially: True",
- "DepthOfField_test: Entity enabled after adding required components: True",
- "DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
- "DepthOfField_test: Entity is hidden: True",
- "DepthOfField_test: Entity is shown: True",
- "DepthOfField_test: Entity deleted: True",
- "DepthOfField_test: UNDO entity deletion works: True",
- "DepthOfField_test: REDO entity deletion works: True",
- # Directional Light Component
- "Directional Light Entity successfully created",
- "Directional Light_test: Component added to the entity: True",
- "Directional Light_test: Component removed after UNDO: True",
- "Directional Light_test: Component added after REDO: True",
- "Directional Light_test: Entered game mode: True",
- "Directional Light_test: Exit game mode: True",
- "Directional Light Controller|Configuration|Shadow|Camera: SUCCESS",
- "Directional Light_test: Entity is hidden: True",
- "Directional Light_test: Entity is shown: True",
- "Directional Light_test: Entity deleted: True",
- "Directional Light_test: UNDO entity deletion works: True",
- "Directional Light_test: REDO entity deletion works: True",
- # Exposure Control Component
- "Exposure Control Entity successfully created",
- "Exposure Control_test: Component added to the entity: True",
- "Exposure Control_test: Component removed after UNDO: True",
- "Exposure Control_test: Component added after REDO: True",
- "Exposure Control_test: Entered game mode: True",
- "Exposure Control_test: Exit game mode: True",
- "Exposure Control_test: Entity disabled initially: True",
- "Exposure Control_test: Entity enabled after adding required components: True",
- "Exposure Control_test: Entity is hidden: True",
- "Exposure Control_test: Entity is shown: True",
- "Exposure Control_test: Entity deleted: True",
- "Exposure Control_test: UNDO entity deletion works: True",
- "Exposure Control_test: REDO entity deletion works: True",
- # Global Skylight (IBL) Component
- "Global Skylight (IBL) Entity successfully created",
- "Global Skylight (IBL)_test: Component added to the entity: True",
- "Global Skylight (IBL)_test: Component removed after UNDO: True",
- "Global Skylight (IBL)_test: Component added after REDO: True",
- "Global Skylight (IBL)_test: Entered game mode: True",
- "Global Skylight (IBL)_test: Exit game mode: True",
- "Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
- "Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
- "Global Skylight (IBL)_test: Entity is hidden: True",
- "Global Skylight (IBL)_test: Entity is shown: True",
- "Global Skylight (IBL)_test: Entity deleted: True",
- "Global Skylight (IBL)_test: UNDO entity deletion works: True",
- "Global Skylight (IBL)_test: REDO entity deletion works: True",
- # Physical Sky Component
- "Physical Sky Entity successfully created",
- "Physical Sky component was added to entity",
- "Entity has a Physical Sky component",
- "Physical Sky_test: Component added to the entity: True",
- "Physical Sky_test: Component removed after UNDO: True",
- "Physical Sky_test: Component added after REDO: True",
- "Physical Sky_test: Entered game mode: True",
- "Physical Sky_test: Exit game mode: True",
- "Physical Sky_test: Entity is hidden: True",
- "Physical Sky_test: Entity is shown: True",
- "Physical Sky_test: Entity deleted: True",
- "Physical Sky_test: UNDO entity deletion works: True",
- "Physical Sky_test: REDO entity deletion works: True",
- # Point Light Component
- "Point Light Entity successfully created",
- "Point Light_test: Component added to the entity: True",
- "Point Light_test: Component removed after UNDO: True",
- "Point Light_test: Component added after REDO: True",
- "Point Light_test: Entered game mode: True",
- "Point Light_test: Exit game mode: True",
- "Point Light_test: Entity is hidden: True",
- "Point Light_test: Entity is shown: True",
- "Point Light_test: Entity deleted: True",
- "Point Light_test: UNDO entity deletion works: True",
- "Point Light_test: REDO entity deletion works: True",
- # PostFX Layer Component
- "PostFX Layer Entity successfully created",
- "PostFX Layer_test: Component added to the entity: True",
- "PostFX Layer_test: Component removed after UNDO: True",
- "PostFX Layer_test: Component added after REDO: True",
- "PostFX Layer_test: Entered game mode: True",
- "PostFX Layer_test: Exit game mode: True",
- "PostFX Layer_test: Entity is hidden: True",
- "PostFX Layer_test: Entity is shown: True",
- "PostFX Layer_test: Entity deleted: True",
- "PostFX Layer_test: UNDO entity deletion works: True",
- "PostFX Layer_test: REDO entity deletion works: True",
- # Radius Weight Modifier Component
- "Radius Weight Modifier Entity successfully created",
- "Radius Weight Modifier_test: Component added to the entity: True",
- "Radius Weight Modifier_test: Component removed after UNDO: True",
- "Radius Weight Modifier_test: Component added after REDO: True",
- "Radius Weight Modifier_test: Entered game mode: True",
- "Radius Weight Modifier_test: Exit game mode: True",
- "Radius Weight Modifier_test: Entity is hidden: True",
- "Radius Weight Modifier_test: Entity is shown: True",
- "Radius Weight Modifier_test: Entity deleted: True",
- "Radius Weight Modifier_test: UNDO entity deletion works: True",
- "Radius Weight Modifier_test: REDO entity deletion works: True",
- # Light Component
- "Light Entity successfully created",
- "Light_test: Component added to the entity: True",
- "Light_test: Component removed after UNDO: True",
- "Light_test: Component added after REDO: True",
- "Light_test: Entered game mode: True",
- "Light_test: Exit game mode: True",
- "Light_test: Entity is hidden: True",
- "Light_test: Entity is shown: True",
- "Light_test: Entity deleted: True",
- "Light_test: UNDO entity deletion works: True",
- "Light_test: REDO entity deletion works: True",
- # Display Mapper Component
- "Display Mapper Entity successfully created",
- "Display Mapper_test: Component added to the entity: True",
- "Display Mapper_test: Component removed after UNDO: True",
- "Display Mapper_test: Component added after REDO: True",
- "Display Mapper_test: Entered game mode: True",
- "Display Mapper_test: Exit game mode: True",
- "Display Mapper_test: Entity is hidden: True",
- "Display Mapper_test: Entity is shown: True",
- "Display Mapper_test: Entity deleted: True",
- "Display Mapper_test: UNDO entity deletion works: True",
- "Display Mapper_test: REDO entity deletion works: True",
- ]
-
- unexpected_lines = [
- "failed to open",
- "Traceback (most recent call last):",
- ]
-
- hydra.launch_and_validate_results(
- request,
- TEST_DIRECTORY,
- editor,
- "hydra_AtomEditorComponents_AddedToEntity.py",
- timeout=EDITOR_TIMEOUT,
- expected_lines=expected_lines,
- unexpected_lines=unexpected_lines,
- halt_on_unexpected=True,
- null_renderer=True,
- cfg_args=cfg_args,
- )
+ # It requires at least one test
+ def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
+ pass
diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_SandboxSuite.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_SandboxSuite.py
index 0fb873e677..8ca5b5aa31 100644
--- a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_SandboxSuite.py
+++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_SandboxSuite.py
@@ -19,6 +19,170 @@ import pytest
@pytest.mark.parametrize("level", ["auto_test"])
class TestAtomEditorComponentsSandbox(object):
- # It requires at least one test
- def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
- pass
+ @pytest.mark.test_case_id(
+ "C32078117", # Area Light
+ "C32078130", # Display Mapper
+ "C32078129", # Light
+ "C32078131", # Radius Weight Modifier
+ "C32078127", # PostFX Layer
+ "C32078126", # Point Light
+ "C32078125", # Physical Sky
+ "C32078115", # Global Skylight (IBL)
+ "C32078121", # Exposure Control
+ "C32078120", # Directional Light
+ "C32078119", # DepthOfField
+ "C32078118") # Decal
+ def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
+ cfg_args = [level]
+
+ expected_lines = [
+ # Decal Component
+ "Decal (Atom) Entity successfully created",
+ "Decal (Atom)_test: Component added to the entity: True",
+ "Decal (Atom)_test: Component removed after UNDO: True",
+ "Decal (Atom)_test: Component added after REDO: True",
+ "Decal (Atom)_test: Entered game mode: True",
+ "Decal (Atom)_test: Exit game mode: True",
+ "Decal (Atom) Controller|Configuration|Material: SUCCESS",
+ "Decal (Atom)_test: Entity is hidden: True",
+ "Decal (Atom)_test: Entity is shown: True",
+ "Decal (Atom)_test: Entity deleted: True",
+ "Decal (Atom)_test: UNDO entity deletion works: True",
+ "Decal (Atom)_test: REDO entity deletion works: True",
+ # DepthOfField Component
+ "DepthOfField Entity successfully created",
+ "DepthOfField_test: Component added to the entity: True",
+ "DepthOfField_test: Component removed after UNDO: True",
+ "DepthOfField_test: Component added after REDO: True",
+ "DepthOfField_test: Entered game mode: True",
+ "DepthOfField_test: Exit game mode: True",
+ "DepthOfField_test: Entity disabled initially: True",
+ "DepthOfField_test: Entity enabled after adding required components: True",
+ "DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
+ "DepthOfField_test: Entity is hidden: True",
+ "DepthOfField_test: Entity is shown: True",
+ "DepthOfField_test: Entity deleted: True",
+ "DepthOfField_test: UNDO entity deletion works: True",
+ "DepthOfField_test: REDO entity deletion works: True",
+ # Directional Light Component
+ "Directional Light Entity successfully created",
+ "Directional Light_test: Component added to the entity: True",
+ "Directional Light_test: Component removed after UNDO: True",
+ "Directional Light_test: Component added after REDO: True",
+ "Directional Light_test: Entered game mode: True",
+ "Directional Light_test: Exit game mode: True",
+ "Directional Light Controller|Configuration|Shadow|Camera: SUCCESS",
+ "Directional Light_test: Entity is hidden: True",
+ "Directional Light_test: Entity is shown: True",
+ "Directional Light_test: Entity deleted: True",
+ "Directional Light_test: UNDO entity deletion works: True",
+ "Directional Light_test: REDO entity deletion works: True",
+ # Exposure Control Component
+ "Exposure Control Entity successfully created",
+ "Exposure Control_test: Component added to the entity: True",
+ "Exposure Control_test: Component removed after UNDO: True",
+ "Exposure Control_test: Component added after REDO: True",
+ "Exposure Control_test: Entered game mode: True",
+ "Exposure Control_test: Exit game mode: True",
+ "Exposure Control_test: Entity disabled initially: True",
+ "Exposure Control_test: Entity enabled after adding required components: True",
+ "Exposure Control_test: Entity is hidden: True",
+ "Exposure Control_test: Entity is shown: True",
+ "Exposure Control_test: Entity deleted: True",
+ "Exposure Control_test: UNDO entity deletion works: True",
+ "Exposure Control_test: REDO entity deletion works: True",
+ # Global Skylight (IBL) Component
+ "Global Skylight (IBL) Entity successfully created",
+ "Global Skylight (IBL)_test: Component added to the entity: True",
+ "Global Skylight (IBL)_test: Component removed after UNDO: True",
+ "Global Skylight (IBL)_test: Component added after REDO: True",
+ "Global Skylight (IBL)_test: Entered game mode: True",
+ "Global Skylight (IBL)_test: Exit game mode: True",
+ "Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
+ "Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
+ "Global Skylight (IBL)_test: Entity is hidden: True",
+ "Global Skylight (IBL)_test: Entity is shown: True",
+ "Global Skylight (IBL)_test: Entity deleted: True",
+ "Global Skylight (IBL)_test: UNDO entity deletion works: True",
+ "Global Skylight (IBL)_test: REDO entity deletion works: True",
+ # Physical Sky Component
+ "Physical Sky Entity successfully created",
+ "Physical Sky component was added to entity",
+ "Entity has a Physical Sky component",
+ "Physical Sky_test: Component added to the entity: True",
+ "Physical Sky_test: Component removed after UNDO: True",
+ "Physical Sky_test: Component added after REDO: True",
+ "Physical Sky_test: Entered game mode: True",
+ "Physical Sky_test: Exit game mode: True",
+ "Physical Sky_test: Entity is hidden: True",
+ "Physical Sky_test: Entity is shown: True",
+ "Physical Sky_test: Entity deleted: True",
+ "Physical Sky_test: UNDO entity deletion works: True",
+ "Physical Sky_test: REDO entity deletion works: True",
+ # PostFX Layer Component
+ "PostFX Layer Entity successfully created",
+ "PostFX Layer_test: Component added to the entity: True",
+ "PostFX Layer_test: Component removed after UNDO: True",
+ "PostFX Layer_test: Component added after REDO: True",
+ "PostFX Layer_test: Entered game mode: True",
+ "PostFX Layer_test: Exit game mode: True",
+ "PostFX Layer_test: Entity is hidden: True",
+ "PostFX Layer_test: Entity is shown: True",
+ "PostFX Layer_test: Entity deleted: True",
+ "PostFX Layer_test: UNDO entity deletion works: True",
+ "PostFX Layer_test: REDO entity deletion works: True",
+ # Radius Weight Modifier Component
+ "Radius Weight Modifier Entity successfully created",
+ "Radius Weight Modifier_test: Component added to the entity: True",
+ "Radius Weight Modifier_test: Component removed after UNDO: True",
+ "Radius Weight Modifier_test: Component added after REDO: True",
+ "Radius Weight Modifier_test: Entered game mode: True",
+ "Radius Weight Modifier_test: Exit game mode: True",
+ "Radius Weight Modifier_test: Entity is hidden: True",
+ "Radius Weight Modifier_test: Entity is shown: True",
+ "Radius Weight Modifier_test: Entity deleted: True",
+ "Radius Weight Modifier_test: UNDO entity deletion works: True",
+ "Radius Weight Modifier_test: REDO entity deletion works: True",
+ # Light Component
+ "Light Entity successfully created",
+ "Light_test: Component added to the entity: True",
+ "Light_test: Component removed after UNDO: True",
+ "Light_test: Component added after REDO: True",
+ "Light_test: Entered game mode: True",
+ "Light_test: Exit game mode: True",
+ "Light_test: Entity is hidden: True",
+ "Light_test: Entity is shown: True",
+ "Light_test: Entity deleted: True",
+ "Light_test: UNDO entity deletion works: True",
+ "Light_test: REDO entity deletion works: True",
+ # Display Mapper Component
+ "Display Mapper Entity successfully created",
+ "Display Mapper_test: Component added to the entity: True",
+ "Display Mapper_test: Component removed after UNDO: True",
+ "Display Mapper_test: Component added after REDO: True",
+ "Display Mapper_test: Entered game mode: True",
+ "Display Mapper_test: Exit game mode: True",
+ "Display Mapper_test: Entity is hidden: True",
+ "Display Mapper_test: Entity is shown: True",
+ "Display Mapper_test: Entity deleted: True",
+ "Display Mapper_test: UNDO entity deletion works: True",
+ "Display Mapper_test: REDO entity deletion works: True",
+ ]
+
+ unexpected_lines = [
+ "failed to open",
+ "Traceback (most recent call last):",
+ ]
+
+ hydra.launch_and_validate_results(
+ request,
+ TEST_DIRECTORY,
+ editor,
+ "hydra_AtomEditorComponents_AddedToEntity.py",
+ timeout=EDITOR_TIMEOUT,
+ expected_lines=expected_lines,
+ unexpected_lines=unexpected_lines,
+ halt_on_unexpected=True,
+ null_renderer=True,
+ cfg_args=cfg_args,
+ )
diff --git a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
index d8e0a6769c..60fa9dc44d 100755
--- a/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
+++ b/AutomatedTesting/Gem/PythonTests/physics/C24308873_CylinderShapeCollider_CollidesWithPhysXTerrain.py
@@ -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/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..4f91f539ee 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
@@ -305,11 +269,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 +279,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 +328,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 +357,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 +378,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 +398,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 +445,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/Registry/assets_scan_folders.setreg b/AutomatedTesting/Registry/assets_scan_folders.setreg
index 5394d381a3..91061f3337 100644
--- a/AutomatedTesting/Registry/assets_scan_folders.setreg
+++ b/AutomatedTesting/Registry/assets_scan_folders.setreg
@@ -38,6 +38,13 @@
"Gems/PrimitiveAssets"
]
},
+ "MaterialEditor":
+ {
+ "SourcePaths":
+ [
+ "Gems/Atom/Tools/MaterialEditor"
+ ]
+ },
"UiBasics":
{
"SourcePaths":
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cefbcf2ef4..ae8a7a05f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,9 @@ foreach(restricted_platform ${PAL_RESTRICTED_PLATFORMS})
endif()
endforeach()
-add_subdirectory(scripts)
+if(NOT INSTALLED_ENGINE)
+ add_subdirectory(scripts)
+endif()
# SPEC-1417 will investigate and fix this
if(NOT PAL_PLATFORM_NAME STREQUAL "Mac")
@@ -125,5 +127,5 @@ if(NOT INSTALLED_ENGINE)
ly_setup_o3de_install()
# IMPORTANT: must be included last
- include(cmake/CPack.cmake)
+ include(cmake/Packaging.cmake)
endif()
diff --git a/Code/CryEngine/CMakeLists.txt b/Code/CryEngine/CMakeLists.txt
index 38fcbf4a27..96f6427268 100644
--- a/Code/CryEngine/CMakeLists.txt
+++ b/Code/CryEngine/CMakeLists.txt
@@ -10,5 +10,4 @@
#
add_subdirectory(CryCommon)
-add_subdirectory(CryFont)
add_subdirectory(CrySystem)
diff --git a/Code/CryEngine/CryCommon/CREVolumeObject.h b/Code/CryEngine/CryCommon/CREVolumeObject.h
index d84c7b3e50..2137053a8e 100644
--- a/Code/CryEngine/CryCommon/CREVolumeObject.h
+++ b/Code/CryEngine/CryCommon/CREVolumeObject.h
@@ -55,7 +55,7 @@ public:
Matrix34 m_matInv;
Vec3 m_eyePosInWS;
Vec3 m_eyePosInOS;
- Plane m_volumeTraceStartPlane;
+ Plane_tpl m_volumeTraceStartPlane;
AABB m_renderBoundsOS;
bool m_viewerInsideVolume;
bool m_nearPlaneIntersectsVolume;
diff --git a/Code/CryEngine/CryCommon/CREWaterOcean.h b/Code/CryEngine/CryCommon/CREWaterOcean.h
index 784588309f..e8ca310d41 100644
--- a/Code/CryEngine/CryCommon/CREWaterOcean.h
+++ b/Code/CryEngine/CryCommon/CREWaterOcean.h
@@ -25,7 +25,7 @@ public:
virtual void mfPrepare(bool bCheckOverflow);
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
- virtual void mfGetPlane(Plane& pl);
+ virtual void mfGetPlane(Plane_tpl& pl);
virtual void Create(uint32 nVerticesCount, SVF_P3F_C4B_T2F* pVertices, uint32 nIndicesCount, const void* pIndices, uint32 nIndexSizeof);
void ReleaseOcean();
diff --git a/Code/CryEngine/CryCommon/CREWaterVolume.h b/Code/CryEngine/CryCommon/CREWaterVolume.h
index 3e7a0636e6..89102e3097 100644
--- a/Code/CryEngine/CryCommon/CREWaterVolume.h
+++ b/Code/CryEngine/CryCommon/CREWaterVolume.h
@@ -27,7 +27,7 @@ public:
virtual ~CREWaterVolume();
virtual void mfPrepare(bool bCheckOverflow);
virtual bool mfDraw(CShader* ef, SShaderPass* sfm);
- virtual void mfGetPlane(Plane& pl);
+ virtual void mfGetPlane(Plane_tpl& pl);
virtual void mfCenter(Vec3& vCenter, CRenderObject* pObj);
virtual void GetMemoryUsage(ICrySizer* pSizer) const
@@ -69,7 +69,7 @@ public:
Vec3 m_center;
AABB m_WSBBox;
- Plane m_fogPlane;
+ Plane_tpl m_fogPlane;
float m_fogDensity;
Vec3 m_fogColor;
bool m_fogColorAffectedBySun;
diff --git a/Code/CryEngine/CryCommon/CryFontBus.h b/Code/CryEngine/CryCommon/CryFontBus.h
deleted file mode 100644
index 9922193f42..0000000000
--- a/Code/CryEngine/CryCommon/CryFontBus.h
+++ /dev/null
@@ -1,35 +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
-
-namespace AZ
-{
- /*!
- * Signal LY to create an ICryFont
- */
- class CryFontCreationRequests
- : public AZ::EBusTraits
- {
- public:
- using MutexType = AZStd::recursive_mutex;
- static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
- static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
-
- virtual bool CreateCryFont([[maybe_unused]] SSystemGlobalEnvironment& env, [[maybe_unused]] const SSystemInitParams& initParams) {return false;} //! return false to fall back to default CryFont initialization
- };
- using CryFontCreationRequestBus = AZ::EBus;
-
-}
diff --git a/Code/CryEngine/CryCommon/Cry_Camera.h b/Code/CryEngine/CryCommon/Cry_Camera.h
index a744d7335f..56a764d897 100644
--- a/Code/CryEngine/CryCommon/Cry_Camera.h
+++ b/Code/CryEngine/CryCommon/Cry_Camera.h
@@ -594,7 +594,7 @@ public:
ILINE const Vec3& GetFPVertex(int nId) const; //get far-plane vertices
ILINE const Vec3& GetPPVertex(int nId) const; //get projection-plane vertices
- ILINE const Plane* GetFrustumPlane(int numplane) const { return &m_fp[numplane]; }
+ ILINE const Plane_tpl* GetFrustumPlane(int numplane) const { return &m_fp[numplane]; }
//////////////////////////////////////////////////////////////////////////
// Z-Buffer ranges.
@@ -720,7 +720,7 @@ private:
Vec3 m_cltn, m_crtn, m_clbn, m_crbn; //this are the 4 vertices of the near-plane in cam-space
Vec3 m_cltf, m_crtf, m_clbf, m_crbf; //this are the 4 vertices of the farclip-plane in cam-space
- Plane m_fp [FRUSTUM_PLANES]; //
+ Plane_tpl m_fp [FRUSTUM_PLANES]; //
uint32 m_idx1[FRUSTUM_PLANES], m_idy1[FRUSTUM_PLANES], m_idz1[FRUSTUM_PLANES]; //
uint32 m_idx2[FRUSTUM_PLANES], m_idy2[FRUSTUM_PLANES], m_idz2[FRUSTUM_PLANES]; //
@@ -742,7 +742,7 @@ public:
m_crtp = arrvVerts[2];
m_crbp = arrvVerts[3];
}
- inline void SetFrustumPlane(int i, const Plane& plane)
+ inline void SetFrustumPlane(int i, const Plane_tpl& plane)
{
m_fp[i] = plane;
//do not break strict aliasing rules, use union instead of reinterpret_casts
@@ -1180,12 +1180,12 @@ inline void CCamera::UpdateFrustum()
//-------------------------------------------------------------------------------
//--- calculate the six frustum-planes using the frustum edges in world-space ---
//-------------------------------------------------------------------------------
- m_fp[FR_PLANE_NEAR ] = Plane::CreatePlane(m_crtn + GetPosition(), m_cltn + GetPosition(), m_crbn + GetPosition());
- m_fp[FR_PLANE_RIGHT ] = Plane::CreatePlane(m_crbf + GetPosition(), m_crtf + GetPosition(), GetPosition());
- m_fp[FR_PLANE_LEFT ] = Plane::CreatePlane(m_cltf + GetPosition(), m_clbf + GetPosition(), GetPosition());
- m_fp[FR_PLANE_TOP ] = Plane::CreatePlane(m_crtf + GetPosition(), m_cltf + GetPosition(), GetPosition());
- m_fp[FR_PLANE_BOTTOM] = Plane::CreatePlane(m_clbf + GetPosition(), m_crbf + GetPosition(), GetPosition());
- m_fp[FR_PLANE_FAR ] = Plane::CreatePlane(m_crtf + GetPosition(), m_crbf + GetPosition(), m_cltf + GetPosition()); //clip-plane
+ m_fp[FR_PLANE_NEAR ] = Plane_tpl::CreatePlane(m_crtn + GetPosition(), m_cltn + GetPosition(), m_crbn + GetPosition());
+ m_fp[FR_PLANE_RIGHT ] = Plane_tpl::CreatePlane(m_crbf + GetPosition(), m_crtf + GetPosition(), GetPosition());
+ m_fp[FR_PLANE_LEFT ] = Plane_tpl::CreatePlane(m_cltf + GetPosition(), m_clbf + GetPosition(), GetPosition());
+ m_fp[FR_PLANE_TOP ] = Plane_tpl::CreatePlane(m_crtf + GetPosition(), m_cltf + GetPosition(), GetPosition());
+ m_fp[FR_PLANE_BOTTOM] = Plane_tpl::CreatePlane(m_clbf + GetPosition(), m_crbf + GetPosition(), GetPosition());
+ m_fp[FR_PLANE_FAR ] = Plane_tpl::CreatePlane(m_crtf + GetPosition(), m_crbf + GetPosition(), m_cltf + GetPosition()); //clip-plane
uint32 rh = m_Matrix.IsOrthonormalRH();
if (rh == 0)
diff --git a/Code/CryEngine/CryCommon/Cry_GeoDistance.h b/Code/CryEngine/CryCommon/Cry_GeoDistance.h
index 92c1f65d87..47794c7671 100644
--- a/Code/CryEngine/CryCommon/Cry_GeoDistance.h
+++ b/Code/CryEngine/CryCommon/Cry_GeoDistance.h
@@ -1168,17 +1168,6 @@ namespace Distance {
return fDist2;
}
- // Compute both the min and max distances of a box to a plane, in the sense of the plane normal.
- inline void AABB_Plane(float* pfDistMin, float* pfDistMax, const AABB& box, const Plane& pl)
- {
- float fDist0 = pl.DistFromPlane(box.min),
- fDistX = (box.max.x - box.min.x) * pl.n.x,
- fDistY = (box.max.y - box.min.y) * pl.n.y,
- fDistZ = (box.max.z - box.min.z) * pl.n.z;
- *pfDistMin = fDist0 + min(fDistX, 0.f) + min(fDistY, 0.f) + min(fDistZ, 0.f);
- *pfDistMax = fDist0 + max(fDistX, 0.f) + max(fDistY, 0.f) + max(fDistZ, 0.f);
- }
-
//----------------------------------------------------------------------------------
// Distance: Sphere_Triangle
//----------------------------------------------------------------------------------
diff --git a/Code/CryEngine/CryCommon/Cry_GeoIntersect.h b/Code/CryEngine/CryCommon/Cry_GeoIntersect.h
index c2f556c4b7..89f6d8ebaf 100644
--- a/Code/CryEngine/CryCommon/Cry_GeoIntersect.h
+++ b/Code/CryEngine/CryCommon/Cry_GeoIntersect.h
@@ -22,7 +22,7 @@
#include
namespace Intersect {
- inline bool Ray_Plane(const Ray& ray, const Plane& plane, Vec3& output, bool bSingleSidePlane = true)
+ inline bool Ray_Plane(const Ray& ray, const Plane_tpl& plane, Vec3& output, bool bSingleSidePlane = true)
{
float cosine = plane.n | ray.direction;
@@ -49,7 +49,7 @@ namespace Intersect {
return true; //intersection occurred
}
- inline bool Line_Plane(const Line& line, const Plane& plane, Vec3& output, bool bSingleSidePlane = true)
+ inline bool Line_Plane(const Line& line, const Plane_tpl& plane, Vec3& output, bool bSingleSidePlane = true)
{
float cosine = plane.n | line.direction;
diff --git a/Code/CryEngine/CryCommon/Cry_GeoOverlap.h b/Code/CryEngine/CryCommon/Cry_GeoOverlap.h
index 3f2c7081d7..ab560b7518 100644
--- a/Code/CryEngine/CryCommon/Cry_GeoOverlap.h
+++ b/Code/CryEngine/CryCommon/Cry_GeoOverlap.h
@@ -945,29 +945,6 @@ namespace Overlap {
}
}
-
- /*!
- *
- * we use the SEPARATING-AXIS-TEST for OBB/Plane overlap.
- *
- * Example:
- * bool result=Overlap::OBB_Plane( pos,obb, plane );
- *
- */
- inline bool OBB_Plane(const Vec3& pos, const OBB& obb, const Plane& plane)
- {
- //the new center-position in world-space
- Vec3 p = obb.m33 * obb.c + pos;
- //extract the orientation-vectors from the columns of the 3x3 matrix
- //and scale them by the half-lengths
- Vec3 ax = Vec3(obb.m33.m00, obb.m33.m10, obb.m33.m20) * obb.h.x;
- Vec3 ay = Vec3(obb.m33.m01, obb.m33.m11, obb.m33.m21) * obb.h.y;
- Vec3 az = Vec3(obb.m33.m02, obb.m33.m12, obb.m33.m22) * obb.h.z;
- //check OBB against Plane, using the plane-normal as separating axis
- return fabsf(plane | p) < (fabsf(plane.n | ax) + fabsf(plane.n | ay) + fabsf(plane.n | az));
- }
-
-
/*!
*
* we use the SEPARATING AXIS TEST to check if a triangle and AABB overlap.
@@ -1214,7 +1191,7 @@ namespace Overlap {
//test if the box intersects the plane of the triangle
//compute plane equation of triangle: normal*x+d=0
- Plane plane = Plane::CreatePlane((e0 % e1), v0);
+ Plane_tpl plane = Plane_tpl::CreatePlane((e0 % e1), v0);
Vec3 vmin, vmax;
if (plane.n.x > 0.0f)
@@ -1505,7 +1482,7 @@ namespace Overlap {
//test if the box overlaps the plane of the triangle
//compute plane equation of triangle: normal*x+d=0
- Plane plane = Plane::CreatePlane((e0 % e1), v0);
+ Plane_tpl plane = Plane_tpl::CreatePlane((e0 % e1), v0);
Vec3 vmin, vmax;
if (plane.n.x > 0.0f)
diff --git a/Code/CryEngine/CryCommon/I3DEngine.h b/Code/CryEngine/CryCommon/I3DEngine.h
index 8d3801ecb4..883b0a6d3b 100644
--- a/Code/CryEngine/CryCommon/I3DEngine.h
+++ b/Code/CryEngine/CryCommon/I3DEngine.h
@@ -458,7 +458,7 @@ struct SClipVolumeBlendInfo
{
static const int BlendPlaneCount = 2;
- Plane blendPlanes[BlendPlaneCount];
+ Plane_tpl blendPlanes[BlendPlaneCount];
struct IClipVolume* blendVolumes[BlendPlaneCount];
};
diff --git a/Code/CryEngine/CryCommon/IEntityRenderState.h b/Code/CryEngine/CryCommon/IEntityRenderState.h
index 912f4632ab..92ff354eff 100644
--- a/Code/CryEngine/CryCommon/IEntityRenderState.h
+++ b/Code/CryEngine/CryCommon/IEntityRenderState.h
@@ -731,8 +731,8 @@ struct IWaterVolumeRenderNode
virtual void SetAuxPhysParams(pe_params_area*) = 0;
virtual void CreateOcean(uint64 volumeID, /* TBD */ bool keepSerializationParams = false) = 0;
- virtual void CreateArea(uint64 volumeID, const Vec3* pVertices, unsigned int numVertices, const Vec2& surfUVScale, const Plane& fogPlane, bool keepSerializationParams = false, int nSID = -1) = 0;
- virtual void CreateRiver(uint64 volumeID, const Vec3* pVertices, unsigned int numVertices, float uTexCoordBegin, float uTexCoordEnd, const Vec2& surfUVScale, const Plane& fogPlane, bool keepSerializationParams = false, int nSID = -1) = 0;
+ virtual void CreateArea(uint64 volumeID, const Vec3* pVertices, unsigned int numVertices, const Vec2& surfUVScale, const Plane_tpl& fogPlane, bool keepSerializationParams = false, int nSID = -1) = 0;
+ virtual void CreateRiver(uint64 volumeID, const Vec3* pVertices, unsigned int numVertices, float uTexCoordBegin, float uTexCoordEnd, const Vec2& surfUVScale, const Plane_tpl& fogPlane, bool keepSerializationParams = false, int nSID = -1) = 0;
virtual void CreateRiver(uint64 volumeID, const AZStd::vector& verticies, const AZ::Transform& transform, float uTexCoordBegin, float uTexCoordEnd, const AZ::Vector2& surfUVScale, const AZ::Plane& fogPlane, bool keepSerializationParams = false, int nSID = -1) = 0;
virtual void SetAreaPhysicsArea(const Vec3* pVertices, unsigned int numVertices, bool keepSerializationParams = false) = 0;
diff --git a/Code/CryEngine/CryCommon/IShader.h b/Code/CryEngine/CryCommon/IShader.h
index 1e8553ac57..7fcbdefebb 100644
--- a/Code/CryEngine/CryCommon/IShader.h
+++ b/Code/CryEngine/CryCommon/IShader.h
@@ -52,7 +52,6 @@ struct SShaderItem;
class ITexture;
struct IMaterial;
struct SParam;
-class CMaterial;
struct SShaderSerializeContext;
struct IAnimNode;
struct SSkinningData;
diff --git a/Code/CryEngine/CryCommon/RendElement.h b/Code/CryEngine/CryCommon/RendElement.h
index c3dc1c080d..41bcf2bf67 100644
--- a/Code/CryEngine/CryCommon/RendElement.h
+++ b/Code/CryEngine/CryCommon/RendElement.h
@@ -119,7 +119,7 @@ struct IRenderElement
virtual void mfCenter(Vec3& centr, CRenderObject* pObj) = 0;
virtual void mfGetBBox(Vec3& vMins, Vec3& vMaxs) = 0;
virtual void mfReset() = 0;
- virtual void mfGetPlane(Plane& pl) = 0;
+ virtual void mfGetPlane(Plane_tpl& pl) = 0;
virtual void mfExport(struct SShaderSerializeContext& SC) = 0;
virtual void mfImport(struct SShaderSerializeContext& SC, uint32& offset) = 0;
virtual void mfPrecache(const SShaderItem& SH) = 0;
@@ -265,7 +265,7 @@ public:
void mfPrecache([[maybe_unused]] const SShaderItem& SH) override {}
void mfExport([[maybe_unused]] struct SShaderSerializeContext& SC) override { CryFatalError("mfExport has not been implemented for this render element type"); }
void mfImport([[maybe_unused]] struct SShaderSerializeContext& SC, [[maybe_unused]] uint32& offset) override { CryFatalError("mfImport has not been implemented for this render element type"); }
- void mfGetPlane(Plane& pl) override;
+ void mfGetPlane(Plane_tpl& pl) override;
void* mfGetPointer([[maybe_unused]] ESrcPointer ePT, [[maybe_unused]] int* Stride, [[maybe_unused]] EParamType Type, [[maybe_unused]] ESrcPointer Dst, [[maybe_unused]] int Flags) override { return nullptr; }
uint16 mfGetFlags() override { return m_Flags; }
diff --git a/Code/CryEngine/CryFont/CryFont.cpp b/Code/CryEngine/CryFont/CryFont.cpp
deleted file mode 100644
index ab39a0fa4d..0000000000
--- a/Code/CryEngine/CryFont/CryFont.cpp
+++ /dev/null
@@ -1,845 +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 : CCryFont class.
-
-
-#include "CryFont_precompiled.h"
-
-#if !defined(USE_NULLFONT_ALWAYS)
-
-#include "CryFont.h"
-#include "CryPath.h"
-#include "FFont.h"
-#include "FontTexture.h"
-#include "FontRenderer.h"
-#include "ILocalizationManager.h"
-
-#include
-#include
-
-// Static member definitions
-const Vec2i CCryFont::defaultGlyphSize = Vec2i(ICryFont::defaultGlyphSizeX, ICryFont::defaultGlyphSizeY);
-
-#if !defined(_RELEASE)
-static void DumpFontTexture(IConsoleCmdArgs* pArgs)
-{
- if (pArgs->GetArgCount() != 2)
- {
- return;
- }
-
- const char* pFontName = pArgs->GetArg(1);
-
- if (pFontName && *pFontName && *pFontName != '0')
- {
- string fontFile("@devroot@/");
- fontFile += pFontName;
- fontFile += ".bmp";
-
- CFFont* pFont = (CFFont*) gEnv->pCryFont->GetFont(pFontName);
- if (pFont)
- {
- pFont->GetFontTexture()->WriteToFile(fontFile.c_str());
- gEnv->pLog->LogWithType(IMiniLog::eInputResponse, "Dumped \"%s\" texture to \"%s\"!", pFontName, fontFile.c_str());
- }
- }
-}
-
-static void DumpFontNames([[maybe_unused]] IConsoleCmdArgs* pArgs)
-{
- string names = gEnv->pCryFont->GetLoadedFontNames();
- gEnv->pLog->LogWithType(IMiniLog::eInputResponse, "Currently loaded fonts: %s", names.c_str());
-}
-
-static void ReloadFonts([[maybe_unused]] IConsoleCmdArgs* pArgs)
-{
- gEnv->pCryFont->ReloadAllFonts();
-}
-#endif
-
-namespace
-{
- //! Stores paths to styled font assets for a given set of languages
- //! This struct stores the XML data contained within the tag of
- //! an enclosing definition:
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- struct FontTagXml
- {
- //! \return True if all font asset paths are non-empty, false otherwise
- bool IsValid() const
- {
- // Note that "lang" can be empty
- return !m_fontFilename.empty()
- && !m_boldFontFilename.empty()
- && !m_italicFontFilename.empty()
- && !m_boldItalicFontFilename.empty();
- }
-
- string m_lang; //!< Stores a comma-separated list of languages this collection of fonts applies to.
- //!< If this is an empty string, it implies that these set of fonts will be applied
- //!< by default (when a language is being used but no fonts in the font family are
- //!< mapped to that language).
-
- string m_fontFilename; //!< Font used when no styling is applied.
- string m_boldFontFilename; //!< Bold-styled font
- string m_italicFontFilename; //!< Italic-styled font
- string m_boldItalicFontFilename; //!< Bold-italic-styled font
- };
-
- //! Stores parsed font family XML data.
- //! This struct contains the name of the font family and a list of font
- //! file XML data for all the language-specific mappings of this
- //! font family.
- //!
- //! Example XML:
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- //!
- struct FontFamilyTagXml
- {
- //! Returns true if all font file fields were parsed, false otherwise.
- bool IsValid() const
- {
- for (const FontTagXml& fontTagXml : m_fontTagsXml)
- {
- if (!fontTagXml.IsValid())
- {
- return false;
- }
- }
-
- // Every font family must have a name
- return !m_fontFamilyName.empty();
- }
-
- string m_fontFamilyName; //!< Value of the "name" font-family tag attribute
- AZStd::list m_fontTagsXml; //!< List of child tag data.
- };
-
- //! Returns true if the XML tree was traversed successfully, false otherwise.
- //!
- //! Note that, if this function returns true, it simply means that there were
- //! no unexpected structure issues with the given XML tree, it doesn't
- //! necessarily mean that all the required fields were parsed.
- bool ParseFontFamilyXml(const XmlNodeRef& node, FontFamilyTagXml& xmlData)
- {
- if (!node)
- {
- return false;
- }
-
- //
- if (AZStd::string(node->getTag()) == "fontfamily")
- {
- const int numAttributes = node->getNumAttributes();
-
- if (numAttributes <= 0)
- {
- // Expecting at least one attribute
- return false;
- }
-
- string name;
-
- for (int i = 0, count = node->getNumAttributes(); i < count; ++i)
- {
- const char* key = "";
- const char* value = "";
- if (node->getAttributeByIndex(i, &key, &value))
- {
- if (string(key) == "name")
- {
- name = value;
- }
- else
- {
- // Unexpected font tag attribute
- return false;
- }
- }
- }
-
- name.Trim();
- if (!name.empty())
- {
- xmlData.m_fontFamilyName = name;
- }
- else
- {
- // Font family must have a name
- return false;
- }
- }
-
- //
- if (AZStd::string(node->getTag()) == "font")
- {
- xmlData.m_fontTagsXml.push_back(FontTagXml());
-
- string lang;
- for (int i = 0, count = node->getNumAttributes(); i < count; ++i)
- {
- const char* key = "";
- const char* value = "";
- if (node->getAttributeByIndex(i, &key, &value))
- {
- if (string(key) == "lang")
- {
- lang = value;
- }
- else
- {
- // Unexpected font tag attribute
- return false;
- }
- }
- }
-
- lang.Trim();
- if (!lang.empty())
- {
- xmlData.m_fontTagsXml.back().m_lang = lang;
- }
- }
-
- //
- else if (AZStd::string(node->getTag()) == "file")
- {
- const int numAttributes = node->getNumAttributes();
-
- if (numAttributes <= 0)
- {
- // Expecting at least one attribute
- return false;
- }
-
- string path;
- string tags;
-
- for (int i = 0, count = node->getNumAttributes(); i < count; ++i)
- {
- const char* key = "";
- const char* value = "";
- if (node->getAttributeByIndex(i, &key, &value))
- {
- if (string(key) == "path")
- {
- path = value;
- }
- else if (string(key) == "tags")
- {
- tags = value;
- }
- else
- {
- // Unexpected font tag attribute
- return false;
- }
- }
- }
-
- tags.Trim();
- if (tags.empty())
- {
- xmlData.m_fontTagsXml.back().m_fontFilename = path;
- }
- else if (tags == "b")
- {
- xmlData.m_fontTagsXml.back().m_boldFontFilename = path;
- }
- else if (tags == "i")
- {
- xmlData.m_fontTagsXml.back().m_italicFontFilename = path;
- }
- else
- {
- // We'll just assume any other tag indicates bold italic
- xmlData.m_fontTagsXml.back().m_boldItalicFontFilename = path;
- }
- }
-
- for (int i = 0, count = node->getChildCount(); i < count; ++i)
- {
- XmlNodeRef child = node->getChild(i);
- if (!ParseFontFamilyXml(child, xmlData))
- {
- return false;
- }
- }
-
- return true;
- }
-
- //! Only attempt XML file load if file exists.
- //! There are use-cases where the XML path is not fully known (such as
- //! when referencing font family names from font family XML files), and
- //! attempting to load the XML files directly via ISystem() methods can
- //! produce a lot of warning noise.
- XmlNodeRef SafeLoadXmlFromFile(const string& xmlPath)
- {
- if (gEnv->pCryPak->IsFileExist(xmlPath.c_str()))
- {
- return GetISystem()->LoadXmlFromFile(xmlPath.c_str());
- }
-
- return XmlNodeRef();
- }
-
-}
-
-CCryFont::CCryFont(ISystem* pSystem)
- : m_pSystem(pSystem)
- , m_fonts()
- , m_rndPropIsRGBA(false)
- , m_rndPropHalfTexelOffset(0.5f)
-{
- assert(m_pSystem);
-
- CryLogAlways("Using FreeType %d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);
-
- // Persist fonts for application lifetime to prevent unnecessary work
- REGISTER_CVAR(r_persistFontFamilies, r_persistFontFamilies, VF_NULL, "Persist loaded font families for lifetime of application.");
-
-#if !defined(_RELEASE)
- REGISTER_COMMAND("r_DumpFontTexture", DumpFontTexture, 0,
- "Dumps the specified font's texture to a bitmap file\n"
- "Use r_DumpFontTexture to get the loaded font names\n"
- "Usage: r_DumpFontTexture ");
- REGISTER_COMMAND("r_DumpFontNames", DumpFontNames, 0,
- "Logs a list of fonts currently loaded");
- REGISTER_COMMAND("r_ReloadFonts", ReloadFonts, VF_NULL,
- "Reload all fonts");
-#endif
-}
-
-CCryFont::~CCryFont()
-{
- // Persist fonts for application lifetime to prevent unnecessary work
- m_persistedFontFamilies.clear();
-
- for (FontMapItor it = m_fonts.begin(), itEnd = m_fonts.end(); it != itEnd; )
- {
- CFFont* pFont = it->second;
- ++it; // iterate as Release() below will remove font from the map
- SAFE_RELEASE(pFont);
- }
-}
-
-void CCryFont::Release()
-{
- delete this;
-}
-
-IFFont* CCryFont::NewFont(const char* pFontName)
-{
- string name = pFontName;
- name.MakeLower();
-
- FontMapItor it = m_fonts.find(CONST_TEMP_STRING(name.c_str()));
- if (it != m_fonts.end())
- {
- return it->second;
- }
-
- CFFont* pFont = new CFFont(m_pSystem, this, name.c_str());
- m_fonts.insert(FontMapItor::value_type(name, pFont));
- return pFont;
-}
-
-IFFont* CCryFont::GetFont(const char* pFontName) const
-{
- FontMapConstItor it = m_fonts.find(CONST_TEMP_STRING(string(pFontName).MakeLower()));
- return it != m_fonts.end() ? it->second : 0;
-}
-
-FontFamilyPtr CCryFont::LoadFontFamily(const char* pFontFamilyName)
-{
- FontFamilyPtr fontFamily(nullptr);
- string fontFamilyPath;
- string fontFamilyFullPath;
-
- XmlNodeRef root = LoadFontFamilyXml(pFontFamilyName, fontFamilyPath, fontFamilyFullPath);
-
- if (root)
- {
- FontFamilyTagXml xmlData;
- const bool parseSuccess = ParseFontFamilyXml(root, xmlData);
- if (parseSuccess && xmlData.IsValid())
- {
- const char* currentLanguage = gEnv->pSystem->GetLocalizationManager()->GetLanguage();
- FontTagXml* defaultFont = nullptr;
- FontTagXml* langSpecificFont = nullptr;
-
- // Note that we don't break out of this for-loop early because we
- // want to find both the default font family and the
- // language-specific font family. We prefer the lang-specific
- // family but will fall back on the default if it doesn't exist.
- for (FontTagXml& fontTagXml : xmlData.m_fontTagsXml)
- {
- if (fontTagXml.m_lang.empty())
- {
- defaultFont = &fontTagXml;
- }
- else
- {
- int searchPos = 0;
- string langToken;
-
- // "lang" font-tag attribute could be comma-separated
- while (!(langToken = fontTagXml.m_lang.Tokenize(",", searchPos)).empty())
- {
- if (langToken.Trim() == currentLanguage)
- {
- langSpecificFont = &fontTagXml;
- break;
- }
- }
- }
- }
-
- if (langSpecificFont || defaultFont)
- {
- // Prefer lang-specific font-family over default, if it exists
- FontTagXml* fontTagXml = langSpecificFont ? langSpecificFont : defaultFont;
-
- // Pre-pend font family's path to make font family XML paths
- // relative to font family file
- fontTagXml->m_fontFilename = fontFamilyPath + fontTagXml->m_fontFilename;
- fontTagXml->m_boldFontFilename = fontFamilyPath + fontTagXml->m_boldFontFilename;
- fontTagXml->m_italicFontFilename = fontFamilyPath + fontTagXml->m_italicFontFilename;
- fontTagXml->m_boldItalicFontFilename = fontFamilyPath + fontTagXml->m_boldItalicFontFilename;
-
- IFFont* normal = LoadFont(fontTagXml->m_fontFilename.c_str());
- IFFont* bold = LoadFont(fontTagXml->m_boldFontFilename.c_str());
- IFFont* italic = LoadFont(fontTagXml->m_italicFontFilename.c_str());
- IFFont* boldItalic = LoadFont(fontTagXml->m_boldItalicFontFilename.c_str());
-
- // Only continue if all fonts were created successfully
- if (normal && bold && italic && boldItalic)
- {
- fontFamily.reset(new FontFamily(),
- [this](FontFamily* pFontFamily)
- {
- ReleaseFontFamily(pFontFamily);
- });
-
- // Map the font family name both by path and by name defined
- // within the Font Family XML itself. This allows font
- // families to also be referenced simply by name.
- if (!AddFontFamilyToMaps(fontFamilyFullPath, xmlData.m_fontFamilyName, fontFamily))
- {
- SAFE_RELEASE(normal);
- SAFE_RELEASE(bold);
- SAFE_RELEASE(italic);
- SAFE_RELEASE(boldItalic);
-
- return nullptr;
- }
-
- fontFamily->familyName = xmlData.m_fontFamilyName;
- fontFamily->normal = normal;
- fontFamily->bold = bold;
- fontFamily->italic = italic;
- fontFamily->boldItalic = boldItalic;
- }
- else
- {
- SAFE_RELEASE(normal);
- SAFE_RELEASE(bold);
- SAFE_RELEASE(italic);
- SAFE_RELEASE(boldItalic);
- }
- }
- }
- }
-
- if (!fontFamily)
- {
- // Unable to load font family XML, so load font normally and associate
- // it with a font family
- IFFont* pFont = LoadFont(pFontFamilyName);
-
- if (pFont)
- {
- // Create a font family from a single font by assigning all the
- // font family stylings to the same font
- fontFamily.reset(new FontFamily(),
- [this](FontFamily* pFontFamily)
- {
- ReleaseFontFamily(pFontFamily);
- });
-
- // Use filepath as familyName so font loading/unloading doesn't break with duplicate file names
- fontFamily->familyName = pFontFamilyName;
-
- if (!AddFontFamilyToMaps(pFontFamilyName, fontFamily->familyName, fontFamily))
- {
- SAFE_RELEASE(pFont);
-
- return nullptr;
- }
-
- // Assign all stylings to the same font
- fontFamily->normal = pFont;
- fontFamily->bold = pFont;
- fontFamily->italic = pFont;
- fontFamily->boldItalic = pFont;
-
- // The other three stylings need to have their ref count
- // incremented (even though in this particular case its all the
- // same font) because when ReleaseFontFamily executes all fonts
- // in the family will be (corresondingly) Release'd.
- fontFamily->bold->AddRef();
- fontFamily->italic->AddRef();
- fontFamily->boldItalic->AddRef();
- }
- }
-
- // Persist fonts for application lifetime to prevent unnecessary work
- if (r_persistFontFamilies > 0)
- {
- m_persistedFontFamilies.emplace_back(FontFamilyPtr(fontFamily));
- }
-
- return fontFamily;
-}
-
-FontFamilyPtr CCryFont::GetFontFamily(const char* pFontFamilyName)
-{
- FontFamilyPtr fontFamily = nullptr;
-
- // The given string could either be: a font family name (defined in font
- // family XML), a file path (for regular fonts mapped as font families),
- // or just the filename of a font itself. Fonts are mapped by font family
- // name or by filepath, so attempt lookup using the map first since it's
- // the fastest.
- string loweredName = string(pFontFamilyName).Trim().MakeLower();
- auto it = m_fontFamilies.find(PathUtil::MakeGamePath(loweredName).c_str());
- if (it != m_fontFamilies.end())
- {
- fontFamily = FontFamilyPtr(it->second);
- }
- else
- {
- // Iterate through all fonts, returning the first match where simply
- // the filename of a font could be a match. This case will likely be
- // hit when text markup references a font that doesn't belong to a
- // font family.
- for (const auto& fontFamilyIter : m_fontFamilies)
- {
- const AZStd::string& mappedFontFamilyName = fontFamilyIter.first;
- string mappedFilenameNoExtension = PathUtil::GetFileName(mappedFontFamilyName.c_str());
-
- string searchStringFilenameNoExtension = PathUtil::GetFileName(loweredName);
-
- if (mappedFilenameNoExtension == searchStringFilenameNoExtension)
- {
- fontFamily = FontFamilyPtr(fontFamilyIter.second);
- break;
- }
- }
- }
-
- return fontFamily;
-}
-
-void CCryFont::AddCharsToFontTextures(FontFamilyPtr pFontFamily, const char* pChars, int glyphSizeX, int glyphSizeY)
-{
- pFontFamily->normal->AddCharsToFontTexture(pChars, glyphSizeX, glyphSizeY);
- pFontFamily->bold->AddCharsToFontTexture(pChars, glyphSizeX, glyphSizeY);
- pFontFamily->italic->AddCharsToFontTexture(pChars, glyphSizeX, glyphSizeY);
- pFontFamily->boldItalic->AddCharsToFontTexture(pChars, glyphSizeX, glyphSizeY);
-}
-
-void CCryFont::SetRendererProperties(IRenderer* pRenderer)
-{
- if (pRenderer)
- {
- m_rndPropIsRGBA = (pRenderer->GetFeatures() & RFT_RGBA) != 0;
- m_rndPropHalfTexelOffset = 0.0f;
- }
-}
-
-void CCryFont::GetMemoryUsage(ICrySizer* pSizer) const
-{
- if (!pSizer->Add(*this))
- {
- return;
- }
-
- pSizer->AddObject(m_fonts);
-}
-
-string CCryFont::GetLoadedFontNames() const
-{
- string ret;
- for (FontMapConstItor it = m_fonts.begin(), itEnd = m_fonts.end(); it != itEnd; ++it)
- {
- CFFont* pFont = it->second;
- if (pFont)
- {
- if (!ret.empty())
- {
- ret += ",";
- }
- ret += pFont->GetName();
- }
- }
- return ret;
-}
-
-void CCryFont::OnLanguageChanged()
-{
- ReloadAllFonts();
-
- EBUS_EVENT(LanguageChangeNotificationBus, LanguageChanged);
-}
-
-void CCryFont::ReloadAllFonts()
-{
- // Persist fonts for application lifetime to prevent unnecessary work
- m_persistedFontFamilies.clear();
-
- AZStd::list fontFamilyFilenames;
- AZStd::list fontFamilyWeakPtrs;
-
- // Iterate through all currently loaded font families
- for (auto it : m_fontFamilyReverseLookup)
- {
- fontFamilyWeakPtrs.push_back(it.first);
- fontFamilyFilenames.push_back(it.second->first);
- }
-
- // Release font-family resources and unmap them
- for (auto fontFamily : fontFamilyWeakPtrs)
- {
- ReleaseFontFamily(fontFamily);
- }
-
- // Reload the font families
- for (auto familyFilename : fontFamilyFilenames)
- {
- LoadFontFamily(familyFilename.c_str());
- }
-
- // All UI text components need to reload their font assets (both in-game
- // and in-editor).
- EBUS_EVENT(FontNotificationBus, OnFontsReloaded);
-}
-
-void CCryFont::UnregisterFont(const char* pFontName)
-{
- FontMapItor it = m_fonts.find(CONST_TEMP_STRING(pFontName));
-
-#if defined(AZ_ENABLE_TRACING)
- IFFont* fontPtr = it->second;
-#endif
-
- if (it != m_fonts.end())
- {
- m_fonts.erase(it);
- }
-
-#if defined(AZ_ENABLE_TRACING)
- // Make sure the font being released isn't currently in use by a font family.
- // If it is, the FontFamily will have a dangling pointer and will cause a
- // crash when the FontFamily eventually gets released.
- for (auto reverseMapEntry : m_fontFamilyReverseLookup)
- {
- FontFamily* fontFamily = reverseMapEntry.first;
- AZ_Assert(fontFamily->normal != fontPtr,
- "The following font is being freed but still in use by a FontFamily: %s",
- pFontName);
- AZ_Assert(fontFamily->italic != fontPtr,
- "The following font is being freed but still in use by a FontFamily: %s",
- pFontName);
- AZ_Assert(fontFamily->bold != fontPtr,
- "The following font is being freed but still in use by a FontFamily: %s",
- pFontName);
- AZ_Assert(fontFamily->boldItalic != fontPtr,
- "The following font is being freed but still in use by a FontFamily: %s",
- pFontName);
- }
-#endif
-}
-
-IFFont* CCryFont::LoadFont(const char* pFontName)
-{
- string fontName = pFontName;
- fontName.MakeLower();
-
- IFFont* font = GetFont(fontName);
- if (font)
- {
- font->AddRef(); // use existing loaded font
- }
- else
- {
- // attempt to create and load a new font, use the font pathname as the font name
- font = NewFont(fontName);
- if (!font)
- {
- string errorMsg = "Error creating a new font named ";
- errorMsg += fontName;
- errorMsg += ".";
- CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, errorMsg.c_str());
- }
- else
- {
- // creating font adds one to its refcount so no need for AddRef here
- if (!font->Load(fontName))
- {
- string errorMsg = "Error loading a font from ";
- errorMsg += fontName;
- errorMsg += ".";
- CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, errorMsg);
- font->Release();
- font = nullptr;
- }
- }
- }
-
- return font;
-}
-
-void CCryFont::ReleaseFontFamily(FontFamily* pFontFamily)
-{
- // Ensure that Font Family was mapped prior to destruction
- const bool isMapped = m_fontFamilyReverseLookup.find(pFontFamily) != m_fontFamilyReverseLookup.end();
- if (!isMapped)
- {
- return;
- }
-
- // Note that the FontFamily is mapped both by filename and by "family name"
- auto it = m_fontFamilyReverseLookup[pFontFamily];
- m_fontFamilies.erase(it);
- string familyName(pFontFamily->familyName);
- m_fontFamilies.erase(familyName.MakeLower().c_str());
-
- // Reverse lookup is used to avoid needing to store filename path with
- // the font family, so we need to remove that entry also.
- m_fontFamilyReverseLookup.erase(pFontFamily);
-
- SAFE_RELEASE(pFontFamily->normal);
- SAFE_RELEASE(pFontFamily->bold);
- SAFE_RELEASE(pFontFamily->italic);
- SAFE_RELEASE(pFontFamily->boldItalic);
-}
-
-bool CCryFont::AddFontFamilyToMaps(const char* pFontFamilyFilename, const char* pFontFamilyName, FontFamilyPtr fontFamily)
-{
- if (!pFontFamilyFilename || !pFontFamilyName || !fontFamily.get())
- {
- return false;
- }
-
- // We don't support "updating" mapped values.
- AZStd::string loweredFilename(PathUtil::MakeGamePath(string(pFontFamilyFilename)).c_str());
- AZStd::to_lower(loweredFilename.begin(), loweredFilename.end());
- if (m_fontFamilies.find(loweredFilename) != m_fontFamilies.end())
- {
- string warnMsg;
- warnMsg.Format("Couldn't load Font Family '%s': already loaded", pFontFamilyFilename);
- CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, warnMsg.c_str());
- return false;
- }
-
- // Similarly, we don't support Font Family XMLs that have the same font
- // family name (we assume all Font Family names are unique).
- AZStd::string loweredFontFamilyName(pFontFamilyName);
- AZStd::to_lower(loweredFontFamilyName.begin(), loweredFontFamilyName.end());
- if (m_fontFamilies.find(loweredFontFamilyName) != m_fontFamilies.end())
- {
- string warnMsg;
- warnMsg.Format("Couldn't load Font Family '%s': already loaded", pFontFamilyName);
- CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, warnMsg.c_str());
- return false;
- }
-
- // First, insert by filename
- AZStd::pair> insertPair(loweredFilename, fontFamily);
- auto iterPosition = m_fontFamilies.insert(insertPair).first;
- m_fontFamilyReverseLookup[fontFamily.get()] = iterPosition;
-
- // Then, by Font Family name
- AZStd::pair> nameInsertPair(loweredFontFamilyName, fontFamily);
- m_fontFamilies.insert(nameInsertPair);
-
- return true;
-}
-
-XmlNodeRef CCryFont::LoadFontFamilyXml(const char* pFontFamilyName, string& outputDirectory, string& outputFullPath)
-{
- outputFullPath = pFontFamilyName;
- outputDirectory = PathUtil::GetPath(pFontFamilyName);
- XmlNodeRef root = SafeLoadXmlFromFile(outputFullPath);
-
- // When parsing a tag in markup, only the font name is given and
- // not a path, so we try to build a "best guess" path from the name.
- if (!root)
- {
- string fileNoExtension(PathUtil::GetFileName(pFontFamilyName));
- string fileExtension(PathUtil::GetExt(pFontFamilyName));
-
- if (fileExtension.empty())
- {
- fileExtension = ".fontfamily";
- }
-
- // Try: "fonts/fontName.fontfamily"
- outputDirectory = string("fonts/");
- outputFullPath = outputDirectory + fileNoExtension + fileExtension;
- root = SafeLoadXmlFromFile(outputFullPath);
-
- // Finally, try: "fonts/fontName/fontName.fontfamily"
- if (!root)
- {
- outputDirectory = string("fonts/") + fileNoExtension + "/";
- outputFullPath = outputDirectory + fileNoExtension + fileExtension;
- root = SafeLoadXmlFromFile(outputFullPath);
- }
- }
-
- return root;
-}
-
-#endif
-
diff --git a/Code/CryEngine/CryFont/CryFont.def b/Code/CryEngine/CryFont/CryFont.def
deleted file mode 100644
index 43bfe0b13d..0000000000
--- a/Code/CryEngine/CryFont/CryFont.def
+++ /dev/null
@@ -1,3 +0,0 @@
-EXPORTS
- ModuleInitISystem @2
- CryModuleGetMemoryInfo @8
diff --git a/Code/CryEngine/CryFont/CryFont.h b/Code/CryEngine/CryFont/CryFont.h
deleted file mode 100644
index 726818f5a7..0000000000
--- a/Code/CryEngine/CryFont/CryFont.h
+++ /dev/null
@@ -1,108 +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_CRYFONT_CRYFONT_H
-#define CRYINCLUDE_CRYFONT_CRYFONT_H
-#pragma once
-
-
-#if !defined(USE_NULLFONT_ALWAYS)
-
-#include
-#include
-#include
-#include