Merge branch 'main' of https://github.com/aws-lumberyard/o3de into Spawnable/Instantiation/EntityIdReferenceFix
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::BlastTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL TRUE
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT Blast
|
||||
)
|
||||
endif()
|
||||
@@ -15,406 +15,46 @@
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
|
||||
## Asset pipeline ##
|
||||
add_subdirectory(assetpipeline)
|
||||
|
||||
## Atom Renderer ##
|
||||
add_subdirectory(atom_renderer)
|
||||
|
||||
## Physics ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(physics)
|
||||
|
||||
## ScriptCanvas ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
ScriptCanvas
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(scripting)
|
||||
|
||||
## White Box ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::WhiteBoxTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
WhiteBox
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(WhiteBox)
|
||||
|
||||
## NvCloth ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::NvClothTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/NvCloth/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
NvCloth
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(NvCloth)
|
||||
|
||||
## Prefab ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PrefabTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/prefab/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(prefab)
|
||||
|
||||
## Editor Python Bindings ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorPythonBindings
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/EditorPythonBindings
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(EditorPythonBindings)
|
||||
|
||||
## Python Asset Builder ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PythonAssetBuilder
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/PythonAssetBuilder
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
Gem::PythonAssetBuilder.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(PythonAssetBuilder)
|
||||
|
||||
## Blast ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::BlastTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL TRUE
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT Blast
|
||||
)
|
||||
endif()
|
||||
|
||||
#############
|
||||
add_subdirectory(Blast)
|
||||
|
||||
## Large Worlds ##
|
||||
|
||||
include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED)
|
||||
|
||||
## DynVeg ##
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::DynamicVegetationTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.GameLauncher
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Sandbox
|
||||
TEST_SERIAL
|
||||
TEST_SUITE sandbox
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_sandbox"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_filter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_modifier"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_regression"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_area"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_misc"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
## LandscapeCanvas ##
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::LandscapeCanvasTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
PYTEST_MARKS "SUITE_periodic"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
## GradientSignal ##
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::GradientSignalTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/gradient_signal
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
endif()
|
||||
add_subdirectory(largeworlds)
|
||||
|
||||
## Editor ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/editor
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Editor
|
||||
)
|
||||
endif()
|
||||
add_subdirectory(editor)
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# Unstable, SPEC-3838 will restore
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::asset_load_benchmark_test
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE benchmark
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/streaming/benchmark/asset_load_benchmark_test.py
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# AZ::AssetProcessorBatch
|
||||
# AutomatedTesting.GameLauncher
|
||||
#)
|
||||
endif()
|
||||
## Streaming ##
|
||||
add_subdirectory(streaming)
|
||||
|
||||
## Smoke ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::SmokeTest
|
||||
TEST_SUITE smoke
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/smoke
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
AZ::PythonBindingsExample
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Smoke
|
||||
)
|
||||
endif()
|
||||
## Streaming ##
|
||||
add_subdirectory(smoke)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorPythonBindings
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::NvClothTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
NvCloth
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PythonAssetBuilder
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
Gem::PythonAssetBuilder.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::WhiteBoxTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
WhiteBox
|
||||
)
|
||||
endif()
|
||||
@@ -13,8 +13,6 @@ add_subdirectory(asset_processor_tests)
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
## AP Python Tests ##
|
||||
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AssetPipelineTests.AuxiliaryContent
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/auxiliary_content_tests/auxiliary_content_tests.py
|
||||
@@ -22,7 +20,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
TEST_SUITE periodic
|
||||
)
|
||||
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AssetPipelineTests.BankInfoParser
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/wwise_bank_dependency_tests/bank_info_parser_tests.py
|
||||
@@ -33,4 +30,3 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
@@ -141,4 +141,3 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# )
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Editor
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,186 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED)
|
||||
|
||||
## DynVeg ##
|
||||
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::DynamicVegetationTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.GameLauncher
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Sandbox
|
||||
TEST_SERIAL
|
||||
TEST_SUITE sandbox
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_sandbox"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_filter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_modifier"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_regression"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_area"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_misc"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
## LandscapeCanvas ##
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::LandscapeCanvasTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas
|
||||
PYTEST_MARKS "SUITE_periodic"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
## GradientSignal ##
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::GradientSignalTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
endif()
|
||||
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
## Prefab ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PrefabTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests_Perodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
ScriptCanvas
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# 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.
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::SmokeTest
|
||||
TEST_SUITE smoke
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
AZ::PythonBindingsExample
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Smoke
|
||||
)
|
||||
endif()
|
||||
@@ -20,6 +20,7 @@ import subprocess
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolAssetBuilderWorks(object):
|
||||
@pytest.mark.xfail(reason="Ignoring failure temporarily - SPEC-6905")
|
||||
def test_CLITool_AssetBuilder_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "AssetBuilder")
|
||||
help_message = "AssetBuilder is part of the Asset Processor"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# Unstable, SPEC-3838 will restore
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::asset_load_benchmark_test
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE benchmark
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/benchmark/asset_load_benchmark_test.py
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# AZ::AssetProcessorBatch
|
||||
# AutomatedTesting.GameLauncher
|
||||
#)
|
||||
endif()
|
||||
@@ -772,7 +772,6 @@ _MS_ALIGN(16) struct SSkinningData
|
||||
void* pCharInstCB; // used if per char instance cbs are available in renderdll (d3d11+);
|
||||
// members below are for Software Skinning
|
||||
void* pCustomData; // client specific data, used for example for sw-skinning on animation side
|
||||
SSkinningData** pMasterSkinningDataList; // used by the SkinningData for a Character Instance, contains a list of all Skin Instances which need SW-Skinning
|
||||
SSkinningData* pNextSkinningData; // List to the next element which needs SW-Skinning
|
||||
} _ALIGN(16);
|
||||
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
|
||||
namespace AZStd
|
||||
{
|
||||
//! Simple class for verifying that no concurrent access is occuring.
|
||||
//! Simple class for verifying that no concurrent access is occurring.
|
||||
//! This is *not* a synchronization primitive, and is intended simply for checking that no concurrency issues exist.
|
||||
//! It will be compiled out in release builds.
|
||||
//! Use concurrency_checker like a mutex (i.e. call soft_lock() and soft_unlock() around all instances of your data access).
|
||||
//! Use soft_lock_shared and soft_unlock_shared around places where multiple threads are allowed to have read access
|
||||
//! at the same time as long as nothing else already has a soft lock
|
||||
//! It will assert if there are multiple threads accessing the locked code/data at the same time.
|
||||
//! Expected use case is for defensive programming: when you do not expect any concurrent access within a system,
|
||||
//! but want to verify that it stays that way in the future, without incurring the overhead of a mutex.
|
||||
@@ -34,7 +36,7 @@ namespace AZStd
|
||||
{
|
||||
#ifdef AZ_CONCURRENCY_CHECKER_ENABLED
|
||||
uint32_t count = ++m_concurrencyCounter;
|
||||
AZ_Assert(count == 1, "Concurrency check failed. Multiple threads are trying to access data at the same time, or there is a lock/unlock mismatch.");
|
||||
AZ_Assert(count == 1 && m_sharedConcurrencyCounter == 0, "Concurrency check failed. Multiple threads are trying to access data at the same time, or there is a lock/unlock mismatch.");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -46,9 +48,27 @@ namespace AZStd
|
||||
#endif
|
||||
}
|
||||
|
||||
AZ_FORCE_INLINE void soft_lock_shared()
|
||||
{
|
||||
#ifdef AZ_CONCURRENCY_CHECKER_ENABLED
|
||||
AZ_Assert(m_concurrencyCounter == 0, "Concurrency check failed. A soft_lock_shared was attempted when there was already a soft_lock.");
|
||||
++m_sharedConcurrencyCounter;
|
||||
#endif
|
||||
}
|
||||
|
||||
AZ_FORCE_INLINE void soft_unlock_shared()
|
||||
{
|
||||
#ifdef AZ_CONCURRENCY_CHECKER_ENABLED
|
||||
AZ_Assert(m_sharedConcurrencyCounter != 0, "Concurrency check failed. There is a shared_lock/shared_unlock mismatch.");
|
||||
--m_sharedConcurrencyCounter;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
#ifdef AZ_CONCURRENCY_CHECKER_ENABLED
|
||||
AZStd::atomic_uint32_t m_concurrencyCounter = 0;
|
||||
AZStd::atomic_uint32_t m_sharedConcurrencyCounter = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -293,15 +293,12 @@ namespace UnitTest
|
||||
{
|
||||
array_view<int> view({ 1,2,3,4 });
|
||||
|
||||
UnitTest::TestRunner::Instance().StartAssertTests();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
|
||||
EXPECT_EQ(0, UnitTest::TestRunner::Instance().m_numAssertsFailed);
|
||||
view[4];
|
||||
EXPECT_EQ(1, UnitTest::TestRunner::Instance().m_numAssertsFailed);
|
||||
view[5];
|
||||
EXPECT_EQ(2, UnitTest::TestRunner::Instance().m_numAssertsFailed);
|
||||
|
||||
UnitTest::TestRunner::Instance().StopAssertTests();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AtomCore/std/parallel/concurrency_checker.h>
|
||||
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
using namespace AZStd;
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
class ConcurrencyCheckerTestFixture
|
||||
: public AllocatorsTestFixture
|
||||
{
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
AllocatorsFixture::SetUp();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftLock_NoContention_NoAsserts)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
concurrencyChecker.soft_lock();
|
||||
concurrencyChecker.soft_unlock();
|
||||
concurrencyChecker.soft_lock();
|
||||
concurrencyChecker.soft_unlock();
|
||||
}
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftLock_AlreadyLocked_Assert)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
concurrencyChecker.soft_lock();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
concurrencyChecker.soft_lock();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftUnlock_NotAlreadyLocked_Assert)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
concurrencyChecker.soft_lock();
|
||||
concurrencyChecker.soft_unlock();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
concurrencyChecker.soft_unlock();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftLockShared_NoContention_NoAsserts)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
// Multiple shared locks can be made at once,
|
||||
// as long as they are all unlocked before the next soft_lock
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
|
||||
concurrencyChecker.soft_lock();
|
||||
concurrencyChecker.soft_unlock();
|
||||
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
|
||||
concurrencyChecker.soft_lock();
|
||||
concurrencyChecker.soft_unlock();
|
||||
}
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftLockShared_SharedLockAfterSoftLock_Assert)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
|
||||
concurrencyChecker.soft_lock();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
|
||||
TEST_F(AllocatorsTestFixture, SoftUnlockShared_NotAlreadyLocked_Assert)
|
||||
{
|
||||
concurrency_checker concurrencyChecker;
|
||||
concurrencyChecker.soft_lock_shared();
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
AZ_TEST_START_TRACE_SUPPRESSION;
|
||||
concurrencyChecker.soft_unlock_shared();
|
||||
AZ_TEST_STOP_TRACE_SUPPRESSION(1);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
set(FILES
|
||||
ArrayView.cpp
|
||||
ConcurrencyCheckerTests.cpp
|
||||
InstanceDatabase.cpp
|
||||
JsonSerializationUtilsTests.cpp
|
||||
lru_cache.cpp
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a pointer to the beginning of master vector of SmallAllocationGroups.
|
||||
/// Returns a pointer to the beginning of vector of SmallAllocationGroups.
|
||||
SmallAllocationGroup* ArrayHead()
|
||||
{
|
||||
return this - m_index;
|
||||
@@ -169,7 +169,7 @@ namespace AZ
|
||||
return m_marker == MARKER;
|
||||
}
|
||||
|
||||
/// Returns the master index of the SmallAllocationGroup containing this allocation
|
||||
/// Returns the index of the SmallAllocationGroup containing this allocation
|
||||
uint32_t GetSmallAllocationIndex() const
|
||||
{
|
||||
return (uint32_t)(m_data & 0xFFFFFFFF);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace AZ
|
||||
// Afterwards use the AZ::IO::Path Append function append the filename as a child
|
||||
// of the framework directory
|
||||
AZ::IO::FixedMaxPathString fileName{ fullPath.Filename().Native() };
|
||||
fullPath.ReplaceFilename(AZ::IO::PathView((fileName + ".framework").c_str()));
|
||||
fullPath.ReplaceFilename(AZ::IO::PathView(AZStd::string_view(fileName + ".framework")));
|
||||
fullPath /= fileName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace AZ::IO
|
||||
// If used, the source path will be treated as the destination path
|
||||
// and no transformations will be done. Pass this flag when the path is to be the actual
|
||||
// path on the disk/in the packs and doesn't need adjustment (or after it has come through adjustments already)
|
||||
// if this is set, AdjustFileName will not map the input path into the master folder (Ex: Shaders will not be converted to Game\Shaders)
|
||||
// if this is set, AdjustFileName will not map the input path into the folder (Ex: Shaders will not be converted to Game\Shaders)
|
||||
FLAGS_PATH_REAL = 1 << 16,
|
||||
|
||||
// AdjustFileName will always copy the file path to the destination path:
|
||||
@@ -318,7 +318,6 @@ namespace AZ::IO
|
||||
virtual ArchiveFileIterator FindFirst(AZStd::string_view pDir, uint32_t nFlags = 0, bool bAllowUseFileSystem = false) = 0;
|
||||
virtual ArchiveFileIterator FindNext(AZ::IO::ArchiveFileIterator handle) = 0;
|
||||
virtual bool FindClose(AZ::IO::ArchiveFileIterator handle) = 0;
|
||||
// virtual bool IsOutOfDate(const char * szCompiledName, const char * szMasterFile)=0;
|
||||
//returns file modification time
|
||||
virtual IArchive::FileTime GetModificationTime(AZ::IO::HandleType fileHandle) = 0;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace AZ::IO
|
||||
enum EPakFlags
|
||||
{
|
||||
// support for absolute and other complex path specifications -
|
||||
// all paths will be treated relatively to the current directory (normally MasterCD)
|
||||
// all paths will be treated relatively to the current directory
|
||||
FLAGS_ABSOLUTE_PATHS = 1,
|
||||
|
||||
// if this is set, the object will only understand relative to the zip file paths,
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <AzFramework/Physics/Collision/CollisionGroups.h>
|
||||
#include <AzFramework/Physics/Collision/CollisionLayers.h>
|
||||
#include <AzFramework/Physics/Common/PhysicsTypes.h>
|
||||
#include <AzFramework/Physics/Common/PhysicsSimulatedBody.h>
|
||||
#include <AzFramework/Physics/Configuration/SimulatedBodyConfiguration.h>
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace Physics
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
AZStd::string m_name;
|
||||
ShapeConfigurationList m_shapes;
|
||||
AzPhysics::ShapeColliderPairList m_shapes;
|
||||
};
|
||||
|
||||
class CharacterColliderConfiguration
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Physics
|
||||
classElement.RemoveElement(shapesIndex);
|
||||
|
||||
// add a new vector in the new format
|
||||
const int newShapesIndex = classElement.AddElement<ShapeConfigurationList>(context, "shapes");
|
||||
const int newShapesIndex = classElement.AddElement<AzPhysics::ShapeColliderPairList>(context, "shapes");
|
||||
if (newShapesIndex != -1)
|
||||
{
|
||||
AZ::SerializeContext::DataElementNode& newShapesElement = classElement.GetSubElement(newShapesIndex);
|
||||
@@ -65,7 +65,9 @@ namespace Physics
|
||||
// convert the old shapes into the new format and add to the vector
|
||||
for (AZ::SerializeContext::DataElementNode shape : shapesCopy)
|
||||
{
|
||||
const int pairIndex = newShapesElement.AddElementWithData<ShapeConfigurationPair>(context, "element", ShapeConfigurationPair());
|
||||
const int pairIndex = newShapesElement.AddElementWithData<AzPhysics::ShapeColliderPair>(
|
||||
context, "element", AzPhysics::ShapeColliderPair());
|
||||
|
||||
AZ::SerializeContext::DataElementNode& pairElement = newShapesElement.GetSubElement(pairIndex);
|
||||
|
||||
ColliderConfiguration colliderConfig;
|
||||
@@ -131,8 +133,8 @@ namespace Physics
|
||||
AZ::SerializeContext::DataElementNode* baseBaseClass1 = baseClass1->FindSubElement(AZ_CRC("BaseClass1", 0xd4925735));
|
||||
if (baseBaseClass1 && baseBaseClass1->FindSubElementAndGetData<AZStd::string>(AZ_CRC("name", 0x5e237e06), name))
|
||||
{
|
||||
ShapeConfigurationList shapes;
|
||||
if (nodeElement.FindSubElementAndGetData<ShapeConfigurationList>(AZ_CRC("shapes", 0x93dba512), shapes))
|
||||
AzPhysics::ShapeColliderPairList shapes;
|
||||
if (nodeElement.FindSubElementAndGetData<AzPhysics::ShapeColliderPairList>(AZ_CRC("shapes", 0x93dba512), shapes))
|
||||
{
|
||||
CharacterColliderNodeConfiguration newColliderNodeConfig;
|
||||
newColliderNodeConfig.m_name = name;
|
||||
|
||||
@@ -70,7 +70,10 @@ namespace AzPhysics
|
||||
using SimulatedBodyHandleList = AZStd::vector<SimulatedBodyHandle>;
|
||||
|
||||
//! Helper used for pairing the ShapeConfiguration and ColliderConfiguration together which is used when creating a Simulated Body.
|
||||
using ShapeColliderPair = AZStd::pair<Physics::ColliderConfiguration*, Physics::ShapeConfiguration*>;
|
||||
using ShapeColliderPair = AZStd::pair<
|
||||
AZStd::shared_ptr<Physics::ColliderConfiguration>,
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration>>;
|
||||
using ShapeColliderPairList = AZStd::vector<ShapeColliderPair>;
|
||||
|
||||
//! Flags used to specifying which properties of a body to compute.
|
||||
enum class MassComputeFlags : AZ::u8
|
||||
|
||||
@@ -80,9 +80,6 @@ namespace Physics
|
||||
void OnContactOffsetChanged();
|
||||
};
|
||||
|
||||
using ShapeConfigurationPair = AZStd::pair<AZStd::shared_ptr<ColliderConfiguration>, AZStd::shared_ptr<ShapeConfiguration>>;
|
||||
using ShapeConfigurationList = AZStd::vector<ShapeConfigurationPair>;
|
||||
|
||||
struct RayCastRequest;
|
||||
|
||||
class Shape
|
||||
|
||||
@@ -264,12 +264,12 @@ namespace AzFramework
|
||||
// SampleRPC =
|
||||
// {
|
||||
// // Two callbacks can be registered to the NetRPC
|
||||
// // A function to be invoked on the Master - OnMaster
|
||||
// // A function to be invoked on the main server - OnServer
|
||||
// // and a function to be invoked on the Proxy - OnProxy
|
||||
// //
|
||||
// // Every NetRPC needs to have a valid OnMaster function, while OnProxy is optional.
|
||||
// OnMaster = function()
|
||||
// Debug.Log("Function to be invoked on the Master.");
|
||||
// // Every NetRPC needs to have a valid OnServer function, while OnProxy is optional.
|
||||
// OnServer = function()
|
||||
// Debug.Log("Function to be invoked on the server.");
|
||||
// end
|
||||
//
|
||||
// OnProxy = function()
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Neighborhood {
|
||||
//---------------------------------------------------------------------
|
||||
void NeighborReplica::OnReplicaActivate(const GridMate::ReplicaContext& /*rc*/)
|
||||
{
|
||||
// TODO: Should we send the message to ourselves as well (master)?
|
||||
// TODO: Should we send the message to ourselves as well?
|
||||
if (IsProxy())
|
||||
{
|
||||
AZ_Assert(m_persistentName.Get().c_str(), "Received NeighborReplica with missing persistent name!");
|
||||
@@ -52,7 +52,7 @@ namespace Neighborhood {
|
||||
//---------------------------------------------------------------------
|
||||
void NeighborReplica::OnReplicaDeactivate(const GridMate::ReplicaContext& /*rc*/)
|
||||
{
|
||||
// TODO: Should we send the message to ourselves as well (master)?
|
||||
// TODO: Should we send the message to ourselves as well?
|
||||
if (IsProxy())
|
||||
{
|
||||
EBUS_EVENT(NeighborhoodBus, OnNodeLeft, *this);
|
||||
|
||||
@@ -30,7 +30,8 @@ namespace AzFramework
|
||||
AZ_CVAR(float, ed_cameraSystemOrbitDollyScrollSpeed, 0.02f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemOrbitDollyCursorSpeed, 0.01f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemScrollTranslateSpeed, 0.02f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemMaxOrbitDistance, 60.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemMinOrbitDistance, 6.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemMaxOrbitDistance, 50.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemLookSmoothness, 5.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemTranslateSmoothness, 5.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
AZ_CVAR(float, ed_cameraSystemRotateSpeed, 0.005f, nullptr, AZ::ConsoleFunctorFlags::Null, "");
|
||||
@@ -532,20 +533,39 @@ namespace AzFramework
|
||||
|
||||
if (Beginning())
|
||||
{
|
||||
float hit_distance = 0.0f;
|
||||
AZ::Plane::CreateFromNormalAndPoint(AZ::Vector3::CreateAxisZ(), AZ::Vector3::CreateAxisZ(ed_cameraSystemDefaultPlaneHeight))
|
||||
.CastRay(targetCamera.Translation(), targetCamera.Rotation().GetBasisY(), hit_distance);
|
||||
const auto hasLookAt = [&nextCamera, &targetCamera, lookAtFn = m_lookAtFn] {
|
||||
if (lookAtFn)
|
||||
{
|
||||
if (const auto lookAt = lookAtFn())
|
||||
{
|
||||
auto transform = AZ::Transform::CreateLookAt(targetCamera.m_lookAt, *lookAt);
|
||||
nextCamera.m_lookDist = -lookAt->GetDistance(targetCamera.m_lookAt);
|
||||
UpdateCameraFromTransform(nextCamera, transform);
|
||||
|
||||
if (hit_distance > 0.0f)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
if (!hasLookAt)
|
||||
{
|
||||
hit_distance = AZStd::min<float>(hit_distance, ed_cameraSystemMaxOrbitDistance);
|
||||
nextCamera.m_lookDist = -hit_distance;
|
||||
nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * hit_distance;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextCamera.m_lookDist = -ed_cameraSystemMaxOrbitDistance;
|
||||
nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * ed_cameraSystemMaxOrbitDistance;
|
||||
float hit_distance = 0.0f;
|
||||
AZ::Plane::CreateFromNormalAndPoint(AZ::Vector3::CreateAxisZ(), AZ::Vector3::CreateAxisZ(ed_cameraSystemDefaultPlaneHeight))
|
||||
.CastRay(targetCamera.Translation(), targetCamera.Rotation().GetBasisY(), hit_distance);
|
||||
|
||||
if (hit_distance > 0.0f)
|
||||
{
|
||||
hit_distance = AZStd::min<float>(hit_distance, ed_cameraSystemMaxOrbitDistance);
|
||||
nextCamera.m_lookDist = -hit_distance;
|
||||
nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * hit_distance;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextCamera.m_lookDist = -ed_cameraSystemMinOrbitDistance;
|
||||
nextCamera.m_lookAt =
|
||||
targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * ed_cameraSystemMinOrbitDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ namespace AzFramework
|
||||
public:
|
||||
explicit RotateCameraInput(InputChannelId rotateChannelId);
|
||||
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
|
||||
@@ -239,6 +240,7 @@ namespace AzFramework
|
||||
public:
|
||||
PanCameraInput(InputChannelId panChannelId, PanAxesFn panAxesFn);
|
||||
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
|
||||
@@ -279,6 +281,7 @@ namespace AzFramework
|
||||
public:
|
||||
explicit TranslateCameraInput(TranslationAxesFn translationAxesFn);
|
||||
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
void ResetImpl() override;
|
||||
@@ -348,6 +351,7 @@ namespace AzFramework
|
||||
class OrbitDollyScrollCameraInput : public CameraInput
|
||||
{
|
||||
public:
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
};
|
||||
@@ -357,6 +361,7 @@ namespace AzFramework
|
||||
public:
|
||||
explicit OrbitDollyCursorMoveCameraInput(InputChannelId dollyChannelId);
|
||||
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
|
||||
@@ -367,6 +372,7 @@ namespace AzFramework
|
||||
class ScrollTranslationCameraInput : public CameraInput
|
||||
{
|
||||
public:
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
};
|
||||
@@ -374,16 +380,32 @@ namespace AzFramework
|
||||
class OrbitCameraInput : public CameraInput
|
||||
{
|
||||
public:
|
||||
using LookAtFn = AZStd::function<AZStd::optional<AZ::Vector3>()>;
|
||||
|
||||
// CameraInput overrides ...
|
||||
void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override;
|
||||
Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override;
|
||||
bool Exclusive() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool Exclusive() const override;
|
||||
|
||||
Cameras m_orbitCameras;
|
||||
|
||||
//! Override the default behavior for how a look-at point is calculated.
|
||||
void SetLookAtFn(const LookAtFn& lookAtFn);
|
||||
|
||||
private:
|
||||
LookAtFn m_lookAtFn;
|
||||
};
|
||||
|
||||
inline void OrbitCameraInput::SetLookAtFn(const LookAtFn& lookAtFn)
|
||||
{
|
||||
m_lookAtFn = lookAtFn;
|
||||
}
|
||||
|
||||
inline bool OrbitCameraInput::Exclusive() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
struct WindowSize;
|
||||
|
||||
//! Map from a generic InputChannel event to a camera specific InputEvent.
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzQtComponents/Utilities/SelectionProxyModel.h>
|
||||
#include <QAbstractProxyModel>
|
||||
|
||||
namespace AzQtComponents
|
||||
{
|
||||
SelectionProxyModel::SelectionProxyModel(QItemSelectionModel* sourceSelectionModel, QAbstractProxyModel* proxyModel, QObject* parent)
|
||||
: QItemSelectionModel(proxyModel, parent)
|
||||
, m_sourceSelectionModel(sourceSelectionModel)
|
||||
{
|
||||
connect(sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged);
|
||||
connect(sourceSelectionModel, &QItemSelectionModel::currentChanged, this, &SelectionProxyModel::OnSourceSelectionCurrentChanged);
|
||||
connect(proxyModel, &QAbstractItemModel::rowsInserted, this, &SelectionProxyModel::OnProxyModelRowsInserted);
|
||||
connect(this, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnProxySelectionChanged);
|
||||
|
||||
// Find the chain of proxy models
|
||||
QAbstractProxyModel* sourceProxyModel = proxyModel;
|
||||
while (sourceProxyModel)
|
||||
{
|
||||
m_proxyModels.push_back(sourceProxyModel);
|
||||
sourceProxyModel = qobject_cast<QAbstractProxyModel*>(sourceProxyModel->sourceModel());
|
||||
}
|
||||
|
||||
const QItemSelection currentSelection = mapFromSource(m_sourceSelectionModel->selection());
|
||||
QItemSelectionModel::select(currentSelection, QItemSelectionModel::ClearAndSelect);
|
||||
|
||||
const QModelIndex currentModelIndex = mapFromSource(m_sourceSelectionModel->currentIndex());
|
||||
QItemSelectionModel::setCurrentIndex(currentModelIndex, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
|
||||
{
|
||||
const QModelIndex sourcetIndex = mapToSource(index);
|
||||
m_sourceSelectionModel->setCurrentIndex(sourcetIndex, command);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
|
||||
{
|
||||
const QModelIndex sourceIndex = mapToSource(index);
|
||||
m_sourceSelectionModel->select(sourceIndex, command);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command)
|
||||
{
|
||||
const QItemSelection sourceSelection = mapToSource(selection);
|
||||
m_sourceSelectionModel->select(sourceSelection, command);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::clear()
|
||||
{
|
||||
m_sourceSelectionModel->clear();
|
||||
}
|
||||
|
||||
void SelectionProxyModel::reset()
|
||||
{
|
||||
m_sourceSelectionModel->reset();
|
||||
}
|
||||
|
||||
void SelectionProxyModel::clearCurrentIndex()
|
||||
{
|
||||
m_sourceSelectionModel->clearCurrentIndex();
|
||||
}
|
||||
|
||||
void SelectionProxyModel::OnSourceSelectionCurrentChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous)
|
||||
{
|
||||
QModelIndex targetCurrent = mapFromSource(current);
|
||||
QItemSelectionModel::setCurrentIndex(targetCurrent, QItemSelectionModel::NoUpdate);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::OnSourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
|
||||
{
|
||||
QItemSelection targetSelected = mapFromSource(selected);
|
||||
QItemSelection targetDeselected = mapFromSource(deselected);
|
||||
|
||||
QItemSelectionModel::select(targetSelected, QItemSelectionModel::Select);
|
||||
QItemSelectionModel::select(targetDeselected, QItemSelectionModel::Deselect);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::OnProxySelectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
|
||||
{
|
||||
const QItemSelection sourceSelected = mapToSource(selected);
|
||||
const QItemSelection sourceDeselected = mapToSource(deselected);
|
||||
|
||||
// Disconnect from the selectionChanged signal in the source model to prevent recursion. We could also block the signals
|
||||
// of the source selection model, but someone else may be connected to its signals and expect to get an update.
|
||||
disconnect(m_sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged);
|
||||
if (selected.empty() && deselected.empty())
|
||||
{
|
||||
// Force the signal to fire
|
||||
emit m_sourceSelectionModel->selectionChanged({}, {});
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sourceSelectionModel->select(sourceSelected, QItemSelectionModel::Select);
|
||||
m_sourceSelectionModel->select(sourceDeselected, QItemSelectionModel::Deselect);
|
||||
}
|
||||
connect(m_sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged);
|
||||
}
|
||||
|
||||
void SelectionProxyModel::OnProxyModelRowsInserted([[maybe_unused]] const QModelIndex& parent, [[maybe_unused]] int first, [[maybe_unused]] int last)
|
||||
{
|
||||
QModelIndex sourceIndex = m_sourceSelectionModel->currentIndex();
|
||||
QModelIndex targetIndex = mapFromSource(sourceIndex);
|
||||
if (targetIndex != currentIndex())
|
||||
{
|
||||
QItemSelectionModel::setCurrentIndex(targetIndex, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||
}
|
||||
|
||||
QItemSelection sourceSelection = m_sourceSelectionModel->selection();
|
||||
QItemSelection targetSelection = mapFromSource(sourceSelection);
|
||||
if (targetSelection != selection())
|
||||
{
|
||||
QItemSelectionModel::select(targetSelection, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
|
||||
}
|
||||
}
|
||||
|
||||
QModelIndex SelectionProxyModel::mapFromSource(const QModelIndex& sourceIndex)
|
||||
{
|
||||
QModelIndex mappedIndex = sourceIndex;
|
||||
for (QVector<QAbstractProxyModel*>::const_reverse_iterator itProxy = m_proxyModels.rbegin(); itProxy != m_proxyModels.rend(); ++itProxy)
|
||||
{
|
||||
mappedIndex = (*itProxy)->mapFromSource(mappedIndex);
|
||||
}
|
||||
return mappedIndex;
|
||||
}
|
||||
|
||||
QItemSelection SelectionProxyModel::mapFromSource(const QItemSelection& sourceSelection)
|
||||
{
|
||||
QItemSelection mappedSelection = sourceSelection;
|
||||
for (QVector<QAbstractProxyModel*>::const_reverse_iterator itProxy = m_proxyModels.rbegin(); itProxy != m_proxyModels.rend(); ++itProxy)
|
||||
{
|
||||
mappedSelection = (*itProxy)->mapSelectionFromSource(mappedSelection);
|
||||
}
|
||||
return mappedSelection;
|
||||
}
|
||||
|
||||
QModelIndex SelectionProxyModel::mapToSource(const QModelIndex& targetIndex)
|
||||
{
|
||||
QModelIndex mappedIndex = targetIndex;
|
||||
for (QVector<QAbstractProxyModel*>::const_iterator itProxy = m_proxyModels.begin(); itProxy != m_proxyModels.end(); ++itProxy)
|
||||
{
|
||||
mappedIndex = (*itProxy)->mapToSource(mappedIndex);
|
||||
}
|
||||
return mappedIndex;
|
||||
}
|
||||
|
||||
QItemSelection SelectionProxyModel::mapToSource(const QItemSelection& targetSelection)
|
||||
{
|
||||
QItemSelection mappedSelection = targetSelection;
|
||||
for (QVector<QAbstractProxyModel*>::const_iterator itProxy = m_proxyModels.begin(); itProxy != m_proxyModels.end(); ++itProxy)
|
||||
{
|
||||
mappedSelection = (*itProxy)->mapSelectionToSource(mappedSelection);
|
||||
}
|
||||
return mappedSelection;
|
||||
}
|
||||
} // namespace AzQtComponents
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzQtComponents/AzQtComponentsAPI.h>
|
||||
#include <QtCore/QItemSelectionModel>
|
||||
#include <QVector>
|
||||
#endif
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAbstractProxyModel)
|
||||
|
||||
namespace AzQtComponents
|
||||
{
|
||||
//! This class is a QItemSelectionModel that syncs through proxy models and maintains
|
||||
//! selection. In Qt we can have a model being filtered/sorted by proxy models. If the
|
||||
//! selection model is connected to the original model, the view needs a new selection
|
||||
//! model that understands the filtering. This class does that conversion.
|
||||
//! @Note: this class does not support changing proxy models (anywhere in the chain).
|
||||
//! The class will have to be recreated with the new proxy model.
|
||||
class AZ_QT_COMPONENTS_API SelectionProxyModel
|
||||
: public QItemSelectionModel
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
|
||||
public:
|
||||
SelectionProxyModel(QItemSelectionModel* sourceSelectionModel, QAbstractProxyModel* proxyModel, QObject* parent = nullptr);
|
||||
|
||||
void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) override;
|
||||
void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) override;
|
||||
void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) override;
|
||||
void clear() override;
|
||||
void reset() override;
|
||||
void clearCurrentIndex() override;
|
||||
|
||||
private slots:
|
||||
void OnSourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
|
||||
void OnSourceSelectionCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
|
||||
void OnProxySelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
|
||||
void OnProxyModelRowsInserted(const QModelIndex& parent, int first, int last);
|
||||
|
||||
private:
|
||||
QModelIndex mapFromSource(const QModelIndex& sourceIndex);
|
||||
QItemSelection mapFromSource(const QItemSelection& sourceSelection);
|
||||
|
||||
QModelIndex mapToSource(const QModelIndex& targetIndex);
|
||||
QItemSelection mapToSource(const QItemSelection& targetSelection);
|
||||
|
||||
// Contains the chain of proxy models that leads us to the real model. The outer-most proxy model
|
||||
// comes first and is followed by inner proxy models.
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
QVector<QAbstractProxyModel*> m_proxyModels;
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
QItemSelectionModel* m_sourceSelectionModel;
|
||||
};
|
||||
} // namespace AzQtComponents
|
||||
@@ -287,6 +287,8 @@ set(FILES
|
||||
Utilities/ScreenUtilities.cpp
|
||||
Utilities/ScreenGrabber.h
|
||||
Utilities/ScopedCleanup.h
|
||||
Utilities/SelectionProxyModel.cpp
|
||||
Utilities/SelectionProxyModel.h
|
||||
Utilities/TextUtilities.cpp
|
||||
Utilities/TextUtilities.h
|
||||
)
|
||||
|
||||
@@ -296,7 +296,7 @@ DefaultTrafficControl::OnReceived(TrafficControlConnectionId id, DataGramControl
|
||||
if (m_maxRecvPackets != 0)
|
||||
{
|
||||
--cd->m_recvPacketAllowance;
|
||||
if (cd->m_recvPacketAllowance == 0) // hit the limit -> let's blacklist connection
|
||||
if (cd->m_recvPacketAllowance == 0) // hit the limit
|
||||
{
|
||||
cd->m_canReceiveData = false;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <AzToolsFramework/API/ComponentEntityObjectBus.h>
|
||||
#include <AzToolsFramework/Manipulators/ManipulatorManager.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h>
|
||||
|
||||
// AtomToolsFramework
|
||||
#include <AtomToolsFramework/Viewport/RenderViewportWidget.h>
|
||||
@@ -1238,6 +1239,20 @@ void EditorViewportWidget::SetViewportId(int id)
|
||||
auto firstPersonWheelCamera = AZStd::make_shared<AzFramework::ScrollTranslationCameraInput>();
|
||||
|
||||
auto orbitCamera = AZStd::make_shared<AzFramework::OrbitCameraInput>();
|
||||
orbitCamera->SetLookAtFn([]() -> AZStd::optional<AZ::Vector3> {
|
||||
AZStd::optional<AZ::Transform> manipulatorTransform;
|
||||
AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult(
|
||||
manipulatorTransform, AzToolsFramework::GetEntityContextId(),
|
||||
&AzToolsFramework::EditorTransformComponentSelectionRequestBus::Events::GetManipulatorTransform);
|
||||
|
||||
if (manipulatorTransform)
|
||||
{
|
||||
return manipulatorTransform->GetTranslation();
|
||||
}
|
||||
|
||||
return {};
|
||||
});
|
||||
|
||||
auto orbitRotateCamera = AZStd::make_shared<AzFramework::RotateCameraInput>(AzFramework::CameraOrbitLookButton);
|
||||
auto orbitTranslateCamera = AZStd::make_shared<AzFramework::TranslateCameraInput>(AzFramework::OrbitTranslation);
|
||||
auto orbitDollyWheelCamera = AZStd::make_shared<AzFramework::OrbitDollyScrollCameraInput>();
|
||||
|
||||
@@ -11,16 +11,23 @@
|
||||
*/
|
||||
|
||||
#include <NewProjectSettingsScreen.h>
|
||||
#include <PythonBindingsInterface.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QFileDialog>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QRadioButton>
|
||||
#include <QButtonGroup>
|
||||
#include <QPushButton>
|
||||
#include <QSpacerItem>
|
||||
#include <QStandardPaths>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
constexpr const char* k_pathProperty = "Path";
|
||||
|
||||
NewProjectSettingsScreen::NewProjectSettingsScreen(QWidget* parent)
|
||||
: ScreenWidget(parent)
|
||||
{
|
||||
@@ -29,19 +36,27 @@ namespace O3DE::ProjectManager
|
||||
|
||||
QVBoxLayout* vLayout = new QVBoxLayout(this);
|
||||
|
||||
QLabel* projectNameLabel = new QLabel(this);
|
||||
projectNameLabel->setText("Project Name");
|
||||
QLabel* projectNameLabel = new QLabel(tr("Project Name"), this);
|
||||
vLayout->addWidget(projectNameLabel);
|
||||
|
||||
QLineEdit* projectNameLineEdit = new QLineEdit(this);
|
||||
vLayout->addWidget(projectNameLineEdit);
|
||||
m_projectNameLineEdit = new QLineEdit(tr("New Project"), this);
|
||||
vLayout->addWidget(m_projectNameLineEdit);
|
||||
|
||||
QLabel* projectPathLabel = new QLabel(this);
|
||||
projectPathLabel->setText("Project Location");
|
||||
QLabel* projectPathLabel = new QLabel(tr("Project Location"), this);
|
||||
vLayout->addWidget(projectPathLabel);
|
||||
|
||||
QLineEdit* projectPathLineEdit = new QLineEdit(this);
|
||||
vLayout->addWidget(projectPathLineEdit);
|
||||
{
|
||||
QHBoxLayout* projectPathLayout = new QHBoxLayout(this);
|
||||
|
||||
m_projectPathLineEdit = new QLineEdit(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), this);
|
||||
projectPathLayout->addWidget(m_projectPathLineEdit);
|
||||
|
||||
QPushButton* browseButton = new QPushButton(tr("Browse"), this);
|
||||
connect(browseButton, &QPushButton::pressed, this, &NewProjectSettingsScreen::HandleBrowseButton);
|
||||
projectPathLayout->addWidget(browseButton);
|
||||
|
||||
vLayout->addLayout(projectPathLayout);
|
||||
}
|
||||
|
||||
QLabel* projectTemplateLabel = new QLabel(this);
|
||||
projectTemplateLabel->setText("Project Template");
|
||||
@@ -50,14 +65,21 @@ namespace O3DE::ProjectManager
|
||||
QHBoxLayout* templateLayout = new QHBoxLayout(this);
|
||||
vLayout->addItem(templateLayout);
|
||||
|
||||
QRadioButton* projectTemplateStandardRadioButton = new QRadioButton(this);
|
||||
projectTemplateStandardRadioButton->setText("Standard (Recommened)");
|
||||
projectTemplateStandardRadioButton->setChecked(true);
|
||||
templateLayout->addWidget(projectTemplateStandardRadioButton);
|
||||
m_projectTemplateButtonGroup = new QButtonGroup(this);
|
||||
auto templatesResult = PythonBindingsInterface::Get()->GetProjectTemplates();
|
||||
if (templatesResult.IsSuccess() && !templatesResult.GetValue().isEmpty())
|
||||
{
|
||||
for (auto projectTemplate : templatesResult.GetValue())
|
||||
{
|
||||
QRadioButton* radioButton = new QRadioButton(projectTemplate.m_name, this);
|
||||
radioButton->setProperty(k_pathProperty, projectTemplate.m_path);
|
||||
m_projectTemplateButtonGroup->addButton(radioButton);
|
||||
|
||||
QRadioButton* projectTemplateEmptyRadioButton = new QRadioButton(this);
|
||||
projectTemplateEmptyRadioButton->setText("Empty");
|
||||
templateLayout->addWidget(projectTemplateEmptyRadioButton);
|
||||
templateLayout->addWidget(radioButton);
|
||||
}
|
||||
|
||||
m_projectTemplateButtonGroup->buttons().first()->setChecked(true);
|
||||
}
|
||||
|
||||
QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
vLayout->addItem(verticalSpacer);
|
||||
@@ -76,7 +98,57 @@ namespace O3DE::ProjectManager
|
||||
|
||||
QString NewProjectSettingsScreen::GetNextButtonText()
|
||||
{
|
||||
return "Create Project";
|
||||
return tr("Next");
|
||||
}
|
||||
|
||||
void NewProjectSettingsScreen::HandleBrowseButton()
|
||||
{
|
||||
QString defaultPath = m_projectPathLineEdit->text();
|
||||
if (defaultPath.isEmpty())
|
||||
{
|
||||
defaultPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
}
|
||||
|
||||
QString directory = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(this, tr("New project path"), defaultPath));
|
||||
if (!directory.isEmpty())
|
||||
{
|
||||
m_projectPathLineEdit->setText(directory);
|
||||
}
|
||||
}
|
||||
|
||||
ProjectInfo NewProjectSettingsScreen::GetProjectInfo()
|
||||
{
|
||||
ProjectInfo projectInfo;
|
||||
projectInfo.m_projectName = m_projectNameLineEdit->text();
|
||||
projectInfo.m_path = QDir::toNativeSeparators(m_projectPathLineEdit->text() + "/" + projectInfo.m_projectName);
|
||||
return projectInfo;
|
||||
}
|
||||
|
||||
QString NewProjectSettingsScreen::GetProjectTemplatePath()
|
||||
{
|
||||
return m_projectTemplateButtonGroup->checkedButton()->property(k_pathProperty).toString();
|
||||
}
|
||||
|
||||
bool NewProjectSettingsScreen::Validate()
|
||||
{
|
||||
bool projectNameIsValid = true;
|
||||
if (m_projectNameLineEdit->text().isEmpty())
|
||||
{
|
||||
projectNameIsValid = false;
|
||||
}
|
||||
|
||||
bool projectPathIsValid = true;
|
||||
if (m_projectPathLineEdit->text().isEmpty())
|
||||
{
|
||||
projectPathIsValid = false;
|
||||
}
|
||||
|
||||
QDir path(QDir::toNativeSeparators(m_projectPathLineEdit->text() + "/" + m_projectNameLineEdit->text()));
|
||||
if (path.exists() && !path.isEmpty())
|
||||
{
|
||||
projectPathIsValid = false;
|
||||
}
|
||||
|
||||
return projectNameIsValid && projectPathIsValid;
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -13,8 +13,12 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <ScreenWidget.h>
|
||||
#include <ProjectInfo.h>
|
||||
#endif
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QButtonGroup)
|
||||
QT_FORWARD_DECLARE_CLASS(QLineEdit)
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class NewProjectSettingsScreen
|
||||
@@ -25,6 +29,19 @@ namespace O3DE::ProjectManager
|
||||
~NewProjectSettingsScreen() = default;
|
||||
ProjectManagerScreen GetScreenEnum() override;
|
||||
QString GetNextButtonText() override;
|
||||
|
||||
ProjectInfo GetProjectInfo();
|
||||
QString GetProjectTemplatePath();
|
||||
|
||||
bool Validate();
|
||||
|
||||
protected slots:
|
||||
void HandleBrowseButton();
|
||||
|
||||
private:
|
||||
QLineEdit* m_projectNameLineEdit;
|
||||
QLineEdit* m_projectPathLineEdit;
|
||||
QButtonGroup* m_projectTemplateButtonGroup;
|
||||
};
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
ProjectInfo::ProjectInfo(const QString& path, const QString& projectName, const QString& productName, const AZ::Uuid projectId,
|
||||
ProjectInfo::ProjectInfo(const QString& path, const QString& projectName, const QString& displayName,
|
||||
const QString& imagePath, const QString& backgroundImagePath, bool isNew)
|
||||
: m_path(path)
|
||||
, m_projectName(projectName)
|
||||
, m_productName(productName)
|
||||
, m_projectId(projectId)
|
||||
, m_displayName(displayName)
|
||||
, m_imagePath(imagePath)
|
||||
, m_backgroundImagePath(backgroundImagePath)
|
||||
, m_isNew(isNew)
|
||||
@@ -28,6 +27,6 @@ namespace O3DE::ProjectManager
|
||||
|
||||
bool ProjectInfo::IsValid() const
|
||||
{
|
||||
return !m_path.isEmpty() && !m_projectId.IsNull();
|
||||
return !m_path.isEmpty() && !m_projectName.isEmpty();
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
public:
|
||||
ProjectInfo() = default;
|
||||
ProjectInfo(const QString& path, const QString& projectName, const QString& productName, const AZ::Uuid projectId,
|
||||
ProjectInfo(const QString& path, const QString& projectName, const QString& displayName,
|
||||
const QString& imagePath, const QString& backgroundImagePath, bool isNew);
|
||||
|
||||
bool IsValid() const;
|
||||
@@ -33,8 +33,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
// From project.json
|
||||
QString m_projectName;
|
||||
QString m_productName;
|
||||
AZ::Uuid m_projectId;
|
||||
QString m_displayName;
|
||||
|
||||
// Used on projects home screen
|
||||
QString m_imagePath;
|
||||
|
||||
@@ -12,10 +12,13 @@
|
||||
|
||||
#include <ProjectSettingsCtrl.h>
|
||||
#include <ScreensCtrl.h>
|
||||
#include <PythonBindingsInterface.h>
|
||||
#include <NewProjectSettingsScreen.h>
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
@@ -65,7 +68,8 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
void ProjectSettingsCtrl::HandleNextButton()
|
||||
{
|
||||
ProjectManagerScreen screenEnum = m_screensCtrl->GetCurrentScreen()->GetScreenEnum();
|
||||
ScreenWidget* currentScreen = m_screensCtrl->GetCurrentScreen();
|
||||
ProjectManagerScreen screenEnum = currentScreen->GetScreenEnum();
|
||||
auto screenOrderIter = m_screensOrder.begin();
|
||||
for (; screenOrderIter != m_screensOrder.end(); ++screenOrderIter)
|
||||
{
|
||||
@@ -76,6 +80,22 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
}
|
||||
|
||||
if (screenEnum == ProjectManagerScreen::NewProjectSettings)
|
||||
{
|
||||
auto newProjectScreen = reinterpret_cast<NewProjectSettingsScreen*>(currentScreen);
|
||||
if (newProjectScreen)
|
||||
{
|
||||
if (!newProjectScreen->Validate())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Invalid project settings"), tr("Invalid project settings"));
|
||||
return;
|
||||
}
|
||||
|
||||
m_projectInfo = newProjectScreen->GetProjectInfo();
|
||||
m_projectTemplatePath = newProjectScreen->GetProjectTemplatePath();
|
||||
}
|
||||
}
|
||||
|
||||
if (screenOrderIter != m_screensOrder.end())
|
||||
{
|
||||
m_screensCtrl->ChangeToScreen(*screenOrderIter);
|
||||
@@ -83,7 +103,15 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
else
|
||||
{
|
||||
emit ChangeScreenRequest(ProjectManagerScreen::ProjectsHome);
|
||||
auto result = PythonBindingsInterface::Get()->CreateProject(m_projectTemplatePath, m_projectInfo);
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
emit ChangeScreenRequest(ProjectManagerScreen::ProjectsHome);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Project creation failed"), tr("Failed to create project."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "ProjectInfo.h"
|
||||
#include <ScreenWidget.h>
|
||||
|
||||
#include <ScreensCtrl.h>
|
||||
|
||||
#include <QPushButton>
|
||||
#endif
|
||||
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class ProjectSettingsCtrl
|
||||
@@ -40,6 +40,9 @@ namespace O3DE::ProjectManager
|
||||
QPushButton* m_backButton;
|
||||
QPushButton* m_nextButton;
|
||||
QVector<ProjectManagerScreen> m_screensOrder;
|
||||
|
||||
QString m_projectTemplatePath;
|
||||
ProjectInfo m_projectInfo;
|
||||
};
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -53,6 +53,173 @@ namespace Platform
|
||||
#define Py_To_String(obj) obj.cast<std::string>().c_str()
|
||||
#define Py_To_String_Optional(dict, key, default_string) dict.contains(key) ? Py_To_String(dict[key]) : default_string
|
||||
|
||||
namespace RedirectOutput
|
||||
{
|
||||
using RedirectOutputFunc = AZStd::function<void(const char*)>;
|
||||
|
||||
struct RedirectOutput
|
||||
{
|
||||
PyObject_HEAD RedirectOutputFunc write;
|
||||
};
|
||||
|
||||
PyObject* RedirectWrite(PyObject* self, PyObject* args)
|
||||
{
|
||||
std::size_t written(0);
|
||||
RedirectOutput* selfimpl = reinterpret_cast<RedirectOutput*>(self);
|
||||
if (selfimpl->write)
|
||||
{
|
||||
char* data;
|
||||
if (!PyArg_ParseTuple(args, "s", &data))
|
||||
{
|
||||
return PyLong_FromSize_t(0);
|
||||
}
|
||||
selfimpl->write(data);
|
||||
written = strlen(data);
|
||||
}
|
||||
return PyLong_FromSize_t(written);
|
||||
}
|
||||
|
||||
PyObject* RedirectFlush([[maybe_unused]] PyObject* self,[[maybe_unused]] PyObject* args)
|
||||
{
|
||||
// no-op
|
||||
return Py_BuildValue("");
|
||||
}
|
||||
|
||||
PyMethodDef RedirectMethods[] = {
|
||||
{"write", RedirectWrite, METH_VARARGS, "sys.stdout.write"},
|
||||
{"flush", RedirectFlush, METH_VARARGS, "sys.stdout.flush"},
|
||||
{"write", RedirectWrite, METH_VARARGS, "sys.stderr.write"},
|
||||
{"flush", RedirectFlush, METH_VARARGS, "sys.stderr.flush"},
|
||||
{0, 0, 0, 0} // sentinel
|
||||
};
|
||||
|
||||
PyTypeObject RedirectOutputType = {
|
||||
PyVarObject_HEAD_INIT(0, 0) "azlmbr_redirect.RedirectOutputType", // tp_name
|
||||
sizeof(RedirectOutput), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
"azlmbr_redirect objects", /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
RedirectMethods, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
0, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
0, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
0 /* tp_new */
|
||||
};
|
||||
|
||||
PyModuleDef RedirectOutputModule = {
|
||||
PyModuleDef_HEAD_INIT, "azlmbr_redirect", 0, -1, 0,
|
||||
};
|
||||
|
||||
// Internal state
|
||||
PyObject* g_redirect_stdout = nullptr;
|
||||
PyObject* g_redirect_stdout_saved = nullptr;
|
||||
PyObject* g_redirect_stderr = nullptr;
|
||||
PyObject* g_redirect_stderr_saved = nullptr;
|
||||
|
||||
PyMODINIT_FUNC PyInit_RedirectOutput(void)
|
||||
{
|
||||
g_redirect_stdout = nullptr;
|
||||
g_redirect_stdout_saved = nullptr;
|
||||
g_redirect_stderr = nullptr;
|
||||
g_redirect_stderr_saved = nullptr;
|
||||
|
||||
RedirectOutputType.tp_new = PyType_GenericNew;
|
||||
if (PyType_Ready(&RedirectOutputType) < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* redirectModule = PyModule_Create(&RedirectOutputModule);
|
||||
if (redirectModule)
|
||||
{
|
||||
Py_INCREF(&RedirectOutputType);
|
||||
PyModule_AddObject(redirectModule, "Redirect", reinterpret_cast<PyObject*>(&RedirectOutputType));
|
||||
}
|
||||
return redirectModule;
|
||||
}
|
||||
|
||||
void SetRedirection(const char* funcname, PyObject*& saved, PyObject*& current, RedirectOutputFunc func)
|
||||
{
|
||||
if (PyType_Ready(&RedirectOutputType) < 0)
|
||||
{
|
||||
AZ_Warning("python", false, "RedirectOutputType not ready!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!current)
|
||||
{
|
||||
saved = PySys_GetObject(funcname); // borrowed
|
||||
current = RedirectOutputType.tp_new(&RedirectOutputType, 0, 0);
|
||||
}
|
||||
|
||||
RedirectOutput* redirectOutput = reinterpret_cast<RedirectOutput*>(current);
|
||||
redirectOutput->write = func;
|
||||
PySys_SetObject(funcname, current);
|
||||
}
|
||||
|
||||
void ResetRedirection(const char* funcname, PyObject*& saved, PyObject*& current)
|
||||
{
|
||||
if (current)
|
||||
{
|
||||
PySys_SetObject(funcname, saved);
|
||||
}
|
||||
Py_XDECREF(current);
|
||||
current = nullptr;
|
||||
}
|
||||
|
||||
PyObject* s_RedirectModule = nullptr;
|
||||
|
||||
void Intialize(PyObject* module)
|
||||
{
|
||||
s_RedirectModule = module;
|
||||
|
||||
SetRedirection("stdout", g_redirect_stdout_saved, g_redirect_stdout, []([[maybe_unused]] const char* msg) {
|
||||
AZ_TracePrintf("Python", msg);
|
||||
});
|
||||
|
||||
SetRedirection("stderr", g_redirect_stderr_saved, g_redirect_stderr, []([[maybe_unused]] const char* msg) {
|
||||
AZ_TracePrintf("Python", msg);
|
||||
});
|
||||
|
||||
PySys_WriteStdout("RedirectOutput installed");
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
ResetRedirection("stdout", g_redirect_stdout_saved, g_redirect_stdout);
|
||||
ResetRedirection("stderr", g_redirect_stderr_saved, g_redirect_stderr);
|
||||
Py_XDECREF(s_RedirectModule);
|
||||
s_RedirectModule = nullptr;
|
||||
}
|
||||
} // namespace RedirectOutput
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
PythonBindings::PythonBindings(const AZ::IO::PathView& enginePath)
|
||||
@@ -92,6 +259,8 @@ namespace O3DE::ProjectManager
|
||||
AZ_TracePrintf("python", "Py_GetExecPrefix=%ls \n", Py_GetExecPrefix());
|
||||
AZ_TracePrintf("python", "Py_GetProgramFullPath=%ls \n", Py_GetProgramFullPath());
|
||||
|
||||
PyImport_AppendInittab("azlmbr_redirect", RedirectOutput::PyInit_RedirectOutput);
|
||||
|
||||
try
|
||||
{
|
||||
// ignore system location for sites site-packages
|
||||
@@ -101,6 +270,8 @@ namespace O3DE::ProjectManager
|
||||
const bool initializeSignalHandlers = true;
|
||||
pybind11::initialize_interpreter(initializeSignalHandlers);
|
||||
|
||||
RedirectOutput::Intialize(PyImport_ImportModule("azlmbr_redirect"));
|
||||
|
||||
// Acquire GIL before calling Python code
|
||||
AZStd::lock_guard<decltype(m_lock)> lock(m_lock);
|
||||
pybind11::gil_scoped_acquire acquire;
|
||||
@@ -113,6 +284,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
// import required modules
|
||||
m_registration = pybind11::module::import("cmake.Tools.registration");
|
||||
m_engineTemplate = pybind11::module::import("cmake.Tools.engine_template");
|
||||
|
||||
return result == 0 && !PyErr_Occurred();
|
||||
} catch ([[maybe_unused]] const std::exception& e)
|
||||
@@ -126,6 +298,7 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
if (Py_IsInitialized())
|
||||
{
|
||||
RedirectOutput::Shutdown();
|
||||
pybind11::finalize_interpreter();
|
||||
}
|
||||
else
|
||||
@@ -204,9 +377,28 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Outcome<ProjectInfo> PythonBindings::CreateProject([[maybe_unused]] const ProjectTemplateInfo& projectTemplate,[[maybe_unused]] const ProjectInfo& projectInfo)
|
||||
AZ::Outcome<ProjectInfo> PythonBindings::CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo)
|
||||
{
|
||||
return AZ::Failure();
|
||||
ProjectInfo createdProjectInfo;
|
||||
bool result = ExecuteWithLock([&] {
|
||||
|
||||
pybind11::str projectPath = projectInfo.m_path.toStdString();
|
||||
pybind11::str templatePath = projectTemplatePath.toStdString();
|
||||
auto createProjectResult = m_engineTemplate.attr("create_project")(projectPath, templatePath);
|
||||
if (createProjectResult.cast<int>() == 0)
|
||||
{
|
||||
createdProjectInfo = ProjectInfoFromPath(projectPath);
|
||||
}
|
||||
});
|
||||
|
||||
if (!result || !createdProjectInfo.IsValid())
|
||||
{
|
||||
return AZ::Failure();
|
||||
}
|
||||
else
|
||||
{
|
||||
return AZ::Success(AZStd::move(createdProjectInfo));
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Outcome<ProjectInfo> PythonBindings::GetProject(const QString& path)
|
||||
@@ -275,10 +467,8 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
try
|
||||
{
|
||||
// required fields
|
||||
projectInfo.m_productName = Py_To_String(projectData["product_name"]);
|
||||
projectInfo.m_projectName = Py_To_String(projectData["project_name"]);
|
||||
projectInfo.m_projectId = AZ::Uuid(Py_To_String(projectData["project_id"]));
|
||||
projectInfo.m_displayName = Py_To_String_Optional(projectData,"display_name", projectInfo.m_projectName);
|
||||
}
|
||||
catch ([[maybe_unused]] const std::exception& e)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace O3DE::ProjectManager
|
||||
AZ::Outcome<QVector<GemInfo>> GetGems() override;
|
||||
|
||||
// Project
|
||||
AZ::Outcome<ProjectInfo> CreateProject(const ProjectTemplateInfo& projectTemplate, const ProjectInfo& projectInfo) override;
|
||||
AZ::Outcome<ProjectInfo> CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo) override;
|
||||
AZ::Outcome<ProjectInfo> GetProject(const QString& path) override;
|
||||
AZ::Outcome<QVector<ProjectInfo>> GetProjects() override;
|
||||
bool UpdateProject(const ProjectInfo& projectInfo) override;
|
||||
@@ -62,6 +62,7 @@ namespace O3DE::ProjectManager
|
||||
bool StopPython();
|
||||
|
||||
AZ::IO::FixedMaxPath m_enginePath;
|
||||
pybind11::handle m_engineTemplate;
|
||||
AZStd::recursive_mutex m_lock;
|
||||
pybind11::handle m_registration;
|
||||
};
|
||||
|
||||
@@ -70,11 +70,11 @@ namespace O3DE::ProjectManager
|
||||
|
||||
/**
|
||||
* Create a project
|
||||
* @param projectTemplate the project template to use
|
||||
* @param projectTemplatePath the path to the project template to use
|
||||
* @param projectInfo the project info to use
|
||||
* @return an outcome with ProjectInfo on success
|
||||
*/
|
||||
virtual AZ::Outcome<ProjectInfo> CreateProject(const ProjectTemplateInfo& projectTemplate, const ProjectInfo& projectInfo) = 0;
|
||||
virtual AZ::Outcome<ProjectInfo> CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo) = 0;
|
||||
|
||||
/**
|
||||
* Get info about a project
|
||||
|
||||
@@ -173,8 +173,7 @@ namespace AZ
|
||||
return false;
|
||||
}
|
||||
|
||||
const SliceComponent::SliceList& sliceList = sliceComponent->GetSlices();
|
||||
AZ_Warning("Convert-Slice", sliceList.empty(), " Slice depends on other slices, this conversion will lose data.\n");
|
||||
AZ_Warning("Convert-Slice", sliceComponent->GetSlices().empty(), " Slice depends on other slices, this conversion will lose data.\n");
|
||||
|
||||
// Create the Prefab with the entities from the slice
|
||||
AZStd::unique_ptr<AzToolsFramework::Prefab::Instance> sourceInstance(
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DRILLER_WORKSPACE_SETTINGS_MASTER_H
|
||||
#define DRILLER_WORKSPACE_SETTINGS_MASTER_H
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
@@ -77,7 +76,3 @@ namespace Driller
|
||||
SavedWorkspaceMap m_WorkspaceSaveData;
|
||||
};
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#endif // DRILLER_WORKSPACE_SETTINGS_MASTER_H
|
||||
|
||||
@@ -81,12 +81,12 @@ namespace AssetMemoryAnalyzer
|
||||
using AssetTree = AZ::Debug::AssetTree<Data::AssetData>;
|
||||
using AssetTreeNode = typename AssetTree::NodeType;
|
||||
using AllocationTable = AZ::Debug::AllocationTable<Data::AllocationData>;
|
||||
using MasterCodePoints = AZStd::unordered_set<Data::CodePoint, AZStd::hash<Data::CodePoint>, AZStd::equal_to<Data::CodePoint>, AZ::Debug::AZStdAssetTrackingAllocator>;
|
||||
using CodePoints = AZStd::unordered_set<Data::CodePoint, AZStd::hash<Data::CodePoint>, AZStd::equal_to<Data::CodePoint>, AZ::Debug::AZStdAssetTrackingAllocator>;
|
||||
using mutex_type = AZStd::mutex;
|
||||
using lock_type = AZStd::lock_guard<mutex_type>;
|
||||
|
||||
mutex_type m_mutex;
|
||||
MasterCodePoints m_masterCodePoints;
|
||||
CodePoints m_codePoints;
|
||||
AssetTree m_assetTree;
|
||||
AllocationTable m_allocationTable;
|
||||
AZ::Debug::AssetTracking m_assetTracking;
|
||||
@@ -195,7 +195,7 @@ namespace AssetMemoryAnalyzer
|
||||
{
|
||||
// Store a record for this allocation, at this code-point
|
||||
lock_type lock(m_mutex);
|
||||
auto insertResult = m_masterCodePoints.emplace(Data::CodePoint{ fileName ? fileName : "<unknown>", lineNum, category });
|
||||
auto insertResult = m_codePoints.emplace(Data::CodePoint{ fileName ? fileName : "<unknown>", lineNum, category });
|
||||
Data::CodePoint* cp = &*insertResult.first;
|
||||
m_allocationTable.Get().emplace(address, AllocationTable::RecordType{ activeAsset, (uint32_t)byteSize, Data::AllocationData{ cp, categoryInfo } });
|
||||
static_cast<typename AssetTree::NodeType*>(activeAsset)->m_data.m_totalAllocations[(int)category]++;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
//
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
#define Depth_to_Z(d, unprojectZ) (unprojectZ.x / (d + unprojectZ.y))
|
||||
#define DepthBufferToViewSpace(d, unprojectZ) (unprojectZ.x / (d + unprojectZ.y))
|
||||
|
||||
|
||||
#define NVLC_MAX_POSSIBLE_LIGHTS_PER_BIN 256
|
||||
@@ -187,7 +187,7 @@ float4 RemapZToUnit(float4 z, float2 minmaxz)
|
||||
|
||||
uint DepthSamplesToBinMask2x(float2 d, float2 minmaxz, float2 unprojectZ)
|
||||
{
|
||||
float2 z = Depth_to_Z(d, unprojectZ);
|
||||
float2 z = DepthBufferToViewSpace(d, unprojectZ);
|
||||
|
||||
// Tile_UnitValueToBit will convert that 0 to 1 value into 0.0 to 31.99999
|
||||
float2 bit = Tile_UnitValueToBit(RemapZToUnit(z, minmaxz));
|
||||
@@ -207,7 +207,7 @@ uint DepthSamplesToBinMask2x(float2 d, float2 minmaxz, float2 unprojectZ)
|
||||
|
||||
uint DepthSamplesToBinMask4x(float4 d, float2 minmaxz, float2 unprojectZ)
|
||||
{
|
||||
float4 z = Depth_to_Z(d, unprojectZ);
|
||||
float4 z = DepthBufferToViewSpace(d, unprojectZ);
|
||||
|
||||
// Tile_UnitValueToBit will convert that 0 to 1 value into 0.0 to 31.99999
|
||||
float4 bit = Tile_UnitValueToBit(RemapZToUnit(z, minmaxz));
|
||||
|
||||
@@ -150,7 +150,7 @@ uint ComputeTransparentBitMask(float2 minmaxZ)
|
||||
return 0;
|
||||
}
|
||||
|
||||
float2 minmaxZ_transparent = Depth_to_Z(minmaxDepth_transparent, PassSrg::m_constantData.m_unprojectZ);
|
||||
float2 minmaxZ_transparent = DepthBufferToViewSpace(minmaxDepth_transparent, PassSrg::m_constantData.m_unprojectZ);
|
||||
|
||||
float2 minmaxUnit_transparent = RemapZToUnit(minmaxZ_transparent, minmaxZ);
|
||||
|
||||
@@ -295,7 +295,7 @@ void MainCS(
|
||||
float2 minmaxDepth_opaque = ComputeDepthMinMaxFrom2Samples(opaqueDepthSamples);
|
||||
minmaxDepth_both = ExpandMinMax(minmaxDepth_opaque, minmaxDepth_transparent);
|
||||
UpdateMinMaxFromAllThreads(minmaxDepth_both, minmaxDepth_transparent, isPixelOnScreen);
|
||||
minmaxDepth_both = Depth_to_Z(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ);
|
||||
minmaxDepth_both = DepthBufferToViewSpace(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ);
|
||||
|
||||
// if zNear == zFar we want to map z == zNear to 0-bit, so we have to keep zNear without modifications
|
||||
minmaxDepth_both.y = IncrementULP(minmaxDepth_both.y);
|
||||
@@ -313,7 +313,7 @@ void MainCS(
|
||||
float2 minmaxDepth_opaque = ComputeDepthMinMaxFrom4Samples(opaqueDepthSamples);
|
||||
minmaxDepth_both = ExpandMinMax(minmaxDepth_opaque, minmaxDepth_transparent);
|
||||
UpdateMinMaxFromAllThreads(minmaxDepth_both, minmaxDepth_transparent, isPixelOnScreen);
|
||||
minmaxDepth_both = Depth_to_Z(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ);
|
||||
minmaxDepth_both = DepthBufferToViewSpace(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ);
|
||||
|
||||
// if zNear == zFar we want to map z == zNear to 0-bit, so we have to keep zNear without modifications
|
||||
minmaxDepth_both.y = IncrementULP(minmaxDepth_both.y);
|
||||
|
||||
+1
@@ -53,6 +53,7 @@ namespace AZ
|
||||
void SetBufferViewsOnShaderResourceGroup(const Data::Instance<RPI::ShaderResourceGroup>& perInstanceSRG);
|
||||
private:
|
||||
RHI::Ptr<RHI::BufferView> m_vertexDeltaBufferView;
|
||||
Data::Instance<RPI::Buffer> m_vertexDeltaBuffer;
|
||||
};
|
||||
|
||||
struct MorphTargetMetaData
|
||||
|
||||
@@ -30,16 +30,18 @@ namespace AZ
|
||||
{
|
||||
MorphTargetInputBuffers::MorphTargetInputBuffers(const RPI::BufferAssetView& bufferAssetView, const AZStd::string& bufferNamePrefix)
|
||||
{
|
||||
auto buffer = RPI::Buffer::FindOrCreate(bufferAssetView.GetBufferAsset());
|
||||
|
||||
AZ::RHI::Ptr<AZ::RHI::BufferView> bufferView = RHI::Factory::Get().CreateBufferView();
|
||||
m_vertexDeltaBuffer = RPI::Buffer::FindOrCreate(bufferAssetView.GetBufferAsset());
|
||||
if (m_vertexDeltaBuffer)
|
||||
{
|
||||
bufferView->SetName(Name(bufferNamePrefix + "MorphTargetVertexDeltaView"));
|
||||
[[maybe_unused]] RHI::ResultCode resultCode = bufferView->Init(*buffer->GetRHIBuffer(), bufferAssetView.GetBufferViewDescriptor());
|
||||
AZ_Error("MorphTargetInputBuffers", resultCode == RHI::ResultCode::Success, "Failed to initialize buffer view for morph target.");
|
||||
}
|
||||
AZ::RHI::Ptr<AZ::RHI::BufferView> bufferView = RHI::Factory::Get().CreateBufferView();
|
||||
{
|
||||
bufferView->SetName(Name(bufferNamePrefix + "MorphTargetVertexDeltaView"));
|
||||
[[maybe_unused]] RHI::ResultCode resultCode = bufferView->Init(*m_vertexDeltaBuffer->GetRHIBuffer(), bufferAssetView.GetBufferViewDescriptor());
|
||||
AZ_Error("MorphTargetInputBuffers", resultCode == RHI::ResultCode::Success, "Failed to initialize buffer view for morph target.");
|
||||
}
|
||||
|
||||
m_vertexDeltaBufferView = bufferView;
|
||||
m_vertexDeltaBufferView = bufferView;
|
||||
}
|
||||
}
|
||||
|
||||
void MorphTargetInputBuffers::SetBufferViewsOnShaderResourceGroup(const Data::Instance<RPI::ShaderResourceGroup>& perInstanceSRG)
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ namespace AZ
|
||||
bool m_enableShadow = false;
|
||||
ShadowmapSize m_shadowmapMaxSize = ShadowmapSize::Size256;
|
||||
ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None;
|
||||
PcfMethod m_pcfMethod = PcfMethod::BoundarySearch;
|
||||
PcfMethod m_pcfMethod = PcfMethod::Bicubic;
|
||||
float m_boundaryWidthInDegrees = 0.25f;
|
||||
uint16_t m_predictionSampleCount = 4;
|
||||
uint16_t m_filteringSampleCount = 12;
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ namespace AZ
|
||||
float m_shadowFarClipDistance = 100.f;
|
||||
|
||||
//! Width/Height of shadowmap images.
|
||||
ShadowmapSize m_shadowmapSize = MaxShadowmapImageSize;
|
||||
ShadowmapSize m_shadowmapSize = ShadowmapSize::Size1024;
|
||||
|
||||
//! Number of cascades.
|
||||
uint32_t m_cascadeCount = 4;
|
||||
@@ -117,7 +117,7 @@ namespace AZ
|
||||
//! It is used only when the pixel is predicted as on the boundary.
|
||||
uint16_t m_filteringSampleCount = 32;
|
||||
|
||||
PcfMethod m_pcfMethod = PcfMethod::BoundarySearch;
|
||||
PcfMethod m_pcfMethod = PcfMethod::Bicubic;
|
||||
|
||||
bool IsSplitManual() const;
|
||||
bool IsSplitAutomatic() const;
|
||||
|
||||
+3
-3
@@ -173,10 +173,10 @@ namespace AZ
|
||||
->DataElement(
|
||||
Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_pcfMethod, "Pcf method",
|
||||
"Type of PCF to use.\n"
|
||||
" Boundary search: do several taps to first determine if we are on a shadow boundary\n"
|
||||
" Bicubic: a smooth, fixed-size kernel \n")
|
||||
->EnumAttribute(PcfMethod::BoundarySearch, "Boundary search")
|
||||
" Bicubic: a smooth, fixed-size kernel \n"
|
||||
" Boundary search: do several taps to first determine if we are on a shadow boundary\n")
|
||||
->EnumAttribute(PcfMethod::Bicubic, "Bicubic")
|
||||
->EnumAttribute(PcfMethod::BoundarySearch, "Boundary search")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows)
|
||||
->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled);
|
||||
|
||||
+3
-3
@@ -163,10 +163,10 @@ namespace AZ
|
||||
->DataElement(
|
||||
Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_pcfMethod, "Pcf Method",
|
||||
"Type of Pcf to use.\n"
|
||||
" Boundary search: do several taps to first determine if we are on a shadow boundary\n"
|
||||
" Bicubic: a smooth, fixed-size kernel \n")
|
||||
->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search")
|
||||
" Bicubic: a smooth, fixed-size kernel \n"
|
||||
" Boundary search: do several taps to first determine if we are on a shadow boundary\n")
|
||||
->EnumAttribute(PcfMethod::Bicubic, "Bicubic")
|
||||
->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search")
|
||||
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
|
||||
->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled);
|
||||
;
|
||||
|
||||
@@ -500,7 +500,16 @@ namespace AZ
|
||||
skinnedMeshLod.SetIndexBufferAsset(mesh0.GetIndexBufferAssetView().GetBufferAsset());
|
||||
skinnedMeshLod.SetStaticBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "UV" })->GetBufferAsset(), SkinnedMeshStaticVertexStreams::UV_0);
|
||||
|
||||
const RPI::BufferAssetView* morphBufferAssetView = mesh0.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" });
|
||||
const RPI::BufferAssetView* morphBufferAssetView = nullptr;
|
||||
for (const auto& mesh : modelLodAsset->GetMeshes())
|
||||
{
|
||||
morphBufferAssetView = mesh.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" });
|
||||
if (morphBufferAssetView)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (morphBufferAssetView)
|
||||
{
|
||||
ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), lodIndex, fullFileName, skinnedMeshLod);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Blast
|
||||
PhysX::ColliderComponentRequestBus::Handler::BusDisconnect(m_entityId);
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationList ShapesProvider::GetShapeConfigurations()
|
||||
AzPhysics::ShapeColliderPairList ShapesProvider::GetShapeConfigurations()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Blast
|
||||
void AddShape(AZStd::shared_ptr<Physics::Shape> shape);
|
||||
|
||||
// This class is not supposed to provide shape configurations, only shapes themselves.
|
||||
Physics::ShapeConfigurationList GetShapeConfigurations() override;
|
||||
AzPhysics::ShapeColliderPairList GetShapeConfigurations() override;
|
||||
|
||||
AZStd::vector<AZStd::shared_ptr<Physics::Shape>> GetShapes() override;
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace EMotionFX
|
||||
return false;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationPair newCollider;
|
||||
AzPhysics::ShapeColliderPair newCollider;
|
||||
|
||||
// Either in case the contents got specified via a command parameter or in case of redo.
|
||||
if (m_contents)
|
||||
@@ -263,7 +263,7 @@ namespace EMotionFX
|
||||
else if (m_colliderType)
|
||||
{
|
||||
// Create new collider.
|
||||
AZ::Outcome<Physics::ShapeConfigurationPair> colliderOutcome = PhysicsSetup::CreateColliderByType(m_colliderType.value(), outResult);
|
||||
AZ::Outcome<AzPhysics::ShapeColliderPair> colliderOutcome = PhysicsSetup::CreateColliderByType(m_colliderType.value(), outResult);
|
||||
if (!colliderOutcome.IsSuccess())
|
||||
{
|
||||
return false;
|
||||
@@ -367,7 +367,7 @@ namespace EMotionFX
|
||||
return false;
|
||||
}
|
||||
|
||||
const Physics::ShapeConfigurationPair& collider = nodeConfig->m_shapes[m_oldColliderIndex.value()];
|
||||
const AzPhysics::ShapeColliderPair& collider = nodeConfig->m_shapes[m_oldColliderIndex.value()];
|
||||
m_contents = MCore::ReflectionSerializer::Serialize(&collider).GetValue();
|
||||
|
||||
CommandColliderHelpers::RemoveCollider(m_actorId, m_jointName, m_configType, m_oldColliderIndex.value(), /*commandGroup*/ nullptr, true);
|
||||
@@ -472,7 +472,7 @@ namespace EMotionFX
|
||||
AZ_UNUSED(parameters);
|
||||
|
||||
Actor* actor = nullptr;
|
||||
Physics::ShapeConfigurationPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult);
|
||||
AzPhysics::ShapeColliderPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult);
|
||||
if (!shapeConfigPair)
|
||||
{
|
||||
return false;
|
||||
@@ -524,7 +524,7 @@ namespace EMotionFX
|
||||
AZ_UNUSED(parameters);
|
||||
|
||||
Actor* actor = nullptr;
|
||||
Physics::ShapeConfigurationPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult);
|
||||
AzPhysics::ShapeColliderPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult);
|
||||
if (!shapeConfigPair)
|
||||
{
|
||||
return false;
|
||||
@@ -606,7 +606,7 @@ namespace EMotionFX
|
||||
return true;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationPair* CommandAdjustCollider::GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const
|
||||
AzPhysics::ShapeColliderPair* CommandAdjustCollider::GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const
|
||||
{
|
||||
Actor* actor = GetActor(this, outResult);
|
||||
if (!actor)
|
||||
@@ -647,7 +647,7 @@ namespace EMotionFX
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationPair& shapeConfigPair = nodeConfig->m_shapes[m_index.value()];
|
||||
AzPhysics::ShapeColliderPair& shapeConfigPair = nodeConfig->m_shapes[m_index.value()];
|
||||
return &shapeConfigPair;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace EMotionFX
|
||||
static const char* s_commandName;
|
||||
|
||||
private:
|
||||
Physics::ShapeConfigurationPair* GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const;
|
||||
AzPhysics::ShapeColliderPair* GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const;
|
||||
|
||||
AZStd::optional<PhysicsSetup::ColliderConfigType> m_configType;
|
||||
AZStd::optional<size_t> m_index;
|
||||
|
||||
@@ -198,13 +198,13 @@ namespace EMotionFX
|
||||
return m_config.m_simulatedObjectColliderConfig;
|
||||
}
|
||||
|
||||
AZ::Outcome<Physics::ShapeConfigurationPair> PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId)
|
||||
AZ::Outcome<AzPhysics::ShapeColliderPair> PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId)
|
||||
{
|
||||
AZStd::string outResult;
|
||||
return CreateColliderByType(typeId, outResult);
|
||||
}
|
||||
|
||||
AZ::Outcome<Physics::ShapeConfigurationPair> PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult)
|
||||
AZ::Outcome<AzPhysics::ShapeColliderPair> PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult)
|
||||
{
|
||||
if (typeId.IsNull())
|
||||
{
|
||||
@@ -227,14 +227,16 @@ namespace EMotionFX
|
||||
return AZ::Failure();
|
||||
}
|
||||
|
||||
Physics::ShapeConfiguration* shapeConfig = reinterpret_cast<Physics::ShapeConfiguration*>(classData->m_factory->Create(classData->m_name));
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration> shapeConfig(
|
||||
reinterpret_cast<Physics::ShapeConfiguration*>(classData->m_factory->Create(classData->m_name)));
|
||||
|
||||
if (!shapeConfig)
|
||||
{
|
||||
outResult = AZStd::string::format("Could not create collider with type '%s'.", typeId.ToString<AZStd::string>().c_str());
|
||||
return AZ::Failure();
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationPair pair(AZStd::make_shared<Physics::ColliderConfiguration>(), shapeConfig);
|
||||
AzPhysics::ShapeColliderPair pair(AZStd::make_shared<Physics::ColliderConfiguration>(), shapeConfig);
|
||||
if (pair.first->m_materialSelection.GetMaterialIdsAssignedToSlots().empty())
|
||||
{
|
||||
pair.first->m_materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray());
|
||||
@@ -242,7 +244,7 @@ namespace EMotionFX
|
||||
return AZ::Success(pair);
|
||||
}
|
||||
|
||||
void PhysicsSetup::AutoSizeCollider(Physics::ShapeConfigurationPair& collider, const Actor* actor, const Node* joint)
|
||||
void PhysicsSetup::AutoSizeCollider(AzPhysics::ShapeColliderPair& collider, const Actor* actor, const Node* joint)
|
||||
{
|
||||
if (!collider.second || !actor || !joint)
|
||||
{
|
||||
@@ -417,7 +419,7 @@ namespace EMotionFX
|
||||
nodeConfig = &hitDetectionConfig.m_nodes.back();
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationList& collisionShapes = nodeConfig->m_shapes;
|
||||
AzPhysics::ShapeColliderPairList& collisionShapes = nodeConfig->m_shapes;
|
||||
|
||||
Physics::ColliderConfiguration* colliderConfig = aznew Physics::ColliderConfiguration();
|
||||
colliderConfig->m_position = position;
|
||||
|
||||
@@ -68,9 +68,9 @@ namespace EMotionFX
|
||||
|
||||
void OptimizeForServer();
|
||||
|
||||
static AZ::Outcome<Physics::ShapeConfigurationPair> CreateColliderByType(const AZ::TypeId& typeId);
|
||||
static AZ::Outcome<Physics::ShapeConfigurationPair> CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult);
|
||||
static void AutoSizeCollider(Physics::ShapeConfigurationPair& collider, const Actor* actor, const Node* node);
|
||||
static AZ::Outcome<AzPhysics::ShapeColliderPair> CreateColliderByType(const AZ::TypeId& typeId);
|
||||
static AZ::Outcome<AzPhysics::ShapeColliderPair> CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult);
|
||||
static void AutoSizeCollider(AzPhysics::ShapeColliderPair& collider, const Actor* actor, const Node* node);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace EMotionFX
|
||||
m_collisionObjects.reserve(3);
|
||||
}
|
||||
|
||||
void SpringSolver::CreateCollider(AZ::u32 skeletonJointIndex, const Physics::ShapeConfigurationPair& shapePair)
|
||||
void SpringSolver::CreateCollider(AZ::u32 skeletonJointIndex, const AzPhysics::ShapeColliderPair& shapePair)
|
||||
{
|
||||
const Physics::ShapeConfiguration* shapeConfig = shapePair.second.get();
|
||||
if (!shapeConfig)
|
||||
@@ -104,7 +104,7 @@ namespace EMotionFX
|
||||
bool colliderFound = false;
|
||||
for (const auto& nodeConfig : colliderSetup.m_nodes)
|
||||
{
|
||||
for (const Physics::ShapeConfigurationPair& shapePair : nodeConfig.m_shapes)
|
||||
for (const AzPhysics::ShapeColliderPair& shapePair : nodeConfig.m_shapes)
|
||||
{
|
||||
if (shapePair.first->m_tag == colliderTag)
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace EMotionFX
|
||||
AZ::Vector3 m_end = AZ::Vector3::CreateZero(); /**< The end position of the primitive. In case of a sphere this is ignored. */
|
||||
float m_radius = 1.0f; /**< The radius or thickness. */
|
||||
float m_scaledRadius = 1.0f; /**< The scaled radius value, scaled by the joint's world space transform. */
|
||||
const Physics::ShapeConfigurationPair* m_shapePair = nullptr;
|
||||
const AzPhysics::ShapeColliderPair* m_shapePair = nullptr;
|
||||
};
|
||||
|
||||
struct EMFX_API InitSettings
|
||||
@@ -151,7 +151,7 @@ namespace EMotionFX
|
||||
|
||||
private:
|
||||
void InitColliders(const InitSettings& initSettings);
|
||||
void CreateCollider(AZ::u32 skeletonJointIndex, const Physics::ShapeConfigurationPair& shapePair);
|
||||
void CreateCollider(AZ::u32 skeletonJointIndex, const AzPhysics::ShapeColliderPair& shapePair);
|
||||
void InitColliderFromColliderSetupShape(CollisionObject& collider);
|
||||
void InitCollidersFromColliderSetupShapes();
|
||||
bool RecursiveAddJoint(const SimulatedJoint* joint, size_t parentParticleIndex);
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace EMotionFX
|
||||
connect(this, &AzQtComponents::Card::contextMenuRequested, this, &ColliderWidget::OnCardContextMenu);
|
||||
}
|
||||
|
||||
void ColliderWidget::Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationPair& collider)
|
||||
void ColliderWidget::Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPair& collider)
|
||||
{
|
||||
m_actor = actor;
|
||||
m_joint = joint;
|
||||
@@ -276,7 +276,7 @@ namespace EMotionFX
|
||||
if (!collider.first || !collider.second)
|
||||
{
|
||||
m_editor->ClearInstances(true);
|
||||
m_collider = Physics::ShapeConfigurationPair();
|
||||
m_collider = AzPhysics::ShapeColliderPair();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace EMotionFX
|
||||
CommandSystem::GetCommandManager()->RemoveCommandCallback(m_commandCallback, /*delFromMem=*/true);
|
||||
}
|
||||
|
||||
void ColliderContainerWidget::Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationList& colliders, AZ::SerializeContext* serializeContext)
|
||||
void ColliderContainerWidget::Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPairList& colliders, AZ::SerializeContext* serializeContext)
|
||||
{
|
||||
m_actor = actor;
|
||||
m_joint = joint;
|
||||
@@ -557,7 +557,7 @@ namespace EMotionFX
|
||||
for (size_t i = numColliders; i < numAvailableColliderWidgets; ++i)
|
||||
{
|
||||
m_colliderWidgets[i]->hide();
|
||||
m_colliderWidgets[i]->Update(nullptr, nullptr, MCORE_INVALIDINDEX32, PhysicsSetup::ColliderConfigType::Unknown, Physics::ShapeConfigurationPair());
|
||||
m_colliderWidgets[i]->Update(nullptr, nullptr, MCORE_INVALIDINDEX32, PhysicsSetup::ColliderConfigType::Unknown, AzPhysics::ShapeColliderPair());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ namespace EMotionFX
|
||||
|
||||
void ColliderContainerWidget::Reset()
|
||||
{
|
||||
Update(nullptr, nullptr, PhysicsSetup::ColliderConfigType::Unknown, Physics::ShapeConfigurationList(), nullptr);
|
||||
Update(nullptr, nullptr, PhysicsSetup::ColliderConfigType::Unknown, AzPhysics::ShapeColliderPairList(), nullptr);
|
||||
}
|
||||
|
||||
void ColliderContainerWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||
@@ -614,7 +614,7 @@ namespace EMotionFX
|
||||
return QWidget::sizeHint() + QSize(0, s_layoutSpacing);
|
||||
}
|
||||
|
||||
void ColliderContainerWidget::RenderColliders(const Physics::ShapeConfigurationList& colliders,
|
||||
void ColliderContainerWidget::RenderColliders(const AzPhysics::ShapeColliderPairList& colliders,
|
||||
const ActorInstance* actorInstance,
|
||||
const Node* node,
|
||||
EMStudio::EMStudioPlugin::RenderInfo* renderInfo,
|
||||
@@ -704,7 +704,7 @@ namespace EMotionFX
|
||||
if (joint)
|
||||
{
|
||||
const bool jointSelected = selectedJointIndices.empty() || selectedJointIndices.find(joint->GetNodeIndex()) != selectedJointIndices.end();
|
||||
const Physics::ShapeConfigurationList& colliders = nodeConfig.m_shapes;
|
||||
const AzPhysics::ShapeColliderPairList& colliders = nodeConfig.m_shapes;
|
||||
RenderColliders(colliders, actorInstance, joint, renderInfo, jointSelected ? selectedColor : defaultColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace EMotionFX
|
||||
public:
|
||||
ColliderWidget(QIcon* icon, QWidget* parent, AZ::SerializeContext* serializeContext);
|
||||
|
||||
void Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationPair& collider);
|
||||
void Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPair& collider);
|
||||
void Update();
|
||||
void Reset();
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace EMotionFX
|
||||
PhysicsSetup::ColliderConfigType m_colliderType = PhysicsSetup::ColliderConfigType::Unknown;
|
||||
Node* m_joint = nullptr;
|
||||
size_t m_colliderIndex = MCORE_INVALIDINDEX32;
|
||||
Physics::ShapeConfigurationPair m_collider;
|
||||
AzPhysics::ShapeColliderPair m_collider;
|
||||
|
||||
QIcon* m_icon;
|
||||
};
|
||||
@@ -140,7 +140,7 @@ namespace EMotionFX
|
||||
ColliderContainerWidget(const QIcon& colliderIcon, QWidget* parent = nullptr);
|
||||
~ColliderContainerWidget();
|
||||
|
||||
void Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationList& colliders, AZ::SerializeContext* serializeContext);
|
||||
void Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPairList& colliders, AZ::SerializeContext* serializeContext);
|
||||
void Update();
|
||||
void Reset();
|
||||
PhysicsSetup::ColliderConfigType ColliderType() { return m_colliderType; }
|
||||
@@ -156,7 +156,7 @@ namespace EMotionFX
|
||||
* @param[in] renderInfo Needed to access the render util.
|
||||
* @param[in] colliderColor The collider color.
|
||||
*/
|
||||
static void RenderColliders(const Physics::ShapeConfigurationList& colliders,
|
||||
static void RenderColliders(const AzPhysics::ShapeColliderPairList& colliders,
|
||||
const ActorInstance* actorInstance,
|
||||
const Node* node,
|
||||
EMStudio::EMStudioPlugin::RenderInfo* renderInfo,
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace EMotionFX
|
||||
const Physics::CharacterColliderNodeConfiguration* copyFromNodeConfig = copyFromColliderConfig->FindNodeConfigByName(joint->GetNameString());
|
||||
if (copyFromNodeConfig)
|
||||
{
|
||||
for (const Physics::ShapeConfigurationPair& shapeConfigPair : copyFromNodeConfig->m_shapes)
|
||||
for (const AzPhysics::ShapeColliderPair& shapeConfigPair : copyFromNodeConfig->m_shapes)
|
||||
{
|
||||
const AZStd::string contents = MCore::ReflectionSerializer::Serialize(&shapeConfigPair).GetValue();
|
||||
CommandColliderHelpers::AddCollider(actor->GetID(), joint->GetNameString(), copyTo, contents, AZStd::nullopt, &commandGroup);
|
||||
@@ -231,7 +231,7 @@ namespace EMotionFX
|
||||
const Physics::CharacterColliderNodeConfiguration* copyFromNodeConfig = copyFromColliderConfig->FindNodeConfigByName(joint->GetNameString());
|
||||
if (copyFromNodeConfig && shapeIndex < copyFromNodeConfig->m_shapes.size())
|
||||
{
|
||||
const Physics::ShapeConfigurationPair* shape = ©FromNodeConfig->m_shapes[shapeIndex];
|
||||
const AzPhysics::ShapeColliderPair* shape = ©FromNodeConfig->m_shapes[shapeIndex];
|
||||
const AZStd::string contents = MCore::ReflectionSerializer::Serialize(shape).GetValue();
|
||||
QMimeData* mimeData = new QMimeData();
|
||||
mimeData->setData(
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace EMotionFX
|
||||
public:
|
||||
static QString GetMimeTypeForColliderShape()
|
||||
{
|
||||
return QString("com.amazon.lumberyard/%1").arg(azrtti_typeid<Physics::ShapeConfigurationPair>().ToString<QString>());
|
||||
return QString("com.amazon.lumberyard/%1").arg(azrtti_typeid<AzPhysics::ShapeColliderPair>().ToString<QString>());
|
||||
}
|
||||
|
||||
static void AddCopyColliderCommandToGroup(const Actor* actor, const Node* joint, PhysicsSetup::ColliderConfigType copyFrom, PhysicsSetup::ColliderConfigType copyTo, MCore::CommandGroup& commandGroup);
|
||||
|
||||
@@ -507,7 +507,7 @@ namespace EMotionFX
|
||||
const Physics::CharacterColliderNodeConfiguration* colliderNodeConfig = colliderConfig.FindNodeConfigByName(joint->GetNameString());
|
||||
if (colliderNodeConfig)
|
||||
{
|
||||
const Physics::ShapeConfigurationList& colliders = colliderNodeConfig->m_shapes;
|
||||
const AzPhysics::ShapeColliderPairList& colliders = colliderNodeConfig->m_shapes;
|
||||
ColliderContainerWidget::RenderColliders(colliders, actorInstance, joint, renderInfo, finalColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace EMotionFX
|
||||
ASSERT_TRUE(nodeConfig != nullptr);
|
||||
EXPECT_EQ(nodeConfig->m_shapes.size(), 1);
|
||||
|
||||
Physics::ShapeConfigurationPair& shapeConfigPair = nodeConfig->m_shapes[0];
|
||||
AzPhysics::ShapeColliderPair& shapeConfigPair = nodeConfig->m_shapes[0];
|
||||
Physics::ColliderConfiguration* colliderConfig = shapeConfigPair.first.get();
|
||||
Physics::ShapeConfiguration* shapeConfig = shapeConfigPair.second.get();
|
||||
Physics::BoxShapeConfiguration* boxShapeConfig = azdynamic_cast<Physics::BoxShapeConfiguration*>(shapeConfig);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace EMotionFX
|
||||
else
|
||||
{
|
||||
// Count in only the given collider type.
|
||||
for (const Physics::ShapeConfigurationPair& shapeConfigPair : nodeConfig.m_shapes)
|
||||
for (const AzPhysics::ShapeColliderPair& shapeConfigPair : nodeConfig.m_shapes)
|
||||
{
|
||||
if (shapeConfigPair.second->GetShapeType() == shapeTypeToCount)
|
||||
{
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace ImGui
|
||||
|
||||
void ImGuiLYAssetExplorer::ImGuiUpdate_DrawMenu()
|
||||
{
|
||||
// Master on / off Switch
|
||||
// Primary on / off Switch
|
||||
ImGui::Checkbox("Mesh Debug Enabled", &m_meshDebugEnabled);
|
||||
ImGui::SameLine();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace ImGui
|
||||
void MeshInstanceList_CheckMeshFilter();
|
||||
void MeshInstanceList_CheckEntityFilter();
|
||||
|
||||
// The Master list of Meshes and Instances of them
|
||||
// The Primary list of Meshes and Instances of them
|
||||
AZStd::list<MeshInstanceDisplayList> m_meshInstanceDisplayList;
|
||||
|
||||
// Helper functions for the ImGui Update
|
||||
|
||||
@@ -85,10 +85,10 @@ namespace LmbrCentral
|
||||
AZStd::vector<AZStd::string> GetBundleList(const char* bundlePath, const char* bundleExtension) const;
|
||||
|
||||
//! Bundles which are split across archives (Usually due to size constraints) have the dependent bundles listed in the manifest
|
||||
//! of the master bundle. This method manages opening the dependent bundles.
|
||||
//! of the main bundle. This method manages opening the dependent bundles.
|
||||
void OpenDependentBundles(const char* bundleName, AZStd::shared_ptr<AzFramework::AssetBundleManifest> bundleManifest);
|
||||
//! Bundles which are split across archives (Usually due to size constraints) have the dependent bundles listed in the manifest
|
||||
//! of the master bundle. This method manages closing the dependent bundles.
|
||||
//! of the main bundle. This method manages closing the dependent bundles.
|
||||
void CloseDependentBundles(const char* bundleName, AZStd::shared_ptr<AzFramework::AssetBundleManifest> bundleManifest);
|
||||
|
||||
size_t GetOpenedBundleCount() const override;
|
||||
|
||||
@@ -3568,13 +3568,14 @@ UiTextComponent::FontEffectComboBoxVec UiTextComponent::PopulateFontEffectList()
|
||||
FontEffectComboBoxVec result;
|
||||
AZStd::vector<AZ::EntityId> entityIdList;
|
||||
|
||||
// there is always a valid font since we default to "default-ui"
|
||||
// so just get the effects from the font and add their names to the result list
|
||||
unsigned int numEffects = m_font->GetNumEffects();
|
||||
for (int i = 0; i < numEffects; ++i)
|
||||
if (m_font)
|
||||
{
|
||||
const char* name = m_font->GetEffectName(i);
|
||||
result.push_back(AZStd::make_pair(i, name));
|
||||
unsigned int numEffects = m_font->GetNumEffects();
|
||||
for (int i = 0; i < numEffects; ++i)
|
||||
{
|
||||
const char* name = m_font->GetEffectName(i);
|
||||
result.push_back(AZStd::make_pair(i, name));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace NvCloth
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const Physics::ShapeConfigurationPair& shapeConfigPair : clothNodeConfig.m_shapes)
|
||||
for (const AzPhysics::ShapeColliderPair& shapeConfigPair : clothNodeConfig.m_shapes)
|
||||
{
|
||||
const auto& colliderConfig = shapeConfigPair.first;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace PhysX
|
||||
{
|
||||
public:
|
||||
//! Gets the collection of collider configuration / shape configuration pairs used to define the collider's shapes.
|
||||
virtual Physics::ShapeConfigurationList GetShapeConfigurations() = 0;
|
||||
virtual AzPhysics::ShapeColliderPairList GetShapeConfigurations() = 0;
|
||||
|
||||
//! Gets the collection of physics shapes associated with the collider.
|
||||
virtual AZStd::vector<AZStd::shared_ptr<Physics::Shape>> GetShapes() = 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace PhysX
|
||||
static constexpr AZ::u16 TriangleMeshMaterialIndex = (std::numeric_limits<AZ::u16>::max)();
|
||||
|
||||
using ShapeConfigurationPair = AZStd::pair<AZStd::shared_ptr<AssetColliderConfiguration>,
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration>>; // Have to use shared_ptr here because Physics::ShapeConfigurationList uses it
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration>>; // Have to use shared_ptr here because AzPhysics::ShapeColliderPairList uses it
|
||||
using ShapeConfigurationList = AZStd::vector<ShapeConfigurationPair>;
|
||||
|
||||
ShapeConfigurationList m_colliderShapes; //!< Shapes data with optional collider configuration override.
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace PhysX
|
||||
}
|
||||
}
|
||||
|
||||
void BaseColliderComponent::SetShapeConfigurationList(const Physics::ShapeConfigurationList& shapeConfigList)
|
||||
void BaseColliderComponent::SetShapeConfigurationList(const AzPhysics::ShapeColliderPairList& shapeConfigList)
|
||||
{
|
||||
if (GetEntity()->GetState() == AZ::Entity::State::Active)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ namespace PhysX
|
||||
m_shapeConfigList = shapeConfigList;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationList BaseColliderComponent::GetShapeConfigurations()
|
||||
AzPhysics::ShapeColliderPairList BaseColliderComponent::GetShapeConfigurations()
|
||||
{
|
||||
return m_shapeConfigList;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ namespace PhysX
|
||||
{
|
||||
AZ_Assert(IsMeshCollider(), "InitMeshCollider called for a non-mesh collider.");
|
||||
|
||||
const Physics::ShapeConfigurationPair& shapeConfigurationPair = *(m_shapeConfigList.begin());
|
||||
const AzPhysics::ShapeColliderPair& shapeConfigurationPair = *(m_shapeConfigList.begin());
|
||||
const Physics::ColliderConfiguration& componentColliderConfiguration = *(shapeConfigurationPair.first.get());
|
||||
const Physics::PhysicsAssetShapeConfiguration& physicsAssetConfiguration =
|
||||
*(static_cast<const Physics::PhysicsAssetShapeConfiguration*>(shapeConfigurationPair.second.get()));
|
||||
|
||||
@@ -40,10 +40,10 @@ namespace PhysX
|
||||
|
||||
BaseColliderComponent() = default;
|
||||
|
||||
void SetShapeConfigurationList(const Physics::ShapeConfigurationList& shapeConfigList);
|
||||
void SetShapeConfigurationList(const AzPhysics::ShapeColliderPairList& shapeConfigList);
|
||||
|
||||
// ColliderComponentRequestBus
|
||||
Physics::ShapeConfigurationList GetShapeConfigurations() override;
|
||||
AzPhysics::ShapeColliderPairList GetShapeConfigurations() override;
|
||||
AZStd::vector<AZStd::shared_ptr<Physics::Shape>> GetShapes() override;
|
||||
|
||||
// TransformNotificationsBus
|
||||
@@ -114,7 +114,7 @@ namespace PhysX
|
||||
virtual void UpdateScaleForShapeConfigs();
|
||||
|
||||
ShapeInfoCache m_shapeInfoCache;
|
||||
Physics::ShapeConfigurationList m_shapeConfigList;
|
||||
AzPhysics::ShapeColliderPairList m_shapeConfigList;
|
||||
private:
|
||||
bool InitShapes();
|
||||
bool IsMeshCollider() const;
|
||||
|
||||
@@ -312,6 +312,26 @@ namespace PhysX
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration> EditorProxyShapeConfig::CloneCurrent() const
|
||||
{
|
||||
switch (m_shapeType)
|
||||
{
|
||||
case Physics::ShapeType::Sphere:
|
||||
return AZStd::make_shared<Physics::SphereShapeConfiguration>(m_sphere);
|
||||
case Physics::ShapeType::Capsule:
|
||||
return AZStd::make_shared<Physics::CapsuleShapeConfiguration>(m_capsule);
|
||||
case Physics::ShapeType::PhysicsAsset:
|
||||
return AZStd::make_shared<Physics::PhysicsAssetShapeConfiguration>(m_physicsAsset.m_configuration);
|
||||
case Physics::ShapeType::CookedMesh:
|
||||
return AZStd::make_shared<Physics::CookedMeshShapeConfiguration>(m_cookedMesh);
|
||||
default:
|
||||
AZ_Warning("EditorProxyShapeConfig", false, "Unsupported shape type, defaulting to Box.");
|
||||
[[fallthrough]];
|
||||
case Physics::ShapeType::Box:
|
||||
return AZStd::make_shared<Physics::BoxShapeConfiguration>(m_box);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorProxyShapeConfig::ShowingSubdivisionLevel() const
|
||||
{
|
||||
return (m_hasNonUniformScale && (IsCapsuleConfig() || IsSphereConfig() || IsAssetConfig()));
|
||||
@@ -590,10 +610,6 @@ namespace PhysX
|
||||
configuration.m_entityId = GetEntityId();
|
||||
configuration.m_debugName = GetEntity()->GetName();
|
||||
|
||||
// This configuration needs to be at the scope of the function to be added
|
||||
// to m_colliderAndShapeData as a pointer.
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
|
||||
if (m_shapeConfiguration.IsAssetConfig())
|
||||
{
|
||||
AZStd::vector<AZStd::shared_ptr<Physics::Shape>> shapes;
|
||||
@@ -603,13 +619,15 @@ namespace PhysX
|
||||
}
|
||||
else
|
||||
{
|
||||
colliderConfig = GetColliderConfigurationScaled();
|
||||
Physics::ShapeConfiguration& shapeConfig = m_shapeConfiguration.GetCurrent();
|
||||
AZStd::shared_ptr<Physics::ColliderConfiguration> colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>(
|
||||
GetColliderConfigurationScaled());
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration> shapeConfig = m_shapeConfiguration.CloneCurrent();
|
||||
|
||||
if (IsNonUniformlyScaledPrimitive(m_shapeConfiguration))
|
||||
{
|
||||
auto convexConfig = Utils::CreateConvexFromPrimitive(GetColliderConfiguration(), shapeConfig,
|
||||
m_shapeConfiguration.m_subdivisionLevel, shapeConfig.m_scale);
|
||||
auto colliderConfigurationNoOffset = colliderConfig;
|
||||
auto convexConfig = Utils::CreateConvexFromPrimitive(GetColliderConfiguration(), *(shapeConfig.get()),
|
||||
m_shapeConfiguration.m_subdivisionLevel, shapeConfig->m_scale);
|
||||
Physics::ColliderConfiguration colliderConfigurationNoOffset = *colliderConfig;
|
||||
colliderConfigurationNoOffset.m_rotation = AZ::Quaternion::CreateIdentity();
|
||||
colliderConfigurationNoOffset.m_position = AZ::Vector3::CreateZero();
|
||||
|
||||
@@ -622,7 +640,7 @@ namespace PhysX
|
||||
}
|
||||
else
|
||||
{
|
||||
configuration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfig);
|
||||
configuration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +823,7 @@ namespace PhysX
|
||||
return;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationList shapeConfigList;
|
||||
AzPhysics::ShapeColliderPairList shapeConfigList;
|
||||
Utils::GetColliderShapeConfigsFromAsset(physicsAssetConfiguration, m_configuration, m_hasNonUniformScale,
|
||||
m_shapeConfiguration.m_subdivisionLevel, shapeConfigList);
|
||||
|
||||
@@ -879,7 +897,7 @@ namespace PhysX
|
||||
|
||||
const Physics::PhysicsAssetShapeConfiguration& physicsAssetConfiguration = m_shapeConfiguration.m_physicsAsset.m_configuration;
|
||||
|
||||
Physics::ShapeConfigurationList shapeConfigList;
|
||||
AzPhysics::ShapeColliderPairList shapeConfigList;
|
||||
Utils::GetColliderShapeConfigsFromAsset(physicsAssetConfiguration, m_configuration, m_hasNonUniformScale,
|
||||
m_shapeConfiguration.m_subdivisionLevel, shapeConfigList);
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ namespace PhysX
|
||||
Physics::ShapeConfiguration& GetCurrent();
|
||||
const Physics::ShapeConfiguration& GetCurrent() const;
|
||||
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration> CloneCurrent() const;
|
||||
|
||||
bool ShowingSubdivisionLevel() const;
|
||||
|
||||
AZ::u32 OnConfigurationChanged();
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace PhysX
|
||||
void EditorShapeColliderComponent::BuildGameEntity(AZ::Entity* gameEntity)
|
||||
{
|
||||
auto* shapeColliderComponent = gameEntity->CreateComponent<ShapeColliderComponent>();
|
||||
Physics::ShapeConfigurationList shapeConfigurationList;
|
||||
AzPhysics::ShapeColliderPairList shapeConfigurationList;
|
||||
shapeConfigurationList.reserve(m_shapeConfigs.size());
|
||||
for (const auto& shapeConfig : m_shapeConfigs)
|
||||
{
|
||||
@@ -257,11 +257,12 @@ namespace PhysX
|
||||
configuration.m_entityId = GetEntityId();
|
||||
configuration.m_debugName = GetEntity()->GetName();
|
||||
|
||||
AZStd::vector<AzPhysics::ShapeColliderPair> colliderShapePairs;
|
||||
AzPhysics::ShapeColliderPairList colliderShapePairs;
|
||||
colliderShapePairs.reserve(m_shapeConfigs.size());
|
||||
for (const auto& shapeConfig : m_shapeConfigs)
|
||||
{
|
||||
colliderShapePairs.emplace_back(&m_colliderConfig, shapeConfig.get());
|
||||
colliderShapePairs.emplace_back(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(m_colliderConfig), shapeConfig);
|
||||
}
|
||||
configuration.m_colliderAndShapeData = colliderShapePairs;
|
||||
|
||||
|
||||
@@ -770,7 +770,7 @@ namespace PhysX
|
||||
return worldPosAabb;
|
||||
}
|
||||
|
||||
Physics::ShapeConfigurationList colliderShapes;
|
||||
AzPhysics::ShapeColliderPairList colliderShapes;
|
||||
GetColliderShapeConfigsFromAsset(physicsAssetConfig,
|
||||
colliderConfiguration,
|
||||
hasNonUniformScale,
|
||||
@@ -812,7 +812,7 @@ namespace PhysX
|
||||
|
||||
void GetColliderShapeConfigsFromAsset(const Physics::PhysicsAssetShapeConfiguration& assetConfiguration,
|
||||
const Physics::ColliderConfiguration& originalColliderConfiguration, bool hasNonUniformScale,
|
||||
AZ::u8 subdivisionLevel, Physics::ShapeConfigurationList& resultingColliderShapes)
|
||||
AZ::u8 subdivisionLevel, AzPhysics::ShapeColliderPairList& resultingColliderShapes)
|
||||
{
|
||||
if (!assetConfiguration.m_asset.IsReady())
|
||||
{
|
||||
@@ -896,13 +896,13 @@ namespace PhysX
|
||||
const Physics::ColliderConfiguration& originalColliderConfiguration, bool hasNonUniformScale,
|
||||
AZ::u8 subdivisionLevel, AZStd::vector<AZStd::shared_ptr<Physics::Shape>>& resultingShapes)
|
||||
{
|
||||
Physics::ShapeConfigurationList resultingColliderShapeConfigs;
|
||||
AzPhysics::ShapeColliderPairList resultingColliderShapeConfigs;
|
||||
GetColliderShapeConfigsFromAsset(assetConfiguration, originalColliderConfiguration,
|
||||
hasNonUniformScale, subdivisionLevel, resultingColliderShapeConfigs);
|
||||
|
||||
resultingShapes.reserve(resultingShapes.size() + resultingColliderShapeConfigs.size());
|
||||
|
||||
for (const Physics::ShapeConfigurationPair& shapeConfigPair : resultingColliderShapeConfigs)
|
||||
for (const AzPhysics::ShapeColliderPair& shapeConfigPair : resultingColliderShapeConfigs)
|
||||
{
|
||||
// Scale the collider offset
|
||||
shapeConfigPair.first->m_position *= shapeConfigPair.second->m_scale;
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace PhysX
|
||||
|
||||
void GetColliderShapeConfigsFromAsset(const Physics::PhysicsAssetShapeConfiguration& assetConfiguration,
|
||||
const Physics::ColliderConfiguration& originalColliderConfiguration,
|
||||
bool hasNonUniformScale, AZ::u8 subdivisionLevel, Physics::ShapeConfigurationList& resultingColliderShapes);
|
||||
bool hasNonUniformScale, AZ::u8 subdivisionLevel, AzPhysics::ShapeColliderPairList& resultingColliderShapes);
|
||||
|
||||
//! Gets the scale from the entity's Transform component.
|
||||
AZ::Vector3 GetTransformScale(AZ::EntityId entityId);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#ifdef HAVE_BENCHMARK
|
||||
#include <Benchmarks/PhysXBenchmarkWashingMachine.h>
|
||||
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzFramework/Physics/PhysicsScene.h>
|
||||
#include <AzFramework/Physics/PhysicsSystem.h>
|
||||
#include <AzFramework/Physics/SystemBus.h>
|
||||
@@ -96,9 +97,12 @@ namespace PhysX::Benchmarks
|
||||
config.m_position.SetY((cylinderRadius + halfCylinderWallThickness) * std::sin(AZ::Constants::TwoPi * i / NumCylinderSide) + position.GetY());
|
||||
config.m_position.SetZ(z);
|
||||
config.m_orientation = AZ::Quaternion::CreateRotationZ(AZ::Constants::HalfPi + (cylinderTheta * i));
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(cylinderRadius, cylinderWallThickness, cylinderHeight));
|
||||
config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfiguration);
|
||||
|
||||
auto shapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(
|
||||
AZ::Vector3(cylinderRadius, cylinderWallThickness, cylinderHeight));
|
||||
|
||||
config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(), shapeConfiguration);
|
||||
m_cylinder[i] = scene->AddSimulatedBody(&config);
|
||||
}
|
||||
|
||||
@@ -114,9 +118,9 @@ namespace PhysX::Benchmarks
|
||||
bladeRigidBodyConfig.m_position = position;
|
||||
bladeRigidBodyConfig.m_position.SetZ(position.GetZ() + (bladeHeight / 2.0f));
|
||||
bladeRigidBodyConfig.m_orientation = AZ::Quaternion::CreateRotationZ(0.0f);
|
||||
Physics::ColliderConfiguration bladeColliderConfig;
|
||||
Physics::BoxShapeConfiguration bladeShapeConfiguration(AZ::Vector3(bladeLength, 1.0f, bladeHeight));
|
||||
bladeRigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&bladeColliderConfig, &bladeShapeConfiguration);
|
||||
auto bladeShapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3(bladeLength, 1.0f, bladeHeight));
|
||||
bladeRigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(), bladeShapeConfiguration);
|
||||
m_blade = scene->AddSimulatedBody(&bladeRigidBodyConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <Benchmarks/PhysXBenchmarksUtilities.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <AzFramework/Physics/SimulatedBodies/RigidBody.h>
|
||||
#include <AzFramework/Physics/Shape.h>
|
||||
#include <AzFramework/Physics/PhysicsScene.h>
|
||||
@@ -34,9 +35,9 @@ namespace PhysX::Benchmarks
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfig;
|
||||
rigidBodyConfig.m_ccdEnabled = enableCCD;
|
||||
Physics::ColliderConfiguration rigidBodyColliderConfig;
|
||||
auto rigidBodyColliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
|
||||
Physics::BoxShapeConfiguration defaultShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3::CreateOne());
|
||||
auto defaultShapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne());
|
||||
for (int i = 0; i < numRigidBodies; i++)
|
||||
{
|
||||
//call the optional function pointers, otherwise assign a default
|
||||
@@ -57,16 +58,16 @@ namespace PhysX::Benchmarks
|
||||
rigidBodyConfig.m_orientation = (*genSpawnOriFuncPtr)(i);
|
||||
}
|
||||
|
||||
Physics::ShapeConfiguration* shapeConfig = nullptr;
|
||||
AZStd::shared_ptr<Physics::ShapeConfiguration> shapeConfig = nullptr;
|
||||
if (genColliderFuncPtr != nullptr)
|
||||
{
|
||||
shapeConfig = (*genColliderFuncPtr)(i);
|
||||
}
|
||||
if (shapeConfig == nullptr)
|
||||
{
|
||||
shapeConfig = &defaultShapeConfiguration;
|
||||
shapeConfig = defaultShapeConfiguration;
|
||||
}
|
||||
rigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&rigidBodyColliderConfig, shapeConfig);
|
||||
rigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(rigidBodyColliderConfig, shapeConfig);
|
||||
|
||||
AzPhysics::SimulatedBodyHandle simBodyHandle = scene->AddSimulatedBody(&rigidBodyConfig);
|
||||
rigidBodies.push_back(simBodyHandle);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace PhysX::Benchmarks
|
||||
namespace Utils
|
||||
{
|
||||
//! Function pointer to allow Shape configuration customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created)
|
||||
using GenerateColliderFuncPtr = AZStd::function<Physics::ShapeConfiguration*(int)>;
|
||||
using GenerateColliderFuncPtr = AZStd::function<AZStd::shared_ptr<Physics::ShapeConfiguration>(int)>;
|
||||
//! Function pointer to allow spawn position customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created)
|
||||
using GenerateSpawnPositionFuncPtr = AZStd::function<const AZ::Vector3(int)>;
|
||||
//! Function pointer to allow spawn orientation customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created)
|
||||
|
||||
@@ -136,9 +136,8 @@ namespace PhysX::Benchmarks
|
||||
{
|
||||
AZStd::vector<JointGroup> joints;
|
||||
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::SphereShapeConfiguration shapeConfiguration = Physics::SphereShapeConfiguration(JointConstants::CreateJointDefaults::ColliderRadius);
|
||||
AzPhysics::ShapeColliderPair shapeColliderConfig(&colliderConfig, &shapeConfiguration);
|
||||
auto shapeConfiguration = AZStd::make_shared<Physics::SphereShapeConfiguration>(JointConstants::CreateJointDefaults::ColliderRadius);
|
||||
AzPhysics::ShapeColliderPair shapeColliderConfig(AZStd::make_shared<Physics::ColliderConfiguration>(), shapeConfiguration);
|
||||
for (int i = 0; i < numJoints; i++)
|
||||
{
|
||||
JointGroup newJoint;
|
||||
@@ -340,13 +339,13 @@ namespace PhysX::Benchmarks
|
||||
const int numSegments = aznumeric_cast<int>(state.range(0));
|
||||
|
||||
//create the collider shape config to use on the whole snake
|
||||
Physics::SphereShapeConfiguration snakePartShapeConfiguration = Physics::SphereShapeConfiguration(JointConstants::CreateJointDefaults::ColliderRadius);
|
||||
Physics::ColliderConfiguration snakeHeadcolliderConfig;
|
||||
auto snakePartShapeConfiguration = AZStd::make_shared<Physics::SphereShapeConfiguration>(JointConstants::CreateJointDefaults::ColliderRadius);
|
||||
|
||||
//create the had of the snake this is the only static part.
|
||||
AzPhysics::StaticRigidBodyConfiguration snakeHeadBodyConfig;
|
||||
snakeHeadBodyConfig.m_position = AZ::Vector3::CreateZero();
|
||||
snakeHeadBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&snakeHeadcolliderConfig, &snakePartShapeConfiguration);
|
||||
snakeHeadBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(), snakePartShapeConfiguration);
|
||||
|
||||
AzPhysics::SimulatedBody* snakeHead = nullptr;
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
@@ -358,7 +357,7 @@ namespace PhysX::Benchmarks
|
||||
//create the body
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&snakePartShapeConfiguration]([[maybe_unused]] int idx) -> auto
|
||||
{
|
||||
return &snakePartShapeConfiguration;
|
||||
return snakePartShapeConfiguration;
|
||||
};
|
||||
Utils::GenerateSpawnPositionFuncPtr posGenerator = [](int idx) -> auto
|
||||
{
|
||||
|
||||
@@ -203,10 +203,10 @@ namespace PhysX::Benchmarks
|
||||
return AZ::Vector3(x, y, z);
|
||||
};
|
||||
|
||||
Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration*
|
||||
auto boxShapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx)
|
||||
{
|
||||
return &boxShapeConfiguration;
|
||||
return boxShapeConfiguration;
|
||||
};
|
||||
//spawn the rigid bodies
|
||||
AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene,
|
||||
@@ -275,10 +275,10 @@ namespace PhysX::Benchmarks
|
||||
Utils::GenerateMassFuncPtr massGenerator = [&rand]([[maybe_unused]] int idx) -> float {
|
||||
return rand.GetRandomFloat() * 25.0f + 5.0f;
|
||||
};
|
||||
Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration*
|
||||
auto boxShapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx)
|
||||
{
|
||||
return &boxShapeConfiguration;
|
||||
return boxShapeConfiguration;
|
||||
};
|
||||
//spawn the rigid bodies
|
||||
AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene,
|
||||
@@ -408,10 +408,10 @@ namespace PhysX::Benchmarks
|
||||
Utils::GenerateEntityIdFuncPtr entityIdGenerator = [&rand](int idx) -> AZ::EntityId {
|
||||
return AZ::EntityId(static_cast<AZ::u64>(idx) + RigidBodyConstants::RigidBodys::RigidBodyEntityIdStart);
|
||||
};
|
||||
Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration*
|
||||
auto boxShapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize));
|
||||
Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx)
|
||||
{
|
||||
return &boxShapeConfiguration;
|
||||
return boxShapeConfiguration;
|
||||
};
|
||||
//spawn the rigid bodies
|
||||
AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene,
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace PhysXEditorTests
|
||||
PhysX::BaseColliderComponent* colliderComponent = gameEntity->FindComponent<PhysX::BaseColliderComponent>();
|
||||
ASSERT_TRUE(colliderComponent != nullptr);
|
||||
|
||||
Physics::ShapeConfigurationList shapeConfigList = colliderComponent->GetShapeConfigurations();
|
||||
AzPhysics::ShapeColliderPairList shapeConfigList = colliderComponent->GetShapeConfigurations();
|
||||
EXPECT_EQ(shapeConfigList.size(), 1);
|
||||
|
||||
for (const auto& shapeConfigPair : shapeConfigList)
|
||||
|
||||
@@ -325,9 +325,10 @@ namespace PhysX
|
||||
// Box should start asleep
|
||||
AzPhysics::RigidBodyConfiguration config;
|
||||
config.m_startAsleep = true;
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::SphereShapeConfiguration shapeConfiguration;
|
||||
config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::SphereShapeConfiguration>()
|
||||
);
|
||||
|
||||
AzPhysics::SimulatedBodyHandle rigidBodyHandle = sceneInterface->AddSimulatedBody(sceneHandle, &config);
|
||||
TestUtils::UpdateScene(sceneHandle, 1.0f / 60.0f, 100);
|
||||
|
||||
@@ -104,12 +104,12 @@ namespace PhysX
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = config.m_layer;
|
||||
|
||||
Physics::ShapeConfigurationList shapeconfigurationList;
|
||||
AzPhysics::ShapeColliderPairList shapeconfigurationList;
|
||||
|
||||
struct Visitor
|
||||
{
|
||||
AZStd::shared_ptr<Physics::ColliderConfiguration>& colliderConfig;
|
||||
Physics::ShapeConfigurationList& shapeconfigurationList;
|
||||
AzPhysics::ShapeColliderPairList& shapeconfigurationList;
|
||||
|
||||
void operator()(const MultiShapeConfig::ShapeList::ShapeData::Box& box) const
|
||||
{
|
||||
|
||||
@@ -83,10 +83,10 @@ namespace PhysX
|
||||
auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get();
|
||||
|
||||
//add a static rigid body
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::StaticRigidBodyConfiguration config;
|
||||
config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config);
|
||||
EXPECT_FALSE(simBodyHandle == AzPhysics::InvalidSimulatedBodyHandle);
|
||||
}
|
||||
@@ -104,14 +104,15 @@ namespace PhysX
|
||||
EXPECT_TRUE(emptyBodies.empty());
|
||||
|
||||
//add some rigid bodies
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
constexpr const int numberOfBodies = 100;
|
||||
for (int i = 0; i < numberOfBodies; i++)
|
||||
{
|
||||
const float xpos = 2.0f * static_cast<float>(i);
|
||||
AzPhysics::RigidBodyConfiguration* config = aznew AzPhysics::RigidBodyConfiguration();
|
||||
config->m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config->m_colliderAndShapeData = shapeColliderData;
|
||||
config->m_position = AZ::Vector3::CreateAxisX(xpos);
|
||||
configs.emplace_back(config);
|
||||
}
|
||||
@@ -150,15 +151,16 @@ namespace PhysX
|
||||
|
||||
AzPhysics::SimulatedBodyConfigurationList configs;
|
||||
//add some rigid bodies
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
|
||||
constexpr const int numberOfBodies = 100;
|
||||
for (int i = 0; i < numberOfBodies; i++)
|
||||
{
|
||||
const float xpos = 2.0f * static_cast<float>(i);
|
||||
AzPhysics::RigidBodyConfiguration* config = aznew AzPhysics::RigidBodyConfiguration();
|
||||
config->m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config->m_colliderAndShapeData = shapeColliderData;
|
||||
config->m_position = AZ::Vector3::CreateAxisX(xpos);
|
||||
configs.emplace_back(config);
|
||||
}
|
||||
@@ -205,10 +207,11 @@ namespace PhysX
|
||||
auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get();
|
||||
|
||||
//add a simulated body
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
AzPhysics::StaticRigidBodyConfiguration config;
|
||||
config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config.m_colliderAndShapeData = shapeColliderData;
|
||||
AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config);
|
||||
|
||||
//remove the body
|
||||
@@ -223,10 +226,11 @@ namespace PhysX
|
||||
auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get();
|
||||
|
||||
//add a few simulated body
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
AzPhysics::StaticRigidBodyConfiguration config;
|
||||
config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config.m_colliderAndShapeData = shapeColliderData;
|
||||
|
||||
AzPhysics::SimulatedBodyHandleList simBodyHandles;
|
||||
constexpr const int numBodies = 10;
|
||||
@@ -281,10 +285,11 @@ namespace PhysX
|
||||
sceneInterface->RegisterSimulationBodyRemovedHandler(m_testSceneHandle, removedEvent);
|
||||
|
||||
//add a simulated body
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
AzPhysics::StaticRigidBodyConfiguration config;
|
||||
config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
config.m_colliderAndShapeData = shapeColliderData;
|
||||
AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config);
|
||||
|
||||
EXPECT_TRUE(addTriggered);
|
||||
@@ -552,17 +557,18 @@ namespace PhysX
|
||||
auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get();
|
||||
|
||||
// setup shape config
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f));
|
||||
AzPhysics::ShapeColliderPair shapeColliderData(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3::CreateOne()));
|
||||
|
||||
// add a static simulated body - this is not expected to be reported as an active actor
|
||||
AzPhysics::StaticRigidBodyConfiguration staticConfig;
|
||||
staticConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
staticConfig.m_colliderAndShapeData = shapeColliderData;
|
||||
AzPhysics::SimulatedBodyHandle staticSphereHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &staticConfig);
|
||||
|
||||
// add a rigid body - this is expect to be reported as an active actor
|
||||
AzPhysics::RigidBodyConfiguration rigidConfig;
|
||||
rigidConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
rigidConfig.m_colliderAndShapeData = shapeColliderData;
|
||||
AzPhysics::SimulatedBodyHandle rigidSphereHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &rigidConfig);
|
||||
|
||||
// create + register the active handler
|
||||
|
||||
@@ -539,14 +539,14 @@ namespace PhysX
|
||||
TEST_F(PhysXSpecificTest, RigidBody_CenterOfMassOffsetComputed)
|
||||
{
|
||||
AZ::Vector3 halfExtents(1.0f, 2.0f, 3.0f);
|
||||
Physics::BoxShapeConfiguration shapeConfig(halfExtents * 2.0f);
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
auto shapeConfig = AZStd::make_shared<Physics::BoxShapeConfiguration>(halfExtents * 2.0f);
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfiguration;
|
||||
rigidBodyConfiguration.m_computeCenterOfMass = true;
|
||||
rigidBodyConfiguration.m_computeInertiaTensor = true;
|
||||
rigidBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig);
|
||||
rigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig);
|
||||
AzPhysics::RigidBody* rigidBody = nullptr;
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
@@ -562,15 +562,15 @@ namespace PhysX
|
||||
TEST_F(PhysXSpecificTest, RigidBody_CenterOfMassOffsetSpecified)
|
||||
{
|
||||
AZ::Vector3 halfExtents(1.0f, 2.0f, 3.0f);
|
||||
Physics::BoxShapeConfiguration shapeConfig(halfExtents * 2.0f);
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
auto shapeConfig = AZStd::make_shared<Physics::BoxShapeConfiguration>(halfExtents * 2.0f);
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfiguration;
|
||||
rigidBodyConfiguration.m_computeCenterOfMass = false;
|
||||
rigidBodyConfiguration.m_centerOfMassOffset = AZ::Vector3::CreateOne();
|
||||
rigidBodyConfiguration.m_computeInertiaTensor = true;
|
||||
rigidBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig);
|
||||
rigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig);
|
||||
|
||||
AzPhysics::RigidBody* rigidBody = nullptr;
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
@@ -1113,15 +1113,15 @@ namespace PhysX
|
||||
auto CreateBoxRigidBody = [this](const AZ::Vector3& position, bool simulatedFlag, bool triggerFlag) -> AzPhysics::RigidBody*
|
||||
{
|
||||
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_isSimulated = simulatedFlag;
|
||||
colliderConfig.m_isTrigger = triggerFlag;
|
||||
Physics::BoxShapeConfiguration shapeConfig;
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_isSimulated = simulatedFlag;
|
||||
colliderConfig->m_isTrigger = triggerFlag;
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfig;
|
||||
rigidBodyConfig.m_entityId = AZ::EntityId(0); // Set entity ID to avoid warnings in OnTriggerEnter
|
||||
rigidBodyConfig.m_position = position;
|
||||
rigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig);
|
||||
rigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
colliderConfig, AZStd::make_shared<Physics::BoxShapeConfiguration>());
|
||||
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace PhysX
|
||||
|
||||
auto shapeConfig = AZStd::make_shared<Physics::SphereShapeConfiguration>(radius);
|
||||
auto shpereColliderComponent = entity->CreateComponent<PhysX::SphereColliderComponent>();
|
||||
shpereColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
shpereColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfig;
|
||||
rigidBodyConfig.m_computeMass = false;
|
||||
@@ -136,7 +136,7 @@ namespace PhysX
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfig = AZStd::make_shared<Physics::SphereShapeConfiguration>(radius);
|
||||
auto sphereColliderComponent = entity->CreateComponent<SphereColliderComponent>();
|
||||
sphereColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
sphereColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
|
||||
entity->CreateComponent<StaticRigidBodyComponent>(sceneHandle);
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace PhysX
|
||||
auto boxColliderComponent = entity->CreateComponent<PhysX::BoxColliderComponent>();
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
boxColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
boxColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
entity->CreateComponent<PhysX::StaticRigidBodyComponent>(sceneHandle);
|
||||
entity->Activate();
|
||||
return entity;
|
||||
@@ -195,7 +195,7 @@ namespace PhysX
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfig = AZStd::make_shared<Physics::CapsuleShapeConfiguration>(height, radius);
|
||||
auto capsuleColliderComponent = entity->CreateComponent<CapsuleColliderComponent>();
|
||||
capsuleColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
capsuleColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfig;
|
||||
rigidBodyConfig.m_computeMass = false;
|
||||
@@ -223,7 +223,7 @@ namespace PhysX
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfig = AZStd::make_shared<Physics::CapsuleShapeConfiguration>(height, radius);
|
||||
auto capsuleColliderComponent = entity->CreateComponent<CapsuleColliderComponent>();
|
||||
capsuleColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
capsuleColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
|
||||
entity->CreateComponent<StaticRigidBodyComponent>(sceneHandle);
|
||||
|
||||
@@ -244,14 +244,13 @@ namespace PhysX
|
||||
AZ_Assert(cookingResult, "Failed to cook the cube mesh.");
|
||||
|
||||
// Setup shape & collider configurations
|
||||
Physics::CookedMeshShapeConfiguration shapeConfig;
|
||||
shapeConfig.SetCookedMeshData(cookedData.data(), cookedData.size(),
|
||||
auto shapeConfig = AZStd::make_shared<Physics::CookedMeshShapeConfiguration>();
|
||||
shapeConfig->SetCookedMeshData(cookedData.data(), cookedData.size(),
|
||||
Physics::CookedMeshShapeConfiguration::MeshType::TriangleMesh);
|
||||
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
|
||||
AzPhysics::StaticRigidBodyConfiguration staticRigidBodyConfiguration;
|
||||
staticRigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfig);
|
||||
staticRigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(), shapeConfig);
|
||||
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
@@ -290,7 +289,7 @@ namespace PhysX
|
||||
|
||||
auto shapeConfig = AZStd::make_shared<Physics::BoxShapeConfiguration>(dimensions);
|
||||
auto boxColliderComponent = entity->CreateComponent<PhysX::BoxColliderComponent>();
|
||||
boxColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) });
|
||||
boxColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) });
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodyConfig;
|
||||
rigidBodyConfig.m_computeMass = false;
|
||||
@@ -307,7 +306,7 @@ namespace PhysX
|
||||
AZ::TransformConfig transformConfig;
|
||||
transformConfig.m_worldTransform = AZ::Transform::CreateTranslation(position);
|
||||
entity->CreateComponent<AzFramework::TransformComponent>()->SetConfiguration(transformConfig);
|
||||
Physics::ShapeConfigurationList shapeConfigList = { AZStd::make_pair(
|
||||
AzPhysics::ShapeColliderPairList shapeConfigList = { AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>()) };
|
||||
auto boxCollider = entity->CreateComponent<BoxColliderComponent>();
|
||||
@@ -371,10 +370,10 @@ namespace PhysX
|
||||
|
||||
AzPhysics::StaticRigidBody* AddStaticFloorToScene(AzPhysics::SceneHandle sceneHandle, const AZ::Transform& transform)
|
||||
{
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(20.0f, 20.0f, 1.0f));
|
||||
AzPhysics::StaticRigidBodyConfiguration staticBodyConfiguration;
|
||||
staticBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
staticBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(
|
||||
AZStd::make_shared<Physics::ColliderConfiguration>(),
|
||||
AZStd::make_shared<Physics::BoxShapeConfiguration>(AZ::Vector3(20.0f, 20.0f, 1.0f)));
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(sceneHandle, &staticBodyConfiguration);
|
||||
@@ -410,10 +409,10 @@ namespace PhysX
|
||||
AzPhysics::SimulatedBodyHandle AddSphereToScene(AzPhysics::SceneHandle sceneHandle, const AZ::Vector3& position,
|
||||
const float radius /*= 0.5f*/, const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/)
|
||||
{
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_collisionLayer = layer;
|
||||
Physics::SphereShapeConfiguration shapeConfiguration;
|
||||
shapeConfiguration.m_radius = radius;
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfiguration = AZStd::make_shared<Physics::SphereShapeConfiguration>();
|
||||
shapeConfiguration->m_radius = radius;
|
||||
AzPhysics::RigidBodyConfiguration rigidBodySettings;
|
||||
rigidBodySettings.m_computeMass = false;
|
||||
rigidBodySettings.m_computeInertiaTensor = false;
|
||||
@@ -421,7 +420,7 @@ namespace PhysX
|
||||
rigidBodySettings.m_mass = 1.0f;
|
||||
rigidBodySettings.m_position = position;
|
||||
rigidBodySettings.m_linearDamping = 0.0f;
|
||||
rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration);
|
||||
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
@@ -435,11 +434,12 @@ namespace PhysX
|
||||
const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/)
|
||||
{
|
||||
AzPhysics::RigidBodyConfiguration rigidBodySettings;
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_collisionLayer = layer;
|
||||
colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
Physics::CapsuleShapeConfiguration shapeConfig(height, radius);
|
||||
rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig);
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi);
|
||||
|
||||
rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig,
|
||||
AZStd::make_shared<Physics::CapsuleShapeConfiguration>(height, radius));
|
||||
rigidBodySettings.m_position = position;
|
||||
rigidBodySettings.m_computeMass = false;
|
||||
rigidBodySettings.m_computeInertiaTensor = false;
|
||||
@@ -457,10 +457,10 @@ namespace PhysX
|
||||
const AZ::Vector3& position, const AZ::Vector3& dimensions /*= AZ::Vector3(1.0f)*/,
|
||||
const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/)
|
||||
{
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_collisionLayer = layer;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration;
|
||||
shapeConfiguration.m_dimensions = dimensions;
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>();
|
||||
shapeConfiguration->m_dimensions = dimensions;
|
||||
|
||||
AzPhysics::RigidBodyConfiguration rigidBodySettings;
|
||||
rigidBodySettings.m_computeMass = false;
|
||||
@@ -469,7 +469,7 @@ namespace PhysX
|
||||
rigidBodySettings.m_mass = 1.0f;
|
||||
rigidBodySettings.m_position = position;
|
||||
rigidBodySettings.m_linearDamping = 0.0f;
|
||||
rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration);
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
return sceneInterface->AddSimulatedBody(sceneHandle, &rigidBodySettings);
|
||||
@@ -481,13 +481,14 @@ namespace PhysX
|
||||
const AZ::Vector3& position, const AZ::Vector3& dimensions /*= AZ::Vector3(1.0f)*/,
|
||||
const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/)
|
||||
{
|
||||
Physics::ColliderConfiguration colliderConfig;
|
||||
colliderConfig.m_collisionLayer = layer;
|
||||
Physics::BoxShapeConfiguration shapeConfiguration;
|
||||
shapeConfiguration.m_dimensions = dimensions;
|
||||
auto colliderConfig = AZStd::make_shared<Physics::ColliderConfiguration>();
|
||||
colliderConfig->m_collisionLayer = layer;
|
||||
auto shapeConfiguration = AZStd::make_shared<Physics::BoxShapeConfiguration>();
|
||||
shapeConfiguration->m_dimensions = dimensions;
|
||||
|
||||
AzPhysics::StaticRigidBodyConfiguration rigidBodySettings;
|
||||
rigidBodySettings.m_position = position;
|
||||
rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration);
|
||||
rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration);
|
||||
|
||||
if (auto* sceneInterface = AZ::Interface<AzPhysics::SceneInterface>::Get())
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user