Merge branch 'development' into Atom/guthadam/shared_preview_renderer_as_interface
This commit is contained in:
@@ -148,7 +148,7 @@ class TestAllComponentsIndepthTests(object):
|
||||
golden_image_path = os.path.join(golden_images_directory(), golden_image)
|
||||
golden_images.append(golden_image_path)
|
||||
|
||||
expected_lines = ["Light component tests completed."]
|
||||
expected_lines = ["spot_light Controller|Configuration|Shadows|Shadowmap size: SUCCESS"]
|
||||
unexpected_lines = [
|
||||
"Trace::Assert",
|
||||
"Trace::Error",
|
||||
|
||||
@@ -67,5 +67,9 @@ class TestAutomation(EditorTestSuite):
|
||||
class AtomEditorComponents_PostFXLayerAdded(EditorSharedTest):
|
||||
from Atom.tests import hydra_AtomEditorComponents_PostFXLayerAdded as test_module
|
||||
|
||||
@pytest.mark.test_case_id("C36525665")
|
||||
class AtomEditorComponents_PostFXShapeWeightModifierAdded(EditorSharedTest):
|
||||
from Atom.tests import hydra_AtomEditorComponents_PostFxShapeWeightModifierAdded as test_module
|
||||
|
||||
class ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges(EditorSharedTest):
|
||||
from Atom.tests import hydra_ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges as test_module
|
||||
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
"""
|
||||
Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
|
||||
SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
"""
|
||||
|
||||
class Tests:
|
||||
creation_undo = (
|
||||
"UNDO Entity creation success",
|
||||
"UNDO Entity creation failed")
|
||||
creation_redo = (
|
||||
"REDO Entity creation success",
|
||||
"REDO Entity creation failed")
|
||||
postfx_shape_weight_creation = (
|
||||
"PostFx Shape Weight Modifier Entity successfully created",
|
||||
"PostFx Shape Weight Modifier Entity failed to be created")
|
||||
postfx_shape_weight_component = (
|
||||
"Entity has a PostFx Shape Weight Modifier component",
|
||||
"Entity failed to find PostFx Shape Weight Modifier component")
|
||||
postfx_shape_weight_disabled = (
|
||||
"PostFx Shape Weight Modifier component disabled",
|
||||
"PostFx Shape Weight Modifier component was not disabled.")
|
||||
postfx_layer_component = (
|
||||
"Entity has a PostFX Layer component",
|
||||
"Entity did not have an PostFX Layer component")
|
||||
tube_shape_component = (
|
||||
"Entity has a Tube Shape component",
|
||||
"Entity did not have a Tube Shape component")
|
||||
postfx_shape_weight_enabled = (
|
||||
"PostFx Shape Weight Modifier component enabled",
|
||||
"PostFx Shape Weight Modifier component was not enabled.")
|
||||
enter_game_mode = (
|
||||
"Entered game mode",
|
||||
"Failed to enter game mode")
|
||||
exit_game_mode = (
|
||||
"Exited game mode",
|
||||
"Couldn't exit game mode")
|
||||
is_visible = (
|
||||
"Entity is visible",
|
||||
"Entity was not visible")
|
||||
is_hidden = (
|
||||
"Entity is hidden",
|
||||
"Entity was not hidden")
|
||||
entity_deleted = (
|
||||
"Entity deleted",
|
||||
"Entity was not deleted")
|
||||
deletion_undo = (
|
||||
"UNDO deletion success",
|
||||
"UNDO deletion failed")
|
||||
deletion_redo = (
|
||||
"REDO deletion success",
|
||||
"REDO deletion failed")
|
||||
|
||||
|
||||
def AtomEditorComponents_postfx_shape_weight_AddedToEntity():
|
||||
"""
|
||||
Summary:
|
||||
Tests the PostFx Shape Weight Modifier component can be added to an entity and has the expected functionality.
|
||||
|
||||
Test setup:
|
||||
- Wait for Editor idle loop.
|
||||
- Open the "Base" level.
|
||||
|
||||
Expected Behavior:
|
||||
The component can be added, used in game mode, hidden/shown, deleted, and has accurate required components.
|
||||
Creation and deletion undo/redo should also work.
|
||||
|
||||
Test Steps:
|
||||
1) Create a PostFx Shape Weight Modifier entity with no components.
|
||||
2) Add a PostFx Shape Weight Modifier component to PostFx Shape Weight Modifier entity.
|
||||
3) UNDO the entity creation and component addition.
|
||||
4) REDO the entity creation and component addition.
|
||||
5) Verify PostFx Shape Weight Modifier component not enabled.
|
||||
6) Add PostFX Layer component since it is required by the PostFx Shape Weight Modifier component.
|
||||
7) Verify PostFx Shape Weight Modifier component is NOT enabled since it also requires a shape.
|
||||
8) Add a required shape looping over a list and checking if it enables PostFX Shape Weight Modifier.
|
||||
9) Undo to remove each added shape and verify PostFX Shape Weight Modifier is not enabled.
|
||||
10) Verify PostFx Shape Weight Modifier component is enabled by adding Spline and Tube Shape component.
|
||||
11) Enter/Exit game mode.
|
||||
12) Test IsHidden.
|
||||
13) Test IsVisible.
|
||||
14) Delete PostFx Shape Weight Modifier entity.
|
||||
15) UNDO deletion.
|
||||
16) REDO deletion.
|
||||
17) Look for errors.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
from editor_python_test_tools.editor_entity_utils import EditorEntity
|
||||
from editor_python_test_tools.utils import Report, Tracer, TestHelper
|
||||
|
||||
with Tracer() as error_tracer:
|
||||
# Test setup begins.
|
||||
# Setup: Wait for Editor idle loop before executing Python hydra scripts then open "Base" level.
|
||||
TestHelper.init_idle()
|
||||
TestHelper.open_level("", "Base")
|
||||
|
||||
# Test steps begin.
|
||||
# 1. Create a PostFx Shape Weight Modifier entity with no components.
|
||||
postfx_shape_weight_name = "PostFX Shape Weight Modifier"
|
||||
postfx_shape_weight_entity = EditorEntity.create_editor_entity(postfx_shape_weight_name)
|
||||
Report.critical_result(Tests.postfx_shape_weight_creation, postfx_shape_weight_entity.exists())
|
||||
|
||||
# 2. Add a PostFx Shape Weight Modifier component to PostFx Shape Weight Modifier entity.
|
||||
postfx_shape_weight_component = postfx_shape_weight_entity.add_component(postfx_shape_weight_name)
|
||||
Report.critical_result(
|
||||
Tests.postfx_shape_weight_component,
|
||||
postfx_shape_weight_entity.has_component(postfx_shape_weight_name))
|
||||
|
||||
# 3. UNDO the entity creation and component addition.
|
||||
# -> UNDO component addition.
|
||||
general.undo()
|
||||
# -> UNDO naming entity.
|
||||
general.undo()
|
||||
# -> UNDO selecting entity.
|
||||
general.undo()
|
||||
# -> UNDO entity creation.
|
||||
general.undo()
|
||||
general.idle_wait_frames(1)
|
||||
Report.result(Tests.creation_undo, not postfx_shape_weight_entity.exists())
|
||||
|
||||
# 4. REDO the entity creation and component addition.
|
||||
# -> REDO entity creation.
|
||||
general.redo()
|
||||
# -> REDO selecting entity.
|
||||
general.redo()
|
||||
# -> REDO naming entity.
|
||||
general.redo()
|
||||
# -> REDO component addition.
|
||||
general.redo()
|
||||
general.idle_wait_frames(1)
|
||||
Report.result(Tests.creation_redo, postfx_shape_weight_entity.exists())
|
||||
|
||||
# 5. Verify PostFx Shape Weight Modifier component not enabled.
|
||||
Report.result(Tests.postfx_shape_weight_disabled, not postfx_shape_weight_component.is_enabled())
|
||||
|
||||
# 6. Add PostFX Layer component since it is required by the PostFx Shape Weight Modifier component.
|
||||
postfx_layer_name = "PostFX Layer"
|
||||
postfx_shape_weight_entity.add_component(postfx_layer_name)
|
||||
Report.result(Tests.postfx_layer_component, postfx_shape_weight_entity.has_component(postfx_layer_name))
|
||||
|
||||
# 7. Verify PostFx Shape Weight Modifier component is NOT enabled since it also requires a shape.
|
||||
Report.result(Tests.postfx_shape_weight_disabled, not postfx_shape_weight_component.is_enabled())
|
||||
|
||||
# 8. Add a required shape looping over a list and checking if it enables PostFX Shape Weight Modifier.
|
||||
for shape in ['Axis Aligned Box Shape', 'Box Shape', 'Capsule Shape', 'Compound Shape', 'Cylinder Shape',
|
||||
'Disk Shape', 'Polygon Prism Shape', 'Quad Shape', 'Sphere Shape', 'Vegetation Reference Shape']:
|
||||
postfx_shape_weight_entity.add_component(shape)
|
||||
test_shape = (
|
||||
f"Entity has a {shape} component",
|
||||
f"Entity did not have a {shape} component")
|
||||
Report.result(test_shape, postfx_shape_weight_entity.has_component(shape))
|
||||
|
||||
# Check if required shape allows PostFX Shape Weight Modifier to be enabled
|
||||
Report.result(Tests.postfx_shape_weight_enabled, postfx_shape_weight_component.is_enabled())
|
||||
|
||||
# 9. Undo to remove each added shape and verify PostFX Shape Weight Modifier is not enabled.
|
||||
general.undo()
|
||||
TestHelper.wait_for_condition(lambda: not postfx_shape_weight_entity.has_component(shape), 1.0)
|
||||
Report.result(Tests.postfx_shape_weight_disabled, not postfx_shape_weight_component.is_enabled())
|
||||
|
||||
# 10. Verify PostFx Shape Weight Modifier component is enabled by adding Spline and Tube Shape component.
|
||||
postfx_shape_weight_entity.add_components(['Spline', 'Tube Shape'])
|
||||
Report.result(Tests.tube_shape_component, postfx_shape_weight_entity.has_component('Tube Shape'))
|
||||
Report.result(Tests.postfx_shape_weight_enabled, postfx_shape_weight_component.is_enabled())
|
||||
|
||||
# 11. Enter/Exit game mode.
|
||||
TestHelper.enter_game_mode(Tests.enter_game_mode)
|
||||
general.idle_wait_frames(1)
|
||||
TestHelper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 12. Test IsHidden.
|
||||
postfx_shape_weight_entity.set_visibility_state(False)
|
||||
Report.result(Tests.is_hidden, postfx_shape_weight_entity.is_hidden() is True)
|
||||
|
||||
# 13. Test IsVisible.
|
||||
postfx_shape_weight_entity.set_visibility_state(True)
|
||||
general.idle_wait_frames(1)
|
||||
Report.result(Tests.is_visible, postfx_shape_weight_entity.is_visible() is True)
|
||||
|
||||
# 14. Delete PostFx Shape Weight Modifier entity.
|
||||
postfx_shape_weight_entity.delete()
|
||||
Report.result(Tests.entity_deleted, not postfx_shape_weight_entity.exists())
|
||||
|
||||
# 15. UNDO deletion.
|
||||
general.undo()
|
||||
Report.result(Tests.deletion_undo, postfx_shape_weight_entity.exists())
|
||||
|
||||
# 16. REDO deletion.
|
||||
general.redo()
|
||||
Report.result(Tests.deletion_redo, not postfx_shape_weight_entity.exists())
|
||||
|
||||
# 17. Look for errors or asserts.
|
||||
TestHelper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0)
|
||||
for error_info in error_tracer.errors:
|
||||
Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}")
|
||||
for assert_info in error_tracer.asserts:
|
||||
Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from editor_python_test_tools.utils import Report
|
||||
Report.start_test(AtomEditorComponents_postfx_shape_weight_AddedToEntity)
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"description": "",
|
||||
"materialType": "Materials/Types/Skin.materialtype",
|
||||
"parentMaterial": "",
|
||||
"propertyLayoutVersion": 3,
|
||||
"properties": {
|
||||
"wrinkleLayers": {
|
||||
"count": 3,
|
||||
"enable": true,
|
||||
"showBlendValues": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:53e17ec8155911c8b42e85436130f600bd6dddd8931a8ccb1b2f8a9f8674cc85
|
||||
size 45104
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0da56a05daa0ec1c476cfe25ca6d3b65267c98886cf33408f6e852fb325a8e2c
|
||||
size 198084
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e3537fbe9205731a242251c525a67bbb5f3b8f5307537f1dc0c318b5b885ce52
|
||||
size 198112
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bd794d5dd4b749c3275bfab79b9b5ae3f8e007d3e6741c0566c9c2d3931123bf
|
||||
size 198112
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:45ded862987a64061deffd8e4c9aa1dff4eec3bcff5f7b505679f1959e8ae137
|
||||
size 51440
|
||||
@@ -57,6 +57,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/Terrain/TerrainDataRequestBus.h>
|
||||
#include <AzFramework/ProjectManager/ProjectManager.h>
|
||||
#include <AzFramework/Spawnable/RootSpawnableInterface.h>
|
||||
|
||||
// AzToolsFramework
|
||||
#include <AzToolsFramework/Component/EditorComponentAPIBus.h>
|
||||
@@ -3021,6 +3022,15 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam
|
||||
bool bIsDocModified = GetIEditor()->GetDocument()->IsModified();
|
||||
OnSwitchPhysics();
|
||||
GetIEditor()->GetDocument()->SetModifiedFlag(bIsDocModified);
|
||||
|
||||
if (usePrefabSystemForLevels)
|
||||
{
|
||||
auto* rootSpawnableInterface = AzFramework::RootSpawnableInterface::Get();
|
||||
if (rootSpawnableInterface)
|
||||
{
|
||||
rootSpawnableInterface->ProcessSpawnableQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QScopedValueRollback<bool> rollback(m_creatingNewLevel);
|
||||
|
||||
@@ -1195,7 +1195,7 @@ bool CFileUtil::IsFileExclusivelyAccessable(const QString& strFilePath)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CFileUtil::CreatePath(const QString& strPath)
|
||||
{
|
||||
#if defined(AZ_PLATFORM_MAC)
|
||||
#if !AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS
|
||||
bool pathCreated = true;
|
||||
|
||||
QString cleanPath = QDir::cleanPath(strPath);
|
||||
@@ -1252,7 +1252,7 @@ bool CFileUtil::CreatePath(const QString& strPath)
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
#endif // !AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -15,7 +15,7 @@ using namespace Intersect;
|
||||
// IntersectSegmentTriangleCCW
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int Intersect::IntersectSegmentTriangleCCW(
|
||||
bool Intersect::IntersectSegmentTriangleCCW(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c,
|
||||
/*float &u, float &v, float &w,*/ Vector3& normal, float& t)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ int Intersect::IntersectSegmentTriangleCCW(
|
||||
float d = qp.Dot(normal);
|
||||
if (d <= 0.0f)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compute intersection t value of pq with plane of triangle. A ray
|
||||
@@ -46,7 +46,7 @@ int Intersect::IntersectSegmentTriangleCCW(
|
||||
// range segment check t[0,1] (it this case [0,d])
|
||||
if (t < 0.0f || t > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compute barycentric coordinate components and test if within bounds
|
||||
@@ -54,12 +54,12 @@ int Intersect::IntersectSegmentTriangleCCW(
|
||||
v = ac.Dot(e);
|
||||
if (v < 0.0f || v > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
w = -ab.Dot(e);
|
||||
if (w < 0.0f || v + w > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Segment/ray intersects triangle. Perform delayed division and
|
||||
@@ -72,14 +72,14 @@ int Intersect::IntersectSegmentTriangleCCW(
|
||||
|
||||
normal.Normalize();
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// IntersectSegmentTriangle
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
bool
|
||||
Intersect::IntersectSegmentTriangle(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c,
|
||||
/*float &u, float &v, float &w,*/ Vector3& normal, float& t)
|
||||
@@ -111,7 +111,7 @@ Intersect::IntersectSegmentTriangle(
|
||||
// so either have a parallel ray or our normal is flipped
|
||||
if (d >= -Constants::FloatEpsilon)
|
||||
{
|
||||
return 0; // parallel
|
||||
return false; // parallel
|
||||
}
|
||||
d = -d;
|
||||
e = ap.Cross(qp);
|
||||
@@ -125,19 +125,19 @@ Intersect::IntersectSegmentTriangle(
|
||||
// range segment check t[0,1] (it this case [0,d])
|
||||
if (t < 0.0f || t > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compute barycentric coordinate components and test if within bounds
|
||||
v = ac.Dot(e);
|
||||
if (v < 0.0f || v > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
w = -ab.Dot(e);
|
||||
if (w < 0.0f || v + w > d)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Segment/ray intersects the triangle. Perform delayed division and
|
||||
@@ -150,14 +150,14 @@ Intersect::IntersectSegmentTriangle(
|
||||
|
||||
normal.Normalize();
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// TestSegmentAABBOrigin
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
bool
|
||||
AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends)
|
||||
{
|
||||
const Vector3 EPSILON(0.001f); // \todo this is slow load move to a const
|
||||
@@ -168,7 +168,7 @@ AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& hal
|
||||
// Try world coordinate axes as separating axes
|
||||
if (!absMidpoint.IsLessEqualThan(absHalfMidpoint))
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add in an epsilon term to counteract arithmetic errors when segment is
|
||||
@@ -188,11 +188,11 @@ AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& hal
|
||||
Vector3 ead(ey * adz + ez * ady, ex * adz + ez * adx, ex * ady + ey * adx);
|
||||
if (!absMDCross.IsLessEqualThan(ead))
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// No separating axis found; segment must be overlapping AABB
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& hal
|
||||
// IntersectRayAABB
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
RayAABBIsectTypes
|
||||
AZ::Intersect::IntersectRayAABB(
|
||||
const Vector3& rayStart, const Vector3& dir, const Vector3& dirRCP, const Aabb& aabb,
|
||||
float& tStart, float& tEnd, Vector3& startNormal /*, Vector3& inter*/)
|
||||
@@ -356,7 +356,7 @@ AZ::Intersect::IntersectRayAABB(
|
||||
// IntersectRayAABB2
|
||||
// [2/18/2011]
|
||||
//=========================================================================
|
||||
int
|
||||
RayAABBIsectTypes
|
||||
AZ::Intersect::IntersectRayAABB2(const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end)
|
||||
{
|
||||
float tmin, tmax, tymin, tymax, tzmin, tzmax;
|
||||
@@ -408,7 +408,7 @@ AZ::Intersect::IntersectRayAABB2(const Vector3& rayStart, const Vector3& dirRCP,
|
||||
return ISECT_RAY_AABB_ISECT;
|
||||
}
|
||||
|
||||
int AZ::Intersect::IntersectRayDisk(
|
||||
bool AZ::Intersect::IntersectRayDisk(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& diskCenter, const float diskRadius, const Vector3& diskNormal, float& t)
|
||||
{
|
||||
// First intersect with the plane of the disk
|
||||
@@ -421,10 +421,10 @@ int AZ::Intersect::IntersectRayDisk(
|
||||
if (pointOnPlane.GetDistance(diskCenter) < diskRadius)
|
||||
{
|
||||
t = planeIntersectionDistance;
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder, and the book's errata.
|
||||
@@ -1012,7 +1012,7 @@ int AZ::Intersect::IntersectRayQuad(
|
||||
}
|
||||
|
||||
// reference: Real-Time Collision Detection, 5.3.3 Intersecting Ray or Segment Against Box
|
||||
int AZ::Intersect::IntersectRayBox(
|
||||
bool AZ::Intersect::IntersectRayBox(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& boxCenter, const Vector3& boxAxis1,
|
||||
const Vector3& boxAxis2, const Vector3& boxAxis3, float boxHalfExtent1, float boxHalfExtent2, float boxHalfExtent3, float& t)
|
||||
{
|
||||
@@ -1044,7 +1044,7 @@ int AZ::Intersect::IntersectRayBox(
|
||||
// If the ray is parallel to the slab and the ray origin is outside, return no intersection.
|
||||
if (tp < 0.0f || tn < 0.0f)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1065,7 +1065,7 @@ int AZ::Intersect::IntersectRayBox(
|
||||
tmax = AZ::GetMin(tmax, t2);
|
||||
if (tmin > tmax)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1085,7 +1085,7 @@ int AZ::Intersect::IntersectRayBox(
|
||||
// If the ray is parallel to the slab and the ray origin is outside, return no intersection.
|
||||
if (tp < 0.0f || tn < 0.0f)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1106,7 +1106,7 @@ int AZ::Intersect::IntersectRayBox(
|
||||
tmax = AZ::GetMin(tmax, t2);
|
||||
if (tmin > tmax)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ int AZ::Intersect::IntersectRayBox(
|
||||
// If the ray is parallel to the slab and the ray origin is outside, return no intersection.
|
||||
if (tp < 0.0f || tn < 0.0f)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1147,15 +1147,15 @@ int AZ::Intersect::IntersectRayBox(
|
||||
tmax = AZ::GetMin(tmax, t2);
|
||||
if (tmin > tmax)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
t = (isRayOriginInsideBox ? tmax : tmin);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
int AZ::Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t)
|
||||
bool AZ::Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t)
|
||||
{
|
||||
return AZ::Intersect::IntersectRayBox(rayOrigin, rayDir, obb.GetPosition(),
|
||||
obb.GetAxisX(), obb.GetAxisY(), obb.GetAxisZ(),
|
||||
@@ -1166,7 +1166,7 @@ int AZ::Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayD
|
||||
// IntersectSegmentCylinder
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
CylinderIsectTypes
|
||||
AZ::Intersect::IntersectSegmentCylinder(
|
||||
const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t)
|
||||
{
|
||||
@@ -1225,7 +1225,7 @@ AZ::Intersect::IntersectSegmentCylinder(
|
||||
return RR_ISECT_RAY_CYL_NONE; // No real roots; no intersection
|
||||
}
|
||||
t = (-b - Sqrt(discr)) / a;
|
||||
int result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment
|
||||
CylinderIsectTypes result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment
|
||||
|
||||
if (md + t * nd < 0.0f)
|
||||
{
|
||||
@@ -1294,7 +1294,7 @@ AZ::Intersect::IntersectSegmentCylinder(
|
||||
// IntersectSegmentCapsule
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
CapsuleIsectTypes
|
||||
AZ::Intersect::IntersectSegmentCapsule(const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t)
|
||||
{
|
||||
int result = IntersectSegmentCylinder(sa, dir, p, q, r, t);
|
||||
@@ -1361,13 +1361,13 @@ AZ::Intersect::IntersectSegmentCapsule(const Vector3& sa, const Vector3& dir, co
|
||||
// IntersectSegmentPolyhedron
|
||||
// [10/21/2009]
|
||||
//=========================================================================
|
||||
int
|
||||
bool
|
||||
AZ::Intersect::IntersectSegmentPolyhedron(
|
||||
const Vector3& sa, const Vector3& sBA, const Plane p[], int numPlanes,
|
||||
const Vector3& sa, const Vector3& dir, const Plane p[], int numPlanes,
|
||||
float& tfirst, float& tlast, int& iFirstPlane, int& iLastPlane)
|
||||
{
|
||||
// Compute direction vector for the segment
|
||||
Vector3 d = /*b - a*/ sBA;
|
||||
Vector3 d = /*b - a*/ dir;
|
||||
// Set initial interval to being the whole segment. For a ray, tlast should be
|
||||
// set to +RR_FLT_MAX. For a line, additionally tfirst should be set to -RR_FLT_MAX
|
||||
tfirst = 0.0f;
|
||||
@@ -1388,7 +1388,7 @@ AZ::Intersect::IntersectSegmentPolyhedron(
|
||||
// If so, return "no intersection" if segment lies outside plane
|
||||
if (dist < 0.0f)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1417,7 +1417,7 @@ AZ::Intersect::IntersectSegmentPolyhedron(
|
||||
// Exit with "no intersection" if intersection becomes empty
|
||||
if (tfirst > tlast)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1425,11 +1425,11 @@ AZ::Intersect::IntersectSegmentPolyhedron(
|
||||
//DBG_Assert(iFirstPlane!=-1&&iLastPlane!=-1,("We have some bad border case to have only one plane, fix this function!"));
|
||||
if (iFirstPlane == -1 && iLastPlane == -1)
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// A nonzero logical intersection, so the segment intersects the polyhedron
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
@@ -1442,7 +1442,7 @@ AZ::Intersect::ClosestSegmentSegment(
|
||||
const Vector3& segment2Start, const Vector3& segment2End,
|
||||
float& segment1Proportion, float& segment2Proportion,
|
||||
Vector3& closestPointSegment1, Vector3& closestPointSegment2,
|
||||
float epsilon /*= 1e-4f*/ )
|
||||
float epsilon)
|
||||
{
|
||||
const Vector3 segment1 = segment1End - segment1Start;
|
||||
const Vector3 segment2 = segment2End - segment2Start;
|
||||
|
||||
@@ -5,363 +5,398 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#ifndef AZCORE_MATH_SEGMENT_INTERSECTION_H
|
||||
#define AZCORE_MATH_SEGMENT_INTERSECTION_H
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Math/Aabb.h>
|
||||
#include <AzCore/Math/Obb.h>
|
||||
#include <AzCore/Math/Plane.h>
|
||||
|
||||
/// \file isect_segment.h
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Intersect
|
||||
{
|
||||
//! LineToPointDistanceTime computes the time of the shortest distance from point 'p' to segment (s1,s2).
|
||||
//! To calculate the point of intersection:
|
||||
//! P = s1 + u (s2 - s1)
|
||||
//! @param s1 segment start point
|
||||
//! @param s2 segment end point
|
||||
//! @param p point to find the closest time to.
|
||||
//! @return time (on the segment) for the shortest distance from 'p' to (s1,s2) [0.0f (s1),1.0f (s2)]
|
||||
inline float LineToPointDistanceTime(const Vector3& s1, const Vector3& s21, const Vector3& p)
|
||||
{
|
||||
// so u = (p.x - s1.x)*(s2.x - s1.x) + (p.y - s1.y)*(s2.y - s1.y) + (p.z-s1.z)*(s2.z-s1.z) / |s2-s1|^2
|
||||
return s21.Dot(p - s1) / s21.Dot(s21);
|
||||
}
|
||||
//! To calculate the point of intersection: P = s1 + u (s2 - s1)
|
||||
//! @param s1 Segment start point.
|
||||
//! @param s2 Segment end point.
|
||||
//! @param p Point to find the closest time to.
|
||||
//! @return Time (on the segment) for the shortest distance from 'p' to (s1,s2) [0.0f (s1),1.0f (s2)]
|
||||
float LineToPointDistanceTime(const Vector3& s1, const Vector3& s21, const Vector3& p);
|
||||
|
||||
//! LineToPointDistance computes the closest point to 'p' from a segment (s1,s2).
|
||||
//! @param s1 segment start point
|
||||
//! @param s2 segment end point
|
||||
//! @param p point to find the closest time to.
|
||||
//! @param u time (on the segment) for the shortest distance from 'p' to (s1,s2) [0.0f (s1),1.0f (s2)]
|
||||
//! @return the closest point
|
||||
inline Vector3 LineToPointDistance(const Vector3& s1, const Vector3& s2, const Vector3& p, float& u)
|
||||
{
|
||||
const Vector3 s21 = s2 - s1;
|
||||
// we assume seg1 and seg2 are NOT coincident
|
||||
AZ_MATH_ASSERT(!s21.IsClose(Vector3(0.0f), 1e-4f), "OK we agreed that we will pass valid segments! (s1 != s2)");
|
||||
|
||||
u = LineToPointDistanceTime(s1, s21, p);
|
||||
|
||||
return s1 + u * s21;
|
||||
}
|
||||
//! @param s1 Segment start point
|
||||
//! @param s2 Segment end point
|
||||
//! @param p Point to find the closest time to.
|
||||
//! @param u Time (on the segment) for the shortest distance from 'p' to (s1,s2) [0.0f (s1),1.0f (s2)]
|
||||
//! @return The closest point
|
||||
Vector3 LineToPointDistance(const Vector3& s1, const Vector3& s2, const Vector3& p, float& u);
|
||||
|
||||
//! Given segment pq and triangle abc (CCW), returns whether segment intersects
|
||||
//! triangle and if so, also returns the barycentric coordinates (u,v,w)
|
||||
//! of the intersection point.
|
||||
//! @param p segment start point
|
||||
//! @param q segment end point
|
||||
//! @param a triangle point 1
|
||||
//! @param b triangle point 2
|
||||
//! @param c triangle point 3
|
||||
//! @param normal at the intersection point.
|
||||
//! @param t time of intersection along the segment [0.0 (p), 1.0 (q)]
|
||||
//! @return 1 if the segment intersects the triangle otherwise 0
|
||||
int IntersectSegmentTriangleCCW(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c,
|
||||
/*float &u, float &v, float &w,*/ Vector3& normal, float& t);
|
||||
//! @param p Segment start point.
|
||||
//! @param q Segment end point.
|
||||
//! @param a Triangle point 1.
|
||||
//! @param b Triangle point 2.
|
||||
//! @param c Triangle point 3.
|
||||
//! @param normal At the intersection point.
|
||||
//! @param t Time of intersection along the segment [0.0 (p), 1.0 (q)].
|
||||
//! @return true if the segments intersects the triangle otherwise false.
|
||||
bool IntersectSegmentTriangleCCW(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, Vector3& normal, float& t);
|
||||
|
||||
//! Same as \ref IntersectSegmentTriangleCCW without respecting the triangle (a,b,c) vertex order (double sided).
|
||||
int IntersectSegmentTriangle(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c,
|
||||
/*float &u, float &v, float &w,*/ Vector3& normal, float& t);
|
||||
//! @param p Segment start point.
|
||||
//! @param q Segment end point.
|
||||
//! @param a Triangle point 1.
|
||||
//! @param b Triangle point 2.
|
||||
//! @param c Triangle point 3.
|
||||
//! @param normal At the intersection point.
|
||||
//! @param t Time of intersection along the segment [0.0 (p), 1.0 (q)].
|
||||
//! @return True if the segments intersects the triangle otherwise false.
|
||||
bool IntersectSegmentTriangle(
|
||||
const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, Vector3& normal, float& t);
|
||||
|
||||
//! Ray aabb intersection result types.
|
||||
enum RayAABBIsectTypes
|
||||
enum RayAABBIsectTypes : AZ::s32
|
||||
{
|
||||
ISECT_RAY_AABB_NONE = 0, ///< no intersection
|
||||
ISECT_RAY_AABB_SA_INSIDE, ///< the ray starts inside the aabb
|
||||
ISECT_RAY_AABB_ISECT, ///< intersects along the PQ segment
|
||||
ISECT_RAY_AABB_NONE = 0, ///< no intersection
|
||||
ISECT_RAY_AABB_SA_INSIDE, ///< the ray starts inside the aabb
|
||||
ISECT_RAY_AABB_ISECT, ///< intersects along the PQ segment
|
||||
};
|
||||
|
||||
//! Intersect ray R(t) = rayStart + t*d against AABB a. When intersecting,
|
||||
//! return intersection distance tmin and point q of intersection.
|
||||
//! @param rayStart ray starting point
|
||||
//! @param dir ray direction and length (dir = rayEnd - rayStart)
|
||||
//! @param dirRCP 1/dir (reciprocal direction - we cache this result very often so we don't need to compute it multiple times, otherwise just use dir.GetReciprocal())
|
||||
//! @param rayStart Ray starting point
|
||||
//! @param dir Ray direction and length (dir = rayEnd - rayStart)
|
||||
//! @param dirRCP 1/dir (reciprocal direction - we cache this result very often so we don't need to compute it multiple times,
|
||||
//! otherwise just use dir.GetReciprocal())
|
||||
//! @param aabb Axis aligned bounding box to intersect against
|
||||
//! @param tStart time on ray of the first intersection [0,1] or 0 if the ray starts inside the aabb - check the return value
|
||||
//! @param tEnd time of the of the second intersection [0,1] (it can be > 1 if intersects after the rayEnd)
|
||||
//! @param startNormal normal at the start point.
|
||||
//! @param tStart Time on ray of the first intersection [0,1] or 0 if the ray starts inside the aabb - check the return value
|
||||
//! @param tEnd Time of the of the second intersection [0,1] (it can be > 1 if intersects after the rayEnd)
|
||||
//! @param startNormal Normal at the start point.
|
||||
//! @return \ref RayAABBIsectTypes
|
||||
int IntersectRayAABB(
|
||||
const Vector3& rayStart, const Vector3& dir, const Vector3& dirRCP, const Aabb& aabb,
|
||||
float& tStart, float& tEnd, Vector3& startNormal /*, Vector3& inter*/);
|
||||
RayAABBIsectTypes IntersectRayAABB(
|
||||
const Vector3& rayStart,
|
||||
const Vector3& dir,
|
||||
const Vector3& dirRCP,
|
||||
const Aabb& aabb,
|
||||
float& tStart,
|
||||
float& tEnd,
|
||||
Vector3& startNormal);
|
||||
|
||||
//! Intersect ray against AABB.
|
||||
//! @param rayStart ray starting point.
|
||||
//! @param dir ray reciprocal direction.
|
||||
//! @param rayStart Ray starting point.
|
||||
//! @param dir Ray reciprocal direction.
|
||||
//! @param aabb Axis aligned bounding box to intersect against.
|
||||
//! @param start length on ray of the first intersection.
|
||||
//! @param end length of the of the second intersection.
|
||||
//! @return \ref RayAABBIsectTypes In this faster version than IntersectRayAABB we return only ISECT_RAY_AABB_NONE and ISECT_RAY_AABB_ISECT.
|
||||
//! You can check yourself for that case.
|
||||
int IntersectRayAABB2(
|
||||
const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb,
|
||||
float& start, float& end);
|
||||
//! @param start Length on ray of the first intersection.
|
||||
//! @param end Length of the of the second intersection.
|
||||
//! @return \ref RayAABBIsectTypes In this faster version than IntersectRayAABB we return only ISECT_RAY_AABB_NONE and
|
||||
//! ISECT_RAY_AABB_ISECT. You can check yourself for that case.
|
||||
RayAABBIsectTypes IntersectRayAABB2(const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end);
|
||||
|
||||
//! Clip a ray to an aabb. return true if ray was clipped. The ray
|
||||
//! can be inside so don't use the result if the ray intersect the box.
|
||||
inline int ClipRayWithAabb(
|
||||
const Aabb& aabb, Vector3& rayStart, Vector3& rayEnd, float& tClipStart, float& tClipEnd)
|
||||
{
|
||||
Vector3 startNormal;
|
||||
float tStart, tEnd;
|
||||
Vector3 dirLen = rayEnd - rayStart;
|
||||
if (IntersectRayAABB(rayStart, dirLen, dirLen.GetReciprocal(), aabb, tStart, tEnd, startNormal) != ISECT_RAY_AABB_NONE)
|
||||
{
|
||||
// clip the ray with the box
|
||||
if (tStart > 0.0f)
|
||||
{
|
||||
rayStart = rayStart + tStart * dirLen;
|
||||
tClipStart = tStart;
|
||||
}
|
||||
if (tEnd < 1.0f)
|
||||
{
|
||||
rayEnd = rayStart + tEnd * dirLen;
|
||||
tClipEnd = tEnd;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
//! @param aabb Bounds to test against.
|
||||
//! @param rayStart The start of the ray.
|
||||
//! @param rayEnd The end of the ray.
|
||||
//! @param[out] tClipStart The proportion where the ray enters the \ref Aabb.
|
||||
//! @param[out] tClipEnd The proportion where the ray exits the \ref Aabb.
|
||||
//! @return True if the ray was clipped, otherwise false.
|
||||
bool ClipRayWithAabb(const Aabb& aabb, Vector3& rayStart, Vector3& rayEnd, float& tClipStart, float& tClipEnd);
|
||||
|
||||
//! Test segment and aabb where the segment is defined by midpoint
|
||||
//! midPoint = (p1-p0) * 0.5f and half vector halfVector = p1 - midPoint.
|
||||
//! the aabb is at the origin and defined by half extents only.
|
||||
//! @return 1 if the intersect, otherwise 0.
|
||||
int TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends);
|
||||
//! @param midPoint Midpoint of a line segment.
|
||||
//! @param halfVector Half vector of an aabb.
|
||||
//! @param aabbExtends The extends of a bounded box.
|
||||
//! @return True if the segment and AABB intersect, otherwise false
|
||||
bool TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends);
|
||||
|
||||
//! Test if segment specified by points p0 and p1 intersects AABB. \ref TestSegmentAABBOrigin
|
||||
//! @return 1 if the segment and AABB intersect, otherwise 0.
|
||||
inline int TestSegmentAABB(const Vector3& p0, const Vector3& p1, const Aabb& aabb)
|
||||
{
|
||||
Vector3 e = aabb.GetExtents();
|
||||
Vector3 d = p1 - p0;
|
||||
Vector3 m = p0 + p1 - aabb.GetMin() - aabb.GetMax();
|
||||
|
||||
return TestSegmentAABBOrigin(m, d, e);
|
||||
}
|
||||
//! Test if segment specified by points p0 and p1 intersects AABB. \ref TestSegmentAABBOrigin.
|
||||
//! @param p0 Segment start point.
|
||||
//! @param p1 Segment end point.
|
||||
//! @param aabb Bounded box to test against.
|
||||
//! @return True if the segment and AABB intersect, otherwise false.
|
||||
bool TestSegmentAABB(const Vector3& p0, const Vector3& p1, const Aabb& aabb);
|
||||
|
||||
//! Ray sphere intersection result types.
|
||||
enum SphereIsectTypes
|
||||
enum SphereIsectTypes : AZ::s32
|
||||
{
|
||||
ISECT_RAY_SPHERE_SA_INSIDE = -1, // the ray starts inside the cylinder
|
||||
ISECT_RAY_SPHERE_NONE, // no intersection
|
||||
ISECT_RAY_SPHERE_ISECT, // along the PQ segment
|
||||
ISECT_RAY_SPHERE_SA_INSIDE = -1, //!< The ray starts inside the cylinder
|
||||
ISECT_RAY_SPHERE_NONE, //!< No intersection
|
||||
ISECT_RAY_SPHERE_ISECT, //!< Along the PQ segment
|
||||
};
|
||||
|
||||
//! IntersectRaySphereOrigin
|
||||
//! return time t>=0 but not limited, so if you check a segment make sure
|
||||
//! t <= segmentLen
|
||||
//! @param rayStart ray start point
|
||||
//! t <= segmentLen.
|
||||
//! @param rayStart ray start point.
|
||||
//! @param rayDirNormalized ray direction normalized.
|
||||
//! @param shereRadius sphere radius
|
||||
//! @param shereRadius Radius of sphere at origin.
|
||||
//! @param time of closest intersection [0,+INF] in relation to the normalized direction.
|
||||
//! @return \ref SphereIsectTypes
|
||||
AZ_INLINE int IntersectRaySphereOrigin(
|
||||
const Vector3& rayStart, const Vector3& rayDirNormalized,
|
||||
const float sphereRadius, float& t)
|
||||
{
|
||||
Vector3 m = rayStart;
|
||||
float b = m.Dot(rayDirNormalized);
|
||||
float c = m.Dot(m) - sphereRadius * sphereRadius;
|
||||
|
||||
// Exit if r's origin outside s (c > 0)and r pointing away from s (b > 0)
|
||||
if (c > 0.0f && b > 0.0f)
|
||||
{
|
||||
return ISECT_RAY_SPHERE_NONE;
|
||||
}
|
||||
float discr = b * b - c;
|
||||
// A negative discriminant corresponds to ray missing sphere
|
||||
if (discr < 0.0f)
|
||||
{
|
||||
return ISECT_RAY_SPHERE_NONE;
|
||||
}
|
||||
|
||||
// Ray now found to intersect sphere, compute smallest t value of intersection
|
||||
t = -b - Sqrt(discr);
|
||||
|
||||
// If t is negative, ray started inside sphere so clamp t to zero
|
||||
if (t < 0.0f)
|
||||
{
|
||||
// t = 0.0f;
|
||||
return ISECT_RAY_SPHERE_SA_INSIDE; // no hit if inside
|
||||
}
|
||||
//q = p + t * d;
|
||||
return ISECT_RAY_SPHERE_ISECT;
|
||||
}
|
||||
//! @return \ref SphereIsectTypes.
|
||||
SphereIsectTypes IntersectRaySphereOrigin(
|
||||
const Vector3& rayStart, const Vector3& rayDirNormalized, const float sphereRadius, float& t);
|
||||
|
||||
//! Intersect ray (rayStart,rayDirNormalized) and sphere (sphereCenter,sphereRadius) \ref IntersectRaySphereOrigin
|
||||
inline int IntersectRaySphere(
|
||||
const Vector3& rayStart, const Vector3& rayDirNormalized, const Vector3& sphereCenter, const float sphereRadius, float& t)
|
||||
{
|
||||
return IntersectRaySphereOrigin(rayStart - sphereCenter, rayDirNormalized, sphereRadius, t);
|
||||
}
|
||||
//! @param rayStart The start of the ray.
|
||||
//! @param rayDirNormalized The direction of the ray normalized.
|
||||
//! @param sphereCenter The center of the sphere.
|
||||
//! @param sphereRadius Radius of the sphere.
|
||||
//! @param[out] t Coefficient in the ray's explicit equation from which an
|
||||
//! intersecting point is calculated as "rayOrigin + t1 * rayDir".
|
||||
//! @return SphereIsectTypes
|
||||
SphereIsectTypes IntersectRaySphere(
|
||||
const Vector3& rayStart, const Vector3& rayDirNormalized, const Vector3& sphereCenter, const float sphereRadius, float& t);
|
||||
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param diskCenter Center point of the disk
|
||||
//! @param diskRadius Radius of the disk
|
||||
//! @param diskNormal A normal perpendicular to the disk
|
||||
//! @param[out] t If returning 1 (indicating a hit), this contains distance from rayOrigin along the normalized rayDir that the hit occured at.
|
||||
//! @return The number of intersecting points.
|
||||
int IntersectRayDisk(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& diskCenter, const float diskRadius, const AZ::Vector3& diskNormal, float& t);
|
||||
//! Intersect ray (rayStarty, rayDirNormalized) and disk (center, radius, normal)
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param diskCenter Center point of the disk.
|
||||
//! @param diskRadius Radius of the disk.
|
||||
//! @param diskNormal A normal perpendicular to the disk.
|
||||
//! @param[out] t If returning 1 (indicating a hit), this contains distance from rayOrigin along the normalized rayDir
|
||||
//! that the hit occured at.
|
||||
//! @return False if not interesecting and true if intersecting
|
||||
bool IntersectRayDisk(
|
||||
const Vector3& rayOrigin,
|
||||
const Vector3& rayDir,
|
||||
const Vector3& diskCenter,
|
||||
const float diskRadius,
|
||||
const AZ::Vector3& diskNormal,
|
||||
float& t);
|
||||
|
||||
//! If there is only one intersecting point, the coefficient is stored in \ref t1.
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param cylinderEnd1 The center of the circle on one end of the cylinder.
|
||||
//! @param cylinderDir The direction pointing from \ref cylinderEnd1 to the other end of the cylinder. It has to be unit length.
|
||||
//! @param cylinderHeight The distance between two centers of the circles on two ends of the cylinder respectively.
|
||||
//! @param[out] t1 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t1 * rayDir".
|
||||
//! @param[out] t2 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t2 * rayDir".
|
||||
//! @return The number of intersecting points.
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param cylinderEnd1 The center of the circle on one end of the cylinder.
|
||||
//! @param cylinderDir The direction pointing from \ref cylinderEnd1 to the other end of the cylinder. It has to be unit length.
|
||||
//! @param cylinderHeight The distance between two centers of the circles on two ends of the cylinder respectively.
|
||||
//! @param[out] t1 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t1 * rayDir".
|
||||
//! @param[out] t2 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t2 * rayDir".
|
||||
//! @return The number of intersecting points.
|
||||
int IntersectRayCappedCylinder(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir,
|
||||
const Vector3& cylinderEnd1, const Vector3& cylinderDir, float cylinderHeight, float cylinderRadius,
|
||||
float& t1, float& t2);
|
||||
const Vector3& rayOrigin,
|
||||
const Vector3& rayDir,
|
||||
const Vector3& cylinderEnd1,
|
||||
const Vector3& cylinderDir,
|
||||
float cylinderHeight,
|
||||
float cylinderRadius,
|
||||
float& t1,
|
||||
float& t2);
|
||||
|
||||
//! If there is only one intersecting point, the coefficient is stored in \ref t1.
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param coneApex The apex of the cone.
|
||||
//! @param coneDir The unit-length direction from the apex to the base.
|
||||
//! @param coneHeight The height of the cone, from the apex to the base.
|
||||
//! @param coneBaseRadius The radius of the cone base circle.
|
||||
//! @param[out] t1 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t1 * rayDir".
|
||||
//! @param[out] t2 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t2 * rayDir".
|
||||
//! @return The number of intersecting points.
|
||||
//! @param rayOrigin The origin of the ray to test.
|
||||
//! @param rayDir The direction of the ray to test. It has to be unit length.
|
||||
//! @param coneApex The apex of the cone.
|
||||
//! @param coneDir The unit-length direction from the apex to the base.
|
||||
//! @param coneHeight The height of the cone, from the apex to the base.
|
||||
//! @param coneBaseRadius The radius of the cone base circle.
|
||||
//! @param[out] t1 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t1 * rayDir".
|
||||
//! @param[out] t2 A possible coefficient in the ray's explicit equation from which an intersecting point is calculated as "rayOrigin + t2 * rayDir".
|
||||
//! @return The number of intersecting points.
|
||||
int IntersectRayCone(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir,
|
||||
const Vector3& coneApex, const Vector3& coneDir, float coneHeight, float coneBaseRadius,
|
||||
float& t1, float& t2);
|
||||
const Vector3& rayOrigin,
|
||||
const Vector3& rayDir,
|
||||
const Vector3& coneApex,
|
||||
const Vector3& coneDir,
|
||||
float coneHeight,
|
||||
float coneBaseRadius,
|
||||
float& t1,
|
||||
float& t2);
|
||||
|
||||
//! Test intersection between a ray and a plane in 3D.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param planePos A point on the plane to test intersection with.
|
||||
//! @param planeNormal The normal of the plane to test intersection with.
|
||||
//! @param t[out] The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return The number of intersection point.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param planePos A point on the plane to test intersection with.
|
||||
//! @param planeNormal The normal of the plane to test intersection with.
|
||||
//! @param[out] t The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return The number of intersection point.
|
||||
int IntersectRayPlane(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos,
|
||||
const Vector3& planeNormal, float& t);
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos, const Vector3& planeNormal, float& t);
|
||||
|
||||
//! Test intersection between a ray and a two-sided quadrilateral defined by four points in 3D.
|
||||
//! The four points that define the quadrilateral could be passed in with either counter clock-wise
|
||||
//! The four points that define the quadrilateral could be passed in with either counter clock-wise
|
||||
//! winding or clock-wise winding.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param vertexA One of the four points that define the quadrilateral.
|
||||
//! @param vertexB One of the four points that define the quadrilateral.
|
||||
//! @param vertexC One of the four points that define the quadrilateral.
|
||||
//! @param vertexD One of the four points that define the quadrilateral.
|
||||
//! @param t[out] The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return The number of intersection point.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param vertexA One of the four points that define the quadrilateral.
|
||||
//! @param vertexB One of the four points that define the quadrilateral.
|
||||
//! @param vertexC One of the four points that define the quadrilateral.
|
||||
//! @param vertexD One of the four points that define the quadrilateral.
|
||||
//! @param[out] t The coefficient in the ray's explicit equation from which the
|
||||
//! intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return The number of intersection point.
|
||||
int IntersectRayQuad(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& vertexA,
|
||||
const Vector3& vertexB, const Vector3& vertexC, const Vector3& vertexD, float& t);
|
||||
const Vector3& rayOrigin,
|
||||
const Vector3& rayDir,
|
||||
const Vector3& vertexA,
|
||||
const Vector3& vertexB,
|
||||
const Vector3& vertexC,
|
||||
const Vector3& vertexD,
|
||||
float& t);
|
||||
|
||||
//! Test intersection between a ray and an oriented box in 3D.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param boxCenter The position of the center of the box.
|
||||
//! @param boxAxis1 An axis along one dimension of the oriented box.
|
||||
//! @param boxAxis2 An axis along one dimension of the oriented box.
|
||||
//! @param boxAxis3 An axis along one dimension of the oriented box.
|
||||
//! @param boxHalfExtent1 The half extent of the box on the dimension of \ref boxAxis1.
|
||||
//! @param boxHalfExtent2 The half extent of the box on the dimension of \ref boxAxis2.
|
||||
//! @param boxHalfExtent3 The half extent of the box on the dimension of \ref boxAxis3.
|
||||
//! @param t[out] The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return 1 if there is an intersection, 0 otherwise.
|
||||
int IntersectRayBox(
|
||||
const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& boxCenter, const Vector3& boxAxis1,
|
||||
const Vector3& boxAxis2, const Vector3& boxAxis3, float boxHalfExtent1, float boxHalfExtent2, float boxHalfExtent3,
|
||||
//! Test intersection between a ray and an oriented box in 3D.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param boxCenter The position of the center of the box.
|
||||
//! @param boxAxis1 An axis along one dimension of the oriented box.
|
||||
//! @param boxAxis2 An axis along one dimension of the oriented box.
|
||||
//! @param boxAxis3 An axis along one dimension of the oriented box.
|
||||
//! @param boxHalfExtent1 The half extent of the box on the dimension of \ref boxAxis1.
|
||||
//! @param boxHalfExtent2 The half extent of the box on the dimension of \ref boxAxis2.
|
||||
//! @param boxHalfExtent3 The half extent of the box on the dimension of \ref boxAxis3.
|
||||
//! @param[out] t The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return true if there is an intersection, false otherwise.
|
||||
bool IntersectRayBox(
|
||||
const Vector3& rayOrigin,
|
||||
const Vector3& rayDir,
|
||||
const Vector3& boxCenter,
|
||||
const Vector3& boxAxis1,
|
||||
const Vector3& boxAxis2,
|
||||
const Vector3& boxAxis3,
|
||||
float boxHalfExtent1,
|
||||
float boxHalfExtent2,
|
||||
float boxHalfExtent3,
|
||||
float& t);
|
||||
|
||||
//! Test intersection between a ray and an OBB.
|
||||
//! @param rayOrigin The origin of the ray to test intersection with.
|
||||
//! @param rayDir The direction of the ray to test intersection with.
|
||||
//! @param obb The OBB to test for intersection with the ray.
|
||||
//! @param t[out] The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return 1 if there is an intersection, 0 otherwise.
|
||||
int IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t);
|
||||
//! @param[out] t The coefficient in the ray's explicit equation from which the intersecting point is calculated as "rayOrigin + t * rayDirection".
|
||||
//! @return True if there is an intersection, false otherwise.
|
||||
bool IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t);
|
||||
|
||||
//! Ray cylinder intersection types.
|
||||
enum CylinderIsectTypes
|
||||
enum CylinderIsectTypes : AZ::s32
|
||||
{
|
||||
RR_ISECT_RAY_CYL_SA_INSIDE = -1, // the ray starts inside the cylinder
|
||||
RR_ISECT_RAY_CYL_NONE, // no intersection
|
||||
RR_ISECT_RAY_CYL_PQ, // along the PQ segment
|
||||
RR_ISECT_RAY_CYL_P_SIDE, // on the P side
|
||||
RR_ISECT_RAY_CYL_Q_SIDE, // on the Q side
|
||||
RR_ISECT_RAY_CYL_SA_INSIDE = -1, //!< the ray starts inside the cylinder
|
||||
RR_ISECT_RAY_CYL_NONE, //!< no intersection
|
||||
RR_ISECT_RAY_CYL_PQ, //!< along the PQ segment
|
||||
RR_ISECT_RAY_CYL_P_SIDE, //!< on the P side
|
||||
RR_ISECT_RAY_CYL_Q_SIDE, //!< on the Q side
|
||||
};
|
||||
|
||||
//! Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder
|
||||
//! Intersect segment S(t)=sa+t(dir), 0<=t<=1 against cylinder specified by p, q and r.
|
||||
int IntersectSegmentCylinder(
|
||||
const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q,
|
||||
const float r, float& t);
|
||||
//! @param sa The initial point.
|
||||
//! @param dir Magnitude and direction for sa.
|
||||
//! @param p Center point of side 1 cylinder.
|
||||
//! @param q Center point of side 2 cylinder.
|
||||
//! @param r Radius of cylinder.
|
||||
//! @param[out] t Proporition along line segment.
|
||||
//! @return CylinderIsectTypes
|
||||
CylinderIsectTypes IntersectSegmentCylinder(
|
||||
const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t);
|
||||
|
||||
//! Capsule ray intersect types.
|
||||
enum CapsuleIsectTypes
|
||||
{
|
||||
ISECT_RAY_CAPSULE_SA_INSIDE = -1, // the ray starts inside the cylinder
|
||||
ISECT_RAY_CAPSULE_NONE, // no intersection
|
||||
ISECT_RAY_CAPSULE_PQ, // along the PQ segment
|
||||
ISECT_RAY_CAPSULE_P_SIDE, // on the P side
|
||||
ISECT_RAY_CAPSULE_Q_SIDE, // on the Q side
|
||||
ISECT_RAY_CAPSULE_SA_INSIDE = -1, //!< The ray starts inside the cylinder
|
||||
ISECT_RAY_CAPSULE_NONE, //!< No intersection
|
||||
ISECT_RAY_CAPSULE_PQ, //!< Along the PQ segment
|
||||
ISECT_RAY_CAPSULE_P_SIDE, //!< On the P side
|
||||
ISECT_RAY_CAPSULE_Q_SIDE, //!< On the Q side
|
||||
};
|
||||
|
||||
//! This is a quick implementation of segment capsule based on segment cylinder \ref IntersectSegmentCylinder
|
||||
//! segment sphere intersection. We can optimize it a lot once we fix the ray
|
||||
//! cylinder intersection.
|
||||
int IntersectSegmentCapsule(
|
||||
const Vector3& sa, const Vector3& dir, const Vector3& p,
|
||||
const Vector3& q, const float r, float& t);
|
||||
//! @param sa The beginning of the line segment.
|
||||
//! @param dir The direction and length of the segment.
|
||||
//! @param p Center point of side 1 capsule.
|
||||
//! @param q Center point of side 1 capsule.
|
||||
//! @param r The radius of the capsule.
|
||||
//! @param[out] t Proporition along line segment.
|
||||
//! @return CapsuleIsectTypes
|
||||
CapsuleIsectTypes IntersectSegmentCapsule(
|
||||
const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t);
|
||||
|
||||
//! Intersect segment S(t)=A+t(B-A), 0<=t<=1 against convex polyhedron specified
|
||||
//! by the n halfspaces defined by the planes p[]. On exit tfirst and tlast
|
||||
//! define the intersection, if any.
|
||||
int IntersectSegmentPolyhedron(
|
||||
const Vector3& sa, const Vector3& sBA, const Plane p[], int numPlanes,
|
||||
float& tfirst, float& tlast, int& iFirstPlane, int& iLastPlane);
|
||||
//! @param sa The beggining of the line segment.
|
||||
//! @param dir The direction and length of the segment.
|
||||
//! @param p Planes that compose a convex ponvex polyhedron.
|
||||
//! @param numPlanes number of planes.
|
||||
//! @param[out] tfirst Proportion along the line segment where the line enters.
|
||||
//! @param[out] tlast Proportion along the line segment where the line exits.
|
||||
//! @param[out] iFirstPlane The plane where the line enters.
|
||||
//! @param[out] iLastPlane The plane where the line exits.
|
||||
//! @return True if intersects else false.
|
||||
bool IntersectSegmentPolyhedron(
|
||||
const Vector3& sa,
|
||||
const Vector3& dir,
|
||||
const Plane p[],
|
||||
int numPlanes,
|
||||
float& tfirst,
|
||||
float& tlast,
|
||||
int& iFirstPlane,
|
||||
int& iLastPlane);
|
||||
|
||||
//! Calculate the line segment closestPointSegment1<->closestPointSegment2 that is the shortest route between
|
||||
//! two segments segment1Start<->segment1End and segment2Start<->segment2End. Also calculate the values of segment1Proportion and segment2Proportion where
|
||||
//! closestPointSegment1 = segment1Start + (segment1Proportion * (segment1End - segment1Start))
|
||||
//! two segments segment1Start<->segment1End and segment2Start<->segment2End. Also calculate the values of segment1Proportion and
|
||||
//! segment2Proportion where closestPointSegment1 = segment1Start + (segment1Proportion * (segment1End - segment1Start))
|
||||
//! closestPointSegment2 = segment2Start + (segment2Proportion * (segment2End - segment2Start))
|
||||
//! If segments are parallel returns a solution.
|
||||
//! @param segment1Start Start of segment 1.
|
||||
//! @param segment1End End of segment 1.
|
||||
//! @param segment2Start Start of segment 2.
|
||||
//! @param segment2End End of segment 2.
|
||||
//! @param[out] segment1Proportion The proporition along segment 1 [0..1]
|
||||
//! @param[out] segment2Proportion The proporition along segment 2 [0..1]
|
||||
//! @param[out] closestPointSegment1 Closest point on segment 1.
|
||||
//! @param[out] closestPointSegment2 Closest point on segment 2.
|
||||
//! @param epsilon The minimum square distance where a line segment can be treated as a single point.
|
||||
void ClosestSegmentSegment(
|
||||
const Vector3& segment1Start, const Vector3& segment1End,
|
||||
const Vector3& segment2Start, const Vector3& segment2End,
|
||||
float& segment1Proportion, float& segment2Proportion,
|
||||
Vector3& closestPointSegment1, Vector3& closestPointSegment2,
|
||||
const Vector3& segment1Start,
|
||||
const Vector3& segment1End,
|
||||
const Vector3& segment2Start,
|
||||
const Vector3& segment2End,
|
||||
float& segment1Proportion,
|
||||
float& segment2Proportion,
|
||||
Vector3& closestPointSegment1,
|
||||
Vector3& closestPointSegment2,
|
||||
float epsilon = 1e-4f);
|
||||
|
||||
//! Calculate the line segment closestPointSegment1<->closestPointSegment2 that is the shortest route between
|
||||
//! two segments segment1Start<->segment1End and segment2Start<->segment2End.
|
||||
//! If segments are parallel returns a solution.
|
||||
//! @param segment1Start Start of segment 1.
|
||||
//! @param segment1End End of segment 1.
|
||||
//! @param segment2Start Start of segment 2.
|
||||
//! @param segment2End End of segment 2.
|
||||
//! @param[out] closestPointSegment1 Closest point on segment 1.
|
||||
//! @param[out] closestPointSegment2 Closest point on segment 2.
|
||||
//! @param epsilon The minimum square distance where a line segment can be treated as a single point.
|
||||
void ClosestSegmentSegment(
|
||||
const Vector3& segment1Start, const Vector3& segment1End,
|
||||
const Vector3& segment2Start, const Vector3& segment2End,
|
||||
Vector3& closestPointSegment1, Vector3& closestPointSegment2,
|
||||
const Vector3& segment1Start,
|
||||
const Vector3& segment1End,
|
||||
const Vector3& segment2Start,
|
||||
const Vector3& segment2End,
|
||||
Vector3& closestPointSegment1,
|
||||
Vector3& closestPointSegment2,
|
||||
float epsilon = 1e-4f);
|
||||
|
||||
//! Calculate the point (closestPointOnSegment) that is the closest point on
|
||||
//! segment segmentStart/segmentEnd to point. Also calculate the value of proportion where
|
||||
//! closestPointOnSegment = segmentStart + (proportion * (segmentEnd - segmentStart))
|
||||
//! @param point The point to test
|
||||
//! @param segmentStart The start of the segment
|
||||
//! @param segmentEnd The end of the segment
|
||||
//! @param[out] proportion The proportion of the segment L(t) = (end - start) * t
|
||||
//! @param[out] closestPointOnSegment The point along the line segment
|
||||
void ClosestPointSegment(
|
||||
const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd,
|
||||
float& proportion, Vector3& closestPointOnSegment);
|
||||
}
|
||||
}
|
||||
const Vector3& point,
|
||||
const Vector3& segmentStart,
|
||||
const Vector3& segmentEnd,
|
||||
float& proportion,
|
||||
Vector3& closestPointOnSegment);
|
||||
} // namespace Intersect
|
||||
} // namespace AZ
|
||||
|
||||
#endif // AZCORE_MATH_SEGMENT_INTERSECTION_H
|
||||
#pragma once
|
||||
#include <AzCore/Math/IntersectSegment.inl>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Intersect
|
||||
{
|
||||
AZ_MATH_INLINE bool ClipRayWithAabb(const Aabb& aabb, Vector3& rayStart, Vector3& rayEnd, float& tClipStart, float& tClipEnd)
|
||||
{
|
||||
Vector3 startNormal;
|
||||
float tStart, tEnd;
|
||||
Vector3 dirLen = rayEnd - rayStart;
|
||||
if (IntersectRayAABB(rayStart, dirLen, dirLen.GetReciprocal(), aabb, tStart, tEnd, startNormal) != ISECT_RAY_AABB_NONE)
|
||||
{
|
||||
// clip the ray with the box
|
||||
if (tStart > 0.0f)
|
||||
{
|
||||
rayStart = rayStart + tStart * dirLen;
|
||||
tClipStart = tStart;
|
||||
}
|
||||
if (tEnd < 1.0f)
|
||||
{
|
||||
rayEnd = rayStart + tEnd * dirLen;
|
||||
tClipEnd = tEnd;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE SphereIsectTypes
|
||||
IntersectRaySphereOrigin(const Vector3& rayStart, const Vector3& rayDirNormalized, const float sphereRadius, float& t)
|
||||
{
|
||||
Vector3 m = rayStart;
|
||||
float b = m.Dot(rayDirNormalized);
|
||||
float c = m.Dot(m) - sphereRadius * sphereRadius;
|
||||
|
||||
// Exit if r's origin outside s (c > 0)and r pointing away from s (b > 0)
|
||||
if (c > 0.0f && b > 0.0f)
|
||||
{
|
||||
return ISECT_RAY_SPHERE_NONE;
|
||||
}
|
||||
float discr = b * b - c;
|
||||
// A negative discriminant corresponds to ray missing sphere
|
||||
if (discr < 0.0f)
|
||||
{
|
||||
return ISECT_RAY_SPHERE_NONE;
|
||||
}
|
||||
|
||||
// Ray now found to intersect sphere, compute smallest t value of intersection
|
||||
t = -b - Sqrt(discr);
|
||||
|
||||
// If t is negative, ray started inside sphere so clamp t to zero
|
||||
if (t < 0.0f)
|
||||
{
|
||||
// t = 0.0f;
|
||||
return ISECT_RAY_SPHERE_SA_INSIDE; // no hit if inside
|
||||
}
|
||||
// q = p + t * d;
|
||||
return ISECT_RAY_SPHERE_ISECT;
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE SphereIsectTypes IntersectRaySphere(const Vector3& rayStart, const Vector3& rayDirNormalized, const Vector3& sphereCenter, const float sphereRadius, float& t)
|
||||
{
|
||||
return IntersectRaySphereOrigin(rayStart - sphereCenter, rayDirNormalized, sphereRadius, t);
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE Vector3 LineToPointDistance(const Vector3& s1, const Vector3& s2, const Vector3& p, float& u)
|
||||
{
|
||||
const Vector3 s21 = s2 - s1;
|
||||
// we assume seg1 and seg2 are NOT coincident
|
||||
AZ_MATH_ASSERT(!s21.IsClose(Vector3(0.0f), 1e-4f), "OK we agreed that we will pass valid segments! (s1 != s2)");
|
||||
|
||||
u = LineToPointDistanceTime(s1, s21, p);
|
||||
|
||||
return s1 + u * s21;
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE float LineToPointDistanceTime(const Vector3& s1, const Vector3& s21, const Vector3& p)
|
||||
{
|
||||
// so u = (p.x - s1.x)*(s2.x - s1.x) + (p.y - s1.y)*(s2.y - s1.y) + (p.z-s1.z)*(s2.z-s1.z) / |s2-s1|^2
|
||||
return s21.Dot(p - s1) / s21.Dot(s21);
|
||||
}
|
||||
|
||||
AZ_MATH_INLINE bool TestSegmentAABB(const Vector3& p0, const Vector3& p1, const Aabb& aabb)
|
||||
{
|
||||
Vector3 e = aabb.GetExtents();
|
||||
Vector3 d = p1 - p0;
|
||||
Vector3 m = p0 + p1 - aabb.GetMin() - aabb.GetMax();
|
||||
|
||||
return TestSegmentAABBOrigin(m, d, e);
|
||||
}
|
||||
} // namespace Intersect
|
||||
} // namespace AZ
|
||||
@@ -282,6 +282,7 @@ set(FILES
|
||||
Math/Internal/VertexContainer.inl
|
||||
Math/InterpolationSample.h
|
||||
Math/IntersectPoint.h
|
||||
Math/IntersectSegment.inl
|
||||
Math/IntersectSegment.cpp
|
||||
Math/IntersectSegment.h
|
||||
Math/MathIntrinsics.h
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Settings/SettingsRegistry.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
namespace AzFramework
|
||||
@@ -190,6 +191,25 @@ namespace AzFramework
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void InputSystemComponent::Activate()
|
||||
{
|
||||
const auto* settingsRegistry = AZ::SettingsRegistry::Get();
|
||||
if (settingsRegistry)
|
||||
{
|
||||
AZ::u64 value = 0;
|
||||
if (settingsRegistry->Get(value, "/O3DE/InputSystem/MouseMovementSampleRateHertz"))
|
||||
{
|
||||
m_mouseMovementSampleRateHertz = aznumeric_caster(value);
|
||||
}
|
||||
if (settingsRegistry->Get(value, "/O3DE/InputSystem/GamepadsEnabled"))
|
||||
{
|
||||
m_gamepadsEnabled = aznumeric_caster(value);
|
||||
}
|
||||
settingsRegistry->Get(m_keyboardEnabled, "/O3DE/InputSystem/KeyboardEnabled");
|
||||
settingsRegistry->Get(m_motionEnabled, "/O3DE/InputSystem/MotionEnabled");
|
||||
settingsRegistry->Get(m_mouseEnabled, "/O3DE/InputSystem/MouseEnabled");
|
||||
settingsRegistry->Get(m_touchEnabled, "/O3DE/InputSystem/TouchEnabled");
|
||||
settingsRegistry->Get(m_virtualKeyboardEnabled, "/O3DE/InputSystem/VirtualKeyboardEnabled");
|
||||
}
|
||||
|
||||
// Create all enabled input devices
|
||||
CreateEnabledInputDevices();
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@ namespace AzFramework
|
||||
//! be deleted and the spawnable asset to be released. This call is automatically done when
|
||||
//! AssignRootSpawnable is called while a root spawnable is assigned.
|
||||
virtual void ReleaseRootSpawnable() = 0;
|
||||
//! Force processing all SpawnableEntitiesManager requests immediately
|
||||
//! This is useful when loading a different level while SpawnableEntitiesManager still has
|
||||
//! pending requests
|
||||
virtual void ProcessSpawnableQueue() = 0;
|
||||
};
|
||||
|
||||
using RootSpawnableInterface = AZ::Interface<RootSpawnableDefinition>;
|
||||
|
||||
@@ -45,8 +45,7 @@ namespace AzFramework
|
||||
|
||||
void SpawnableSystemComponent::OnTick(float /*deltaTime*/, AZ::ScriptTimePoint /*time*/)
|
||||
{
|
||||
m_entitiesManager.ProcessQueue(
|
||||
SpawnableEntitiesManager::CommandQueuePriority::High | SpawnableEntitiesManager::CommandQueuePriority::Regular);
|
||||
ProcessSpawnableQueue();
|
||||
RootSpawnableNotificationBus::ExecuteQueuedEvents();
|
||||
}
|
||||
|
||||
@@ -121,6 +120,12 @@ namespace AzFramework
|
||||
m_rootSpawnableId = AZ::Data::AssetId();
|
||||
}
|
||||
|
||||
void SpawnableSystemComponent::ProcessSpawnableQueue()
|
||||
{
|
||||
m_entitiesManager.ProcessQueue(
|
||||
SpawnableEntitiesManager::CommandQueuePriority::High | SpawnableEntitiesManager::CommandQueuePriority::Regular);
|
||||
}
|
||||
|
||||
void SpawnableSystemComponent::OnRootSpawnableAssigned([[maybe_unused]] AZ::Data::Asset<Spawnable> rootSpawnable,
|
||||
[[maybe_unused]] uint32_t generation)
|
||||
{
|
||||
@@ -161,6 +166,8 @@ namespace AzFramework
|
||||
|
||||
void SpawnableSystemComponent::Deactivate()
|
||||
{
|
||||
ProcessSpawnableQueue();
|
||||
|
||||
m_registryChangeHandler.Disconnect();
|
||||
|
||||
AZ::TickBus::Handler::BusDisconnect();
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace AzFramework
|
||||
|
||||
uint64_t AssignRootSpawnable(AZ::Data::Asset<Spawnable> rootSpawnable) override;
|
||||
void ReleaseRootSpawnable() override;
|
||||
void ProcessSpawnableQueue() override;
|
||||
|
||||
//
|
||||
// RootSpawnbleNotificationBus
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <AzFramework/Windowing/NativeWindow.h>
|
||||
#include <AzFramework/XcbNativeWindow.h>
|
||||
#include <AzFramework/XcbConnectionManager.h>
|
||||
#include <AzFramework/XcbInterface.h>
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
|
||||
+22
-20
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
#include <AzCore/UserSettings/UserSettingsComponent.h>
|
||||
#include <AzFramework/XcbApplication.h>
|
||||
#include <AzFramework/XcbInputDeviceKeyboard.h>
|
||||
#include <AzFramework/Input/Buses/Notifications/InputTextNotificationBus.h>
|
||||
@@ -20,6 +19,7 @@
|
||||
#include "Matchers.h"
|
||||
#include "Actions.h"
|
||||
#include "XcbBaseTestFixture.h"
|
||||
#include "XcbTestApplication.h"
|
||||
|
||||
template<typename T>
|
||||
xcb_generic_event_t MakeEvent(T event)
|
||||
@@ -33,6 +33,7 @@ namespace AzFramework
|
||||
class XcbInputDeviceKeyboardTests
|
||||
: public XcbBaseTestFixture
|
||||
{
|
||||
public:
|
||||
void SetUp() override
|
||||
{
|
||||
using testing::Return;
|
||||
@@ -123,6 +124,15 @@ namespace AzFramework
|
||||
|
||||
static constexpr xcb_keycode_t s_keycodeForAKey{38};
|
||||
static constexpr xcb_keycode_t s_keycodeForShiftLKey{50};
|
||||
|
||||
XcbTestApplication m_application{
|
||||
/*enabledGamepadsCount=*/0,
|
||||
/*keyboardEnabled=*/true,
|
||||
/*motionEnabled=*/false,
|
||||
/*mouseEnabled=*/false,
|
||||
/*touchEnabled=*/false,
|
||||
/*virtualKeyboardEnabled=*/false
|
||||
};
|
||||
};
|
||||
|
||||
class InputTextNotificationListener
|
||||
@@ -195,27 +205,23 @@ namespace AzFramework
|
||||
EXPECT_CALL(m_interface, xkb_state_key_get_one_sym(&m_xkbState, s_keycodeForAKey))
|
||||
.Times(2);
|
||||
|
||||
Application application;
|
||||
application.Start({}, {});
|
||||
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
|
||||
m_application.Start();
|
||||
|
||||
const InputChannel* inputChannel = InputChannelRequests::FindInputChannel(InputDeviceKeyboard::Key::AlphanumericA);
|
||||
ASSERT_TRUE(inputChannel);
|
||||
EXPECT_THAT(inputChannel->GetState(), Eq(InputChannel::State::Idle));
|
||||
|
||||
application.PumpSystemEventLoopUntilEmpty();
|
||||
application.TickSystem();
|
||||
application.Tick();
|
||||
m_application.PumpSystemEventLoopUntilEmpty();
|
||||
m_application.TickSystem();
|
||||
m_application.Tick();
|
||||
|
||||
EXPECT_THAT(inputChannel->GetState(), Eq(InputChannel::State::Began));
|
||||
|
||||
application.PumpSystemEventLoopUntilEmpty();
|
||||
application.TickSystem();
|
||||
application.Tick();
|
||||
m_application.PumpSystemEventLoopUntilEmpty();
|
||||
m_application.TickSystem();
|
||||
m_application.Tick();
|
||||
|
||||
EXPECT_THAT(inputChannel->GetState(), Eq(InputChannel::State::Ended));
|
||||
|
||||
application.Stop();
|
||||
}
|
||||
|
||||
TEST_F(XcbInputDeviceKeyboardTests, TextEnteredFromXcbKeyPressEvents)
|
||||
@@ -420,17 +426,13 @@ namespace AzFramework
|
||||
EXPECT_CALL(textListener, OnInputTextEvent(StrEq("a"), _)).Times(1);
|
||||
EXPECT_CALL(textListener, OnInputTextEvent(StrEq("A"), _)).Times(1);
|
||||
|
||||
Application application;
|
||||
application.Start({}, {});
|
||||
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
|
||||
m_application.Start();
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
application.PumpSystemEventLoopUntilEmpty();
|
||||
application.TickSystem();
|
||||
application.Tick();
|
||||
m_application.PumpSystemEventLoopUntilEmpty();
|
||||
m_application.TickSystem();
|
||||
m_application.Tick();
|
||||
}
|
||||
|
||||
application.Stop();
|
||||
}
|
||||
} // namespace AzFramework
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Settings/SettingsRegistry.h>
|
||||
#include <AzCore/UserSettings/UserSettingsComponent.h>
|
||||
#include <AzFramework/Application/Application.h>
|
||||
|
||||
namespace AzFramework
|
||||
{
|
||||
class XcbTestApplication
|
||||
: public Application
|
||||
{
|
||||
public:
|
||||
XcbTestApplication(AZ::u64 enabledGamepadsCount, bool keyboardEnabled, bool motionEnabled, bool mouseEnabled, bool touchEnabled, bool virtualKeyboardEnabled)
|
||||
{
|
||||
auto* settingsRegistry = AZ::SettingsRegistry::Get();
|
||||
settingsRegistry->Set("/O3DE/InputSystem/GamepadsEnabled", enabledGamepadsCount);
|
||||
settingsRegistry->Set("/O3DE/InputSystem/KeyboardEnabled", keyboardEnabled);
|
||||
settingsRegistry->Set("/O3DE/InputSystem/MotionEnabled", motionEnabled);
|
||||
settingsRegistry->Set("/O3DE/InputSystem/MouseEnabled", mouseEnabled);
|
||||
settingsRegistry->Set("/O3DE/InputSystem/TouchEnabled", touchEnabled);
|
||||
settingsRegistry->Set("/O3DE/InputSystem/VirtualKeyboardEnabled", virtualKeyboardEnabled);
|
||||
}
|
||||
|
||||
void Start(const Descriptor& descriptor = {}, const StartupParameters& startupParameters = {}) override
|
||||
{
|
||||
Application::Start(descriptor, startupParameters);
|
||||
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
|
||||
}
|
||||
};
|
||||
} // namespace AzFramework
|
||||
@@ -17,4 +17,5 @@ set(FILES
|
||||
XcbBaseTestFixture.cpp
|
||||
XcbBaseTestFixture.h
|
||||
XcbInputDeviceKeyboardTests.cpp
|
||||
XcbTestApplication.h
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ set(FILES
|
||||
../../Utilities/QtWindowUtilities_linux.cpp
|
||||
../../Utilities/ScreenGrabber_linux.cpp
|
||||
../../../Platform/Linux/AzQtComponents/Components/StyledDockWidget_Linux.cpp
|
||||
../../../Platform/Linux/AzQtComponents/Utilities/DesktopUtilities_Linux.cpp
|
||||
../../../Platform/Linux/AzQtComponents/AzQtComponents_Traits_Linux.h
|
||||
../../../Platform/Linux/AzQtComponents/AzQtComponents_Traits_Platform.h
|
||||
)
|
||||
|
||||
@@ -12,6 +12,7 @@ set(FILES
|
||||
../../Utilities/QtWindowUtilities_mac.mm
|
||||
../../Utilities/ScreenGrabber_mac.mm
|
||||
../../../Platform/Mac/AzQtComponents/Components/StyledDockWidget_Mac.cpp
|
||||
../../../Platform/Mac/AzQtComponents/Utilities/DesktopUtilities_Mac.cpp
|
||||
../../../Platform/Mac/AzQtComponents/AzQtComponents_Traits_Mac.h
|
||||
../../../Platform/Mac/AzQtComponents/AzQtComponents_Traits_Platform.h
|
||||
)
|
||||
|
||||
+1
@@ -9,6 +9,7 @@
|
||||
set(FILES
|
||||
../../natvis/qt.natvis
|
||||
../../../Platform/Windows/AzQtComponents/Utilities/HandleDpiAwareness_Windows.cpp
|
||||
../../../Platform/Windows/AzQtComponents/Utilities/DesktopUtilities_Windows.cpp
|
||||
../../Utilities/MouseHider_win.cpp
|
||||
../../Utilities/QtWindowUtilities_win.cpp
|
||||
../../Utilities/ScreenGrabber_win.cpp
|
||||
|
||||
@@ -271,7 +271,6 @@ set(FILES
|
||||
Utilities/ColorUtilities.h
|
||||
Utilities/Conversions.h
|
||||
Utilities/Conversions.cpp
|
||||
Utilities/DesktopUtilities.cpp
|
||||
Utilities/DesktopUtilities.h
|
||||
Utilities/HandleDpiAwareness.cpp
|
||||
Utilities/HandleDpiAwareness.h
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzQtComponents/Utilities/DesktopUtilities.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
namespace AzQtComponents
|
||||
{
|
||||
void ShowFileOnDesktop(const QString& path)
|
||||
{
|
||||
const char* defaultNautilusPath = "/usr/bin/nautilus";
|
||||
const char* defaultXdgOpenPath = "/usr/bin/xdg-open";
|
||||
|
||||
// Determine if Nautilus (for Gnome Desktops) is available because it supports opening the file manager
|
||||
// and selecting a specific file
|
||||
bool nautilusAvailable = QFileInfo(defaultNautilusPath).exists();
|
||||
|
||||
QFileInfo pathInfo(path);
|
||||
if (pathInfo.isDir())
|
||||
{
|
||||
QProcess::startDetached(defaultXdgOpenPath, { path });
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nautilusAvailable)
|
||||
{
|
||||
QProcess::startDetached(defaultNautilusPath, { "--select", path });
|
||||
}
|
||||
else
|
||||
{
|
||||
QDir parentDir { pathInfo.dir() };
|
||||
QProcess::startDetached(defaultXdgOpenPath, { parentDir.path() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString fileBrowserActionName()
|
||||
{
|
||||
const char* exploreActionName = "Open in file browser";
|
||||
return QObject::tr(exploreActionName);
|
||||
}
|
||||
}
|
||||
-23
@@ -15,21 +15,6 @@ namespace AzQtComponents
|
||||
{
|
||||
void ShowFileOnDesktop(const QString& path)
|
||||
{
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
|
||||
// Launch explorer at the path provided
|
||||
QStringList args;
|
||||
if (!QFileInfo(path).isDir())
|
||||
{
|
||||
// Folders are just opened, files are selected
|
||||
args << "/select,";
|
||||
}
|
||||
args << QDir::toNativeSeparators(path);
|
||||
|
||||
QProcess::startDetached("explorer", args);
|
||||
|
||||
#else
|
||||
|
||||
if (QFileInfo(path).isDir())
|
||||
{
|
||||
QProcess::startDetached("/usr/bin/osascript", { "-e",
|
||||
@@ -43,19 +28,11 @@ namespace AzQtComponents
|
||||
|
||||
QProcess::startDetached("/usr/bin/osascript", { "-e",
|
||||
QStringLiteral("tell application \"Finder\" to activate") });
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
QString fileBrowserActionName()
|
||||
{
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
const char* exploreActionName = "Open in Explorer";
|
||||
#elif defined(AZ_PLATFORM_MAC)
|
||||
const char* exploreActionName = "Open in Finder";
|
||||
#else
|
||||
const char* exploreActionName = "Open in file browser";
|
||||
#endif
|
||||
return QObject::tr(exploreActionName);
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzQtComponents/Utilities/DesktopUtilities.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
|
||||
namespace AzQtComponents
|
||||
{
|
||||
void ShowFileOnDesktop(const QString& path)
|
||||
{
|
||||
// Launch explorer at the path provided
|
||||
QStringList args;
|
||||
if (!QFileInfo(path).isDir())
|
||||
{
|
||||
// Folders are just opened, files are selected
|
||||
args << "/select,";
|
||||
}
|
||||
args << QDir::toNativeSeparators(path);
|
||||
|
||||
QProcess::startDetached("explorer", args);
|
||||
}
|
||||
|
||||
QString fileBrowserActionName()
|
||||
{
|
||||
const char* exploreActionName = "Open in Explorer";
|
||||
return QObject::tr(exploreActionName);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -116,7 +116,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
return AZ::Intersect::IntersectRayBox(
|
||||
rayOrigin, rayDirection, m_center, m_axis1, m_axis2, m_axis3, m_halfExtents.GetX(), m_halfExtents.GetY(),
|
||||
m_halfExtents.GetZ(), rayIntersectionDistance) > 0;
|
||||
m_halfExtents.GetZ(), rayIntersectionDistance);
|
||||
}
|
||||
|
||||
void ManipulatorBoundBox::SetShapeData(const BoundRequestShapeBase& shapeData)
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace AzToolsFramework
|
||||
|
||||
if (assetId.IsValid())
|
||||
{
|
||||
asset.Create(assetId, true);
|
||||
asset.Create(assetId, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -43,6 +43,12 @@ namespace AzToolsFramework
|
||||
m_instanceToTemplateInterface = AZ::Interface<InstanceToTemplateInterface>::Get();
|
||||
AZ_Assert(m_instanceToTemplateInterface, "PrefabPublicHandler - Could not retrieve instance of InstanceToTemplateInterface");
|
||||
|
||||
m_prefabFocusInterface = AZ::Interface<PrefabFocusInterface>::Get();
|
||||
AZ_Assert(m_prefabFocusInterface, "Could not get PrefabFocusInterface on PrefabPublicHandler construction.");
|
||||
|
||||
m_prefabFocusPublicInterface = AZ::Interface<PrefabFocusPublicInterface>::Get();
|
||||
AZ_Assert(m_prefabFocusPublicInterface, "Could not get PrefabFocusPublicInterface on PrefabPublicHandler construction.");
|
||||
|
||||
m_prefabLoaderInterface = AZ::Interface<PrefabLoaderInterface>::Get();
|
||||
AZ_Assert(m_prefabLoaderInterface, "Could not get PrefabLoaderInterface on PrefabPublicHandler construction.");
|
||||
|
||||
@@ -552,6 +558,13 @@ namespace AzToolsFramework
|
||||
|
||||
PrefabEntityResult PrefabPublicHandler::CreateEntity(AZ::EntityId parentId, const AZ::Vector3& position)
|
||||
{
|
||||
// If the parent is invalid, parent to the container of the currently focused prefab.
|
||||
if (!parentId.IsValid())
|
||||
{
|
||||
AzFramework::EntityContextId editorEntityContextId = AzToolsFramework::GetEntityContextId();
|
||||
parentId = m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId);
|
||||
}
|
||||
|
||||
InstanceOptionalReference owningInstanceOfParentEntity = GetOwnerInstanceByEntityId(parentId);
|
||||
if (!owningInstanceOfParentEntity)
|
||||
{
|
||||
@@ -968,13 +981,13 @@ namespace AzToolsFramework
|
||||
return AZ::Failure(AZStd::string("No entities to duplicate."));
|
||||
}
|
||||
|
||||
const EntityIdList entityIdsNoLevelInstance = GenerateEntityIdListWithoutLevelInstance(entityIds);
|
||||
if (entityIdsNoLevelInstance.empty())
|
||||
const EntityIdList entityIdsNoFocusContainer = GenerateEntityIdListWithoutFocusedInstanceContainer(entityIds);
|
||||
if (entityIdsNoFocusContainer.empty())
|
||||
{
|
||||
return AZ::Failure(AZStd::string("No entities to duplicate because only instance selected is the level instance."));
|
||||
return AZ::Failure(AZStd::string("No entities to duplicate because only instance selected is the container entity of the focused instance."));
|
||||
}
|
||||
|
||||
if (!EntitiesBelongToSameInstance(entityIdsNoLevelInstance))
|
||||
if (!EntitiesBelongToSameInstance(entityIdsNoFocusContainer))
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Cannot duplicate multiple entities belonging to different instances with one operation."
|
||||
"Change your selection to contain entities in the same instance."));
|
||||
@@ -982,7 +995,7 @@ namespace AzToolsFramework
|
||||
|
||||
// We've already verified the entities are all owned by the same instance,
|
||||
// so we can just retrieve our instance from the first entity in the list.
|
||||
AZ::EntityId firstEntityIdToDuplicate = entityIdsNoLevelInstance[0];
|
||||
AZ::EntityId firstEntityIdToDuplicate = entityIdsNoFocusContainer[0];
|
||||
InstanceOptionalReference commonOwningInstance = GetOwnerInstanceByEntityId(firstEntityIdToDuplicate);
|
||||
if (!commonOwningInstance.has_value())
|
||||
{
|
||||
@@ -1002,7 +1015,7 @@ namespace AzToolsFramework
|
||||
|
||||
// This will cull out any entities that have ancestors in the list, since we will end up duplicating
|
||||
// the full nested hierarchy with what is returned from RetrieveAndSortPrefabEntitiesAndInstances
|
||||
AzToolsFramework::EntityIdSet duplicationSet = AzToolsFramework::GetCulledEntityHierarchy(entityIdsNoLevelInstance);
|
||||
AzToolsFramework::EntityIdSet duplicationSet = AzToolsFramework::GetCulledEntityHierarchy(entityIdsNoFocusContainer);
|
||||
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
|
||||
@@ -1106,19 +1119,21 @@ namespace AzToolsFramework
|
||||
|
||||
PrefabOperationResult PrefabPublicHandler::DeleteFromInstance(const EntityIdList& entityIds, bool deleteDescendants)
|
||||
{
|
||||
const EntityIdList entityIdsNoLevelInstance = GenerateEntityIdListWithoutLevelInstance(entityIds);
|
||||
// Remove the container entity of the focused prefab from the list, if it is included.
|
||||
const EntityIdList entityIdsNoFocusContainer = GenerateEntityIdListWithoutFocusedInstanceContainer(entityIds);
|
||||
|
||||
if (entityIdsNoLevelInstance.empty())
|
||||
if (entityIdsNoFocusContainer.empty())
|
||||
{
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
if (!EntitiesBelongToSameInstance(entityIdsNoLevelInstance))
|
||||
// All entities in this list need to belong to the same prefab instance for the operation to be valid.
|
||||
if (!EntitiesBelongToSameInstance(entityIdsNoFocusContainer))
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Cannot delete multiple entities belonging to different instances with one operation."));
|
||||
}
|
||||
|
||||
AZ::EntityId firstEntityIdToDelete = entityIdsNoLevelInstance[0];
|
||||
AZ::EntityId firstEntityIdToDelete = entityIdsNoFocusContainer[0];
|
||||
InstanceOptionalReference commonOwningInstance = GetOwnerInstanceByEntityId(firstEntityIdToDelete);
|
||||
|
||||
// If the first entity id is a container entity id, then we need to mark its parent as the common owning instance because you
|
||||
@@ -1128,8 +1143,15 @@ namespace AzToolsFramework
|
||||
commonOwningInstance = commonOwningInstance->get().GetParentInstance();
|
||||
}
|
||||
|
||||
// We only allow explicit deletions for entities inside the currently focused prefab.
|
||||
AzFramework::EntityContextId editorEntityContextId = AzToolsFramework::GetEntityContextId();
|
||||
if (&m_prefabFocusInterface->GetFocusedPrefabInstance(editorEntityContextId)->get() != &commonOwningInstance->get())
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Cannot delete entities belonging to an instance that is not being edited."));
|
||||
}
|
||||
|
||||
// Retrieve entityList from entityIds
|
||||
EntityList inputEntityList = EntityIdListToEntityList(entityIdsNoLevelInstance);
|
||||
EntityList inputEntityList = EntityIdListToEntityList(entityIdsNoFocusContainer);
|
||||
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
|
||||
@@ -1186,7 +1208,7 @@ namespace AzToolsFramework
|
||||
}
|
||||
else
|
||||
{
|
||||
for (AZ::EntityId entityId : entityIdsNoLevelInstance)
|
||||
for (AZ::EntityId entityId : entityIdsNoFocusContainer)
|
||||
{
|
||||
InstanceOptionalReference owningInstance = m_instanceEntityMapperInterface->FindOwningInstance(entityId);
|
||||
// If this is the container entity, it actually represents the instance so get its owner
|
||||
@@ -1227,9 +1249,12 @@ namespace AzToolsFramework
|
||||
return AZ::Failure(AZStd::string("Cannot detach Prefab Instance with invalid container entity."));
|
||||
}
|
||||
|
||||
if (IsLevelInstanceContainerEntity(containerEntityId))
|
||||
auto editorEntityContextId = AzFramework::EntityContextId::CreateNull();
|
||||
EditorEntityContextRequestBus::BroadcastResult(editorEntityContextId, &EditorEntityContextRequests::GetEditorEntityContextId);
|
||||
|
||||
if (containerEntityId == m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId))
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Cannot detach level Prefab Instance."));
|
||||
return AZ::Failure(AZStd::string("Cannot detach focused Prefab Instance."));
|
||||
}
|
||||
|
||||
InstanceOptionalReference owningInstance = GetOwnerInstanceByEntityId(containerEntityId);
|
||||
@@ -1452,9 +1477,14 @@ namespace AzToolsFramework
|
||||
|
||||
AZStd::queue<AZ::Entity*> entityQueue;
|
||||
|
||||
auto editorEntityContextId = AzFramework::EntityContextId::CreateNull();
|
||||
EditorEntityContextRequestBus::BroadcastResult(editorEntityContextId, &EditorEntityContextRequests::GetEditorEntityContextId);
|
||||
|
||||
AZ::EntityId focusedPrefabContainerEntityId =
|
||||
m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId);
|
||||
for (auto inputEntity : inputEntities)
|
||||
{
|
||||
if (inputEntity && !IsLevelInstanceContainerEntity(inputEntity->GetId()))
|
||||
if (inputEntity && inputEntity->GetId() != focusedPrefabContainerEntityId)
|
||||
{
|
||||
entityQueue.push(inputEntity);
|
||||
}
|
||||
@@ -1548,19 +1578,19 @@ namespace AzToolsFramework
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
EntityIdList PrefabPublicHandler::GenerateEntityIdListWithoutLevelInstance(
|
||||
EntityIdList PrefabPublicHandler::GenerateEntityIdListWithoutFocusedInstanceContainer(
|
||||
const EntityIdList& entityIds) const
|
||||
{
|
||||
EntityIdList outEntityIds;
|
||||
outEntityIds.reserve(entityIds.size()); // Actual size could be smaller.
|
||||
EntityIdList outEntityIds(entityIds);
|
||||
|
||||
for (const AZ::EntityId& entityId : entityIds)
|
||||
AzFramework::EntityContextId editorEntityContextId = AzToolsFramework::GetEntityContextId();
|
||||
AZ::EntityId focusedInstanceContainerEntityId = m_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId);
|
||||
|
||||
if (auto iter = AZStd::find(outEntityIds.begin(), outEntityIds.end(), focusedInstanceContainerEntityId); iter != outEntityIds.end())
|
||||
{
|
||||
if (!IsLevelInstanceContainerEntity(entityId))
|
||||
{
|
||||
outEntityIds.emplace_back(entityId);
|
||||
}
|
||||
outEntityIds.erase(iter);
|
||||
}
|
||||
|
||||
return outEntityIds;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace AzToolsFramework
|
||||
Instance& commonRootEntityOwningInstance,
|
||||
EntityList& outEntities,
|
||||
AZStd::vector<Instance*>& outInstances) const;
|
||||
EntityIdList GenerateEntityIdListWithoutLevelInstance(const EntityIdList& entityIds) const;
|
||||
EntityIdList GenerateEntityIdListWithoutFocusedInstanceContainer(const EntityIdList& entityIds) const;
|
||||
|
||||
InstanceOptionalReference GetOwnerInstanceByEntityId(AZ::EntityId entityId) const;
|
||||
bool EntitiesBelongToSameInstance(const EntityIdList& entityIds) const;
|
||||
@@ -187,6 +187,8 @@ namespace AzToolsFramework
|
||||
|
||||
InstanceEntityMapperInterface* m_instanceEntityMapperInterface = nullptr;
|
||||
InstanceToTemplateInterface* m_instanceToTemplateInterface = nullptr;
|
||||
PrefabFocusInterface* m_prefabFocusInterface = nullptr;
|
||||
PrefabFocusPublicInterface* m_prefabFocusPublicInterface = nullptr;
|
||||
PrefabLoaderInterface* m_prefabLoaderInterface = nullptr;
|
||||
PrefabSystemComponentInterface* m_prefabSystemComponentInterface = nullptr;
|
||||
|
||||
|
||||
+35
-21
@@ -24,6 +24,7 @@
|
||||
#include <AzToolsFramework/AssetBrowser/AssetSelectionModel.h>
|
||||
#include <AzToolsFramework/AssetBrowser/Entries/SourceAssetBrowserEntry.h>
|
||||
#include <AzToolsFramework/ContainerEntity/ContainerEntityInterface.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
#include <AzToolsFramework/Prefab/EditorPrefabComponent.h>
|
||||
#include <AzToolsFramework/Prefab/Instance/InstanceEntityMapperInterface.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabFocusPublicInterface.h>
|
||||
@@ -175,12 +176,16 @@ namespace AzToolsFramework
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled);
|
||||
|
||||
auto editorEntityContextId = AzFramework::EntityContextId::CreateNull();
|
||||
EditorEntityContextRequestBus::BroadcastResult(editorEntityContextId, &EditorEntityContextRequests::GetEditorEntityContextId);
|
||||
|
||||
// Create Prefab
|
||||
{
|
||||
if (!selectedEntities.empty())
|
||||
{
|
||||
// Hide if the only selected entity is the Level Container
|
||||
if (selectedEntities.size() > 1 || !s_prefabPublicInterface->IsLevelInstanceContainerEntity(selectedEntities[0]))
|
||||
// Hide if the only selected entity is the Focused Instance Container
|
||||
if (selectedEntities.size() > 1 ||
|
||||
selectedEntities[0] != s_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId))
|
||||
{
|
||||
bool layerInSelection = false;
|
||||
|
||||
@@ -247,14 +252,14 @@ namespace AzToolsFramework
|
||||
// Edit Prefab
|
||||
if (prefabWipFeaturesEnabled && !s_prefabFocusPublicInterface->IsOwningPrefabBeingFocused(selectedEntity))
|
||||
{
|
||||
QAction* editAction = menu->addAction(QObject::tr("Edit Prefab"));
|
||||
editAction->setToolTip(QObject::tr("Edit the prefab in focus mode."));
|
||||
QAction* editAction = menu->addAction(QObject::tr("Edit Prefab"));
|
||||
editAction->setToolTip(QObject::tr("Edit the prefab in focus mode."));
|
||||
|
||||
QObject::connect(editAction, &QAction::triggered, editAction, [selectedEntity] {
|
||||
ContextMenu_EditPrefab(selectedEntity);
|
||||
});
|
||||
QObject::connect(editAction, &QAction::triggered, editAction, [selectedEntity] {
|
||||
ContextMenu_EditPrefab(selectedEntity);
|
||||
});
|
||||
|
||||
itemWasShown = true;
|
||||
itemWasShown = true;
|
||||
}
|
||||
|
||||
// Save Prefab
|
||||
@@ -283,8 +288,9 @@ namespace AzToolsFramework
|
||||
|
||||
QAction* deleteAction = menu->addAction(QObject::tr("Delete"));
|
||||
QObject::connect(deleteAction, &QAction::triggered, deleteAction, [] { ContextMenu_DeleteSelected(); });
|
||||
if (selectedEntities.size() == 0 ||
|
||||
(selectedEntities.size() == 1 && s_prefabPublicInterface->IsLevelInstanceContainerEntity(selectedEntities[0])))
|
||||
|
||||
if (selectedEntities.empty() ||
|
||||
(selectedEntities.size() == 1 && selectedEntities[0] == s_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId)))
|
||||
{
|
||||
deleteAction->setDisabled(true);
|
||||
}
|
||||
@@ -292,17 +298,17 @@ namespace AzToolsFramework
|
||||
// Detach Prefab
|
||||
if (selectedEntities.size() == 1)
|
||||
{
|
||||
AZ::EntityId selectedEntity = selectedEntities[0];
|
||||
AZ::EntityId selectedEntityId = selectedEntities[0];
|
||||
|
||||
if (s_prefabPublicInterface->IsInstanceContainerEntity(selectedEntity) &&
|
||||
!s_prefabPublicInterface->IsLevelInstanceContainerEntity(selectedEntity))
|
||||
if (s_prefabPublicInterface->IsInstanceContainerEntity(selectedEntityId) &&
|
||||
selectedEntityId != s_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId))
|
||||
{
|
||||
QAction* detachPrefabAction = menu->addAction(QObject::tr("Detach Prefab..."));
|
||||
QObject::connect(
|
||||
detachPrefabAction, &QAction::triggered, detachPrefabAction,
|
||||
[selectedEntity]
|
||||
[selectedEntityId]
|
||||
{
|
||||
ContextMenu_DetachPrefab(selectedEntity);
|
||||
ContextMenu_DetachPrefab(selectedEntityId);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -331,13 +337,21 @@ namespace AzToolsFramework
|
||||
QWidget* activeWindow = QApplication::activeWindow();
|
||||
const AZStd::string prefabFilesPath = "@projectroot@/Prefabs";
|
||||
|
||||
// Remove Level entity if it's part of the list
|
||||
|
||||
auto levelContainerIter =
|
||||
AZStd::find(selectedEntities.begin(), selectedEntities.end(), s_prefabPublicInterface->GetLevelInstanceContainerEntityId());
|
||||
if (levelContainerIter != selectedEntities.end())
|
||||
// Remove focused instance container entity if it's part of the list
|
||||
auto editorEntityContextId = AzFramework::EntityContextId::CreateNull();
|
||||
EditorEntityContextRequestBus::BroadcastResult(editorEntityContextId, &EditorEntityContextRequests::GetEditorEntityContextId);
|
||||
|
||||
auto focusedContainerIter = AZStd::find(
|
||||
selectedEntities.begin(), selectedEntities.end(),
|
||||
s_prefabFocusPublicInterface->GetFocusedPrefabContainerEntityId(editorEntityContextId));
|
||||
if (focusedContainerIter != selectedEntities.end())
|
||||
{
|
||||
selectedEntities.erase(levelContainerIter);
|
||||
selectedEntities.erase(focusedContainerIter);
|
||||
}
|
||||
|
||||
if (selectedEntities.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Set default folder for prefabs
|
||||
|
||||
@@ -178,12 +178,6 @@ namespace AzToolsFramework
|
||||
|
||||
AZ::EntityId entityId(index.data(EntityOutlinerListModel::EntityIdRole).value<AZ::u64>());
|
||||
|
||||
// We hide the root instance container entity from the Outliner, so avoid drawing its full container on children
|
||||
if (m_prefabPublicInterface->IsLevelInstanceContainerEntity(entityId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const QTreeView* outlinerTreeView(qobject_cast<const QTreeView*>(option.widget));
|
||||
const int ancestorLeft = outlinerTreeView->visualRect(index).left() + (m_prefabBorderThickness / 2) - 1;
|
||||
const int curveRectSize = m_prefabCapsuleRadius * 2;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Skin_Common.azsli"
|
||||
|
||||
// SRGs
|
||||
#include <Atom/Features/PBR/DefaultObjectSrg.azsli>
|
||||
#include <Atom/Features/Skin/SkinObjectSrg.azsli>
|
||||
#include <Atom/Features/PBR/ForwardPassSrg.azsli>
|
||||
|
||||
// Pass Output
|
||||
|
||||
@@ -973,15 +973,15 @@
|
||||
"tag": "ForwardPass"
|
||||
},
|
||||
{
|
||||
"file": "Shaders/Shadow/Shadowmap.shader",
|
||||
"file": "Shaders/Shadow/ShadowmapSkin.shader",
|
||||
"tag": "Shadowmap"
|
||||
},
|
||||
{
|
||||
"file": "Shaders/Depth/DepthPass.shader",
|
||||
"file": "Shaders/Depth/DepthPassSkin.shader",
|
||||
"tag": "DepthPass"
|
||||
},
|
||||
{
|
||||
"file": "Shaders/MotionVector/MeshMotionVector.shader",
|
||||
"file": "Shaders/MotionVector/MeshMotionVectorSkin.shader",
|
||||
"tag": "MeshMotionVector"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -27,16 +27,6 @@ ShaderResourceGroup ObjectSrg : SRG_PerObject
|
||||
return SceneSrg::GetObjectToWorldInverseTransposeMatrix(m_objectId);
|
||||
}
|
||||
|
||||
//[GFX TODO][ATOM-15280] Move wrinkle mask data from the default object srg into something specific to the Skin shader
|
||||
uint m_wrinkle_mask_count;
|
||||
float4 m_wrinkle_mask_weights[4];
|
||||
Texture2D m_wrinkle_masks[16];
|
||||
|
||||
float GetWrinkleMaskWeight(uint index)
|
||||
{
|
||||
return m_wrinkle_mask_weights[index / 4][index % 4];
|
||||
}
|
||||
|
||||
//! Reflection Probe (smallest probe volume that overlaps the object position)
|
||||
struct ReflectionProbeData
|
||||
{
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <scenesrg.srgi>
|
||||
|
||||
ShaderResourceGroup ObjectSrg : SRG_PerObject
|
||||
{
|
||||
uint m_objectId;
|
||||
|
||||
//! Returns the matrix for transforming points from Object Space to World Space.
|
||||
float4x4 GetWorldMatrix()
|
||||
{
|
||||
return SceneSrg::GetObjectToWorldMatrix(m_objectId);
|
||||
}
|
||||
|
||||
//! Returns the inverse-transpose of the world matrix.
|
||||
//! Commonly used to transform normals while supporting non-uniform scale.
|
||||
float3x3 GetWorldMatrixInverseTranspose()
|
||||
{
|
||||
return SceneSrg::GetObjectToWorldInverseTransposeMatrix(m_objectId);
|
||||
}
|
||||
|
||||
uint m_wrinkle_mask_count;
|
||||
float4 m_wrinkle_mask_weights[4];
|
||||
Texture2D m_wrinkle_masks[16];
|
||||
|
||||
float GetWrinkleMaskWeight(uint index)
|
||||
{
|
||||
return m_wrinkle_mask_weights[index / 4][index % 4];
|
||||
}
|
||||
|
||||
//! Reflection Probe (smallest probe volume that overlaps the object position)
|
||||
struct ReflectionProbeData
|
||||
{
|
||||
row_major float3x4 m_modelToWorld;
|
||||
row_major float3x4 m_modelToWorldInverse; // does not include extents
|
||||
float3 m_outerObbHalfLengths;
|
||||
float3 m_innerObbHalfLengths;
|
||||
float m_padding;
|
||||
bool m_useReflectionProbe;
|
||||
bool m_useParallaxCorrection;
|
||||
};
|
||||
|
||||
ReflectionProbeData m_reflectionProbeData;
|
||||
TextureCube m_reflectionProbeCubeMap;
|
||||
|
||||
float4x4 GetReflectionProbeWorldMatrix()
|
||||
{
|
||||
float4x4 modelToWorld = float4x4(
|
||||
float4(1, 0, 0, 0),
|
||||
float4(0, 1, 0, 0),
|
||||
float4(0, 0, 1, 0),
|
||||
float4(0, 0, 0, 1));
|
||||
|
||||
modelToWorld[0] = m_reflectionProbeData.m_modelToWorld[0];
|
||||
modelToWorld[1] = m_reflectionProbeData.m_modelToWorld[1];
|
||||
modelToWorld[2] = m_reflectionProbeData.m_modelToWorld[2];
|
||||
return modelToWorld;
|
||||
}
|
||||
|
||||
float4x4 GetReflectionProbeWorldMatrixInverse()
|
||||
{
|
||||
float4x4 modelToWorldInverse = float4x4(
|
||||
float4(1, 0, 0, 0),
|
||||
float4(0, 1, 0, 0),
|
||||
float4(0, 0, 1, 0),
|
||||
float4(0, 0, 0, 1));
|
||||
|
||||
modelToWorldInverse[0] = m_reflectionProbeData.m_modelToWorldInverse[0];
|
||||
modelToWorldInverse[1] = m_reflectionProbeData.m_modelToWorldInverse[1];
|
||||
modelToWorldInverse[2] = m_reflectionProbeData.m_modelToWorldInverse[2];
|
||||
return modelToWorldInverse;
|
||||
}
|
||||
}
|
||||
@@ -6,30 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <viewsrg.srgi>
|
||||
#include <Atom/Features/PBR/DefaultObjectSrg.azsli>
|
||||
#include <DepthPassCommon.azsli>
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
};
|
||||
|
||||
struct VSDepthOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
};
|
||||
|
||||
VSDepthOutput DepthPassVS(VSInput IN)
|
||||
{
|
||||
VSDepthOutput OUT;
|
||||
|
||||
float4x4 objectToWorld = ObjectSrg::GetWorldMatrix();
|
||||
float4 worldPosition = mul(objectToWorld, float4(IN.m_position, 1.0));
|
||||
OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, worldPosition);
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Use the depth pass shader with the default object srg
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <viewsrg.srgi>
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
};
|
||||
|
||||
struct VSDepthOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
};
|
||||
|
||||
VSDepthOutput DepthPassVS(VSInput IN)
|
||||
{
|
||||
VSDepthOutput OUT;
|
||||
|
||||
float4x4 objectToWorld = ObjectSrg::GetWorldMatrix();
|
||||
float4 worldPosition = mul(objectToWorld, float4(IN.m_position, 1.0));
|
||||
OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, worldPosition);
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Features/Skin/SkinObjectSrg.azsli>
|
||||
#include <DepthPassCommon.azsli>
|
||||
|
||||
// Use the depth pass shader with the skin object srg
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"Source" : "DepthPassSkin",
|
||||
|
||||
"DepthStencilState" : {
|
||||
"Depth" : { "Enable" : true, "CompareFunc" : "GreaterEqual" }
|
||||
},
|
||||
|
||||
"CompilerHints" : {
|
||||
"DisableOptimizations" : false
|
||||
},
|
||||
|
||||
"ProgramSettings" :
|
||||
{
|
||||
"EntryPoints":
|
||||
[
|
||||
{
|
||||
"name": "DepthPassVS",
|
||||
"type" : "Vertex"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"DrawList" : "depth"
|
||||
}
|
||||
@@ -6,77 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <scenesrg.srgi>
|
||||
#include <viewsrg.srgi>
|
||||
|
||||
#include <Atom/Features/PBR/DefaultObjectSrg.azsli>
|
||||
#include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
|
||||
#include <MeshMotionVectorCommon.azsli>
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
|
||||
// This gets set automatically by the system at runtime only if it's available.
|
||||
// There is a soft naming convention that associates this with o_prevPosition_isBound, which will be set to true whenever m_optional_prevPosition is available.
|
||||
// (search "m_optional_" in ShaderVariantAssetBuilder for details on the naming convention).
|
||||
// [GFX TODO][ATOM-14475]: Come up with a more elegant way to associate the isBound flag with the input stream.
|
||||
// Vertex position of last frame to capture small scale motion due to vertex animation
|
||||
float3 m_optional_prevPosition : POSITIONT;
|
||||
};
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
float3 m_worldPos : TEXCOORD0;
|
||||
float3 m_worldPosPrev: TEXCOORD1;
|
||||
};
|
||||
|
||||
struct PSOutput
|
||||
{
|
||||
float2 m_motion : SV_Target0;
|
||||
};
|
||||
|
||||
// Indicates whether the vertex input struct's "m_optional_prevPosition" is bound. If false, it is not safe to read from m_optional_prevPosition.
|
||||
// This option gets set automatically by the system at runtime; there is a soft naming convention that associates it with m_optional_prevPosition.
|
||||
// (search "m_optional_" in ShaderVariantAssetBuilder for details on the naming convention).
|
||||
// [GFX TODO][ATOM-14475]: Come up with a more elegant way to associate the isBound flag with the input stream.
|
||||
option bool o_prevPosition_isBound;
|
||||
|
||||
VSOutput MainVS(VSInput IN)
|
||||
{
|
||||
VSOutput OUT;
|
||||
|
||||
OUT.m_worldPos = mul(SceneSrg::GetObjectToWorldMatrix(ObjectSrg::m_objectId), float4(IN.m_position, 1.0)).xyz;
|
||||
OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(OUT.m_worldPos, 1.0));
|
||||
|
||||
if (o_prevPosition_isBound)
|
||||
{
|
||||
OUT.m_worldPosPrev = mul(SceneSrg::GetObjectToWorldMatrixPrev(ObjectSrg::m_objectId), float4(IN.m_optional_prevPosition, 1.0)).xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
OUT.m_worldPosPrev = mul(SceneSrg::GetObjectToWorldMatrixPrev(ObjectSrg::m_objectId), float4(IN.m_position, 1.0)).xyz;
|
||||
}
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
||||
PSOutput MainPS(VSOutput IN)
|
||||
{
|
||||
PSOutput OUT;
|
||||
|
||||
// Current clip position
|
||||
float4 clipPos = mul(ViewSrg::m_viewProjectionMatrix, float4(IN.m_worldPos, 1.0));
|
||||
|
||||
// Reprojected last frame's clip position, for skinned mesh it also implies last key frame
|
||||
float4 clipPosPrev = mul(ViewSrg::m_viewProjectionPrevMatrix, float4(IN.m_worldPosPrev, 1.0));
|
||||
|
||||
float2 motion = (clipPos.xy / clipPos.w - clipPosPrev.xy / clipPosPrev.w) * 0.5;
|
||||
|
||||
OUT.m_motion = motion;
|
||||
|
||||
// Flip y to line up with uv coordinates
|
||||
OUT.m_motion.y = -OUT.m_motion.y;
|
||||
|
||||
return OUT;
|
||||
}
|
||||
// Use the mesh motion vector with the default object srg
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <scenesrg.srgi>
|
||||
#include <viewsrg.srgi>
|
||||
|
||||
#include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
|
||||
|
||||
struct VSInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
|
||||
// This gets set automatically by the system at runtime only if it's available.
|
||||
// There is a soft naming convention that associates this with o_prevPosition_isBound, which will be set to true whenever m_optional_prevPosition is available.
|
||||
// (search "m_optional_" in ShaderVariantAssetBuilder for details on the naming convention).
|
||||
// [GFX TODO][ATOM-14475]: Come up with a more elegant way to associate the isBound flag with the input stream.
|
||||
// Vertex position of last frame to capture small scale motion due to vertex animation
|
||||
float3 m_optional_prevPosition : POSITIONT;
|
||||
};
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
float3 m_worldPos : TEXCOORD0;
|
||||
float3 m_worldPosPrev: TEXCOORD1;
|
||||
};
|
||||
|
||||
struct PSOutput
|
||||
{
|
||||
float2 m_motion : SV_Target0;
|
||||
};
|
||||
|
||||
// Indicates whether the vertex input struct's "m_optional_prevPosition" is bound. If false, it is not safe to read from m_optional_prevPosition.
|
||||
// This option gets set automatically by the system at runtime; there is a soft naming convention that associates it with m_optional_prevPosition.
|
||||
// (search "m_optional_" in ShaderVariantAssetBuilder for details on the naming convention).
|
||||
// [GFX TODO][ATOM-14475]: Come up with a more elegant way to associate the isBound flag with the input stream.
|
||||
option bool o_prevPosition_isBound;
|
||||
|
||||
VSOutput MainVS(VSInput IN)
|
||||
{
|
||||
VSOutput OUT;
|
||||
|
||||
OUT.m_worldPos = mul(SceneSrg::GetObjectToWorldMatrix(ObjectSrg::m_objectId), float4(IN.m_position, 1.0)).xyz;
|
||||
OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(OUT.m_worldPos, 1.0));
|
||||
|
||||
if (o_prevPosition_isBound)
|
||||
{
|
||||
OUT.m_worldPosPrev = mul(SceneSrg::GetObjectToWorldMatrixPrev(ObjectSrg::m_objectId), float4(IN.m_optional_prevPosition, 1.0)).xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
OUT.m_worldPosPrev = mul(SceneSrg::GetObjectToWorldMatrixPrev(ObjectSrg::m_objectId), float4(IN.m_position, 1.0)).xyz;
|
||||
}
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
||||
PSOutput MainPS(VSOutput IN)
|
||||
{
|
||||
PSOutput OUT;
|
||||
|
||||
// Current clip position
|
||||
float4 clipPos = mul(ViewSrg::m_viewProjectionMatrix, float4(IN.m_worldPos, 1.0));
|
||||
|
||||
// Reprojected last frame's clip position, for skinned mesh it also implies last key frame
|
||||
float4 clipPosPrev = mul(ViewSrg::m_viewProjectionPrevMatrix, float4(IN.m_worldPosPrev, 1.0));
|
||||
|
||||
float2 motion = (clipPos.xy / clipPos.w - clipPosPrev.xy / clipPosPrev.w) * 0.5;
|
||||
|
||||
OUT.m_motion = motion;
|
||||
|
||||
// Flip y to line up with uv coordinates
|
||||
OUT.m_motion.y = -OUT.m_motion.y;
|
||||
|
||||
return OUT;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Features/Skin/SkinObjectSrg.azsli>
|
||||
#include <MeshMotionVectorCommon.azsli>
|
||||
|
||||
// Use the mesh motion vector with the skin object srg
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"Source" : "MeshMotionVectorSkin",
|
||||
|
||||
"DepthStencilState" : {
|
||||
"Depth" : { "Enable" : true, "CompareFunc" : "GreaterEqual" }
|
||||
},
|
||||
|
||||
"DrawList" : "motion",
|
||||
|
||||
"ProgramSettings":
|
||||
{
|
||||
"EntryPoints":
|
||||
[
|
||||
{
|
||||
"name": "MainVS",
|
||||
"type": "Vertex"
|
||||
},
|
||||
{
|
||||
"name": "MainPS",
|
||||
"type": "Fragment"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -6,27 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <scenesrg.srgi>
|
||||
#include <viewsrg.srgi>
|
||||
#include <Atom/Features/PBR/DefaultObjectSrg.azsli>
|
||||
#include <ShadowmapCommon.azsli>
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
};
|
||||
|
||||
VertexOutput MainVS(VertexInput input)
|
||||
{
|
||||
const float4x4 worldMatrix = ObjectSrg::GetWorldMatrix();
|
||||
VertexOutput output;
|
||||
|
||||
const float3 worldPosition = mul(worldMatrix, float4(input.m_position, 1.0)).xyz;
|
||||
output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
|
||||
|
||||
return output;
|
||||
}
|
||||
// Use the shadowmap shader with the default object srg
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <scenesrg.srgi>
|
||||
#include <viewsrg.srgi>
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float3 m_position : POSITION;
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 m_position : SV_Position;
|
||||
};
|
||||
|
||||
VertexOutput MainVS(VertexInput input)
|
||||
{
|
||||
const float4x4 worldMatrix = ObjectSrg::GetWorldMatrix();
|
||||
VertexOutput output;
|
||||
|
||||
const float3 worldPosition = mul(worldMatrix, float4(input.m_position, 1.0)).xyz;
|
||||
output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Atom/Features/Skin/SkinObjectSrg.azsli>
|
||||
#include <ShadowmapCommon.azsli>
|
||||
|
||||
// Use the shadowmap shader with the skin object srg
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"Source" : "ShadowmapSkin",
|
||||
|
||||
"DepthStencilState" : {
|
||||
"Depth" : { "Enable" : true, "CompareFunc" : "LessEqual" }
|
||||
},
|
||||
|
||||
"DrawList" : "shadow",
|
||||
|
||||
"RasterState" :
|
||||
{
|
||||
"depthBias" : "10",
|
||||
"depthBiasSlopeScale" : "4"
|
||||
},
|
||||
|
||||
"ProgramSettings":
|
||||
{
|
||||
"EntryPoints":
|
||||
[
|
||||
{
|
||||
"name": "MainVS",
|
||||
"type": "Vertex"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
-1
@@ -10,6 +10,5 @@ ly_add_external_target(
|
||||
NAME renderdoc
|
||||
3RDPARTY_ROOT_DIRECTORY "${LY_RENDERDOC_PATH}"
|
||||
VERSION
|
||||
INCLUDE_DIRECTORIES .
|
||||
COMPILE_DEFINITIONS USE_RENDERDOC
|
||||
)
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
#
|
||||
#
|
||||
|
||||
set(RENDERDOC_RUNTIME_DEPENDENCIES "${BASE_PATH}/librenderdoc.so")
|
||||
set(RENDERDOC_RUNTIME_DEPENDENCIES "${BASE_PATH}/lib/librenderdoc.so")
|
||||
set(RENDERDOC_INCLUDE_DIRECTORIES "include")
|
||||
|
||||
@@ -7,3 +7,4 @@
|
||||
#
|
||||
|
||||
set(RENDERDOC_RUNTIME_DEPENDENCIES "${BASE_PATH}/renderdoc.dll")
|
||||
set(RENDERDOC_INCLUDE_DIRECTORIES ".")
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace LmbrCentral
|
||||
return intersection;
|
||||
}
|
||||
|
||||
const bool intersection = AZ::Intersect::IntersectRayObb(src, dir, m_intersectionDataCache.m_obb, distance) > 0;
|
||||
const bool intersection = AZ::Intersect::IntersectRayObb(src, dir, m_intersectionDataCache.m_obb, distance);
|
||||
return intersection;
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace LmbrCentral
|
||||
m_intersectionDataCache.UpdateIntersectionParams(m_currentTransform, m_diskShapeConfig);
|
||||
|
||||
return AZ::Intersect::IntersectRayDisk(
|
||||
src, dir, m_intersectionDataCache.m_position, m_intersectionDataCache.m_radius, m_intersectionDataCache.m_normal, distance) > 0;
|
||||
src, dir, m_intersectionDataCache.m_position, m_intersectionDataCache.m_radius, m_intersectionDataCache.m_normal, distance);
|
||||
}
|
||||
|
||||
void DiskShape::DiskIntersectionDataCache::UpdateIntersectionParamsImpl(
|
||||
|
||||
@@ -567,13 +567,15 @@ namespace Terrain
|
||||
ShaderMacroMaterialData& shaderData = macroMaterialData.at(i);
|
||||
const AZ::Aabb& materialBounds = materialData.m_bounds;
|
||||
|
||||
// Use reverse coordinates (1 - y) for the y direction so that the lower left corner of the macro material images
|
||||
// map to the lower left corner in world space. This will match up with the height uv coordinate mapping.
|
||||
shaderData.m_uvMin = {
|
||||
(xPatch - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(),
|
||||
(yPatch - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()
|
||||
1.0f - ((yPatch - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent())
|
||||
};
|
||||
shaderData.m_uvMax = {
|
||||
((xPatch + GridMeters) - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(),
|
||||
((yPatch + GridMeters) - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()
|
||||
1.0f - (((yPatch + GridMeters) - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent())
|
||||
};
|
||||
shaderData.m_normalFactor = materialData.m_normalFactor;
|
||||
shaderData.m_flipNormalX = materialData.m_normalFlipX;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"remote_port": 45643,
|
||||
"connect_to_remote": 0,
|
||||
"windows_connect_to_remote": 1,
|
||||
"linux_connect_to_remote": 0,
|
||||
"linux_connect_to_remote": 1,
|
||||
"provo_connect_to_remote": 1,
|
||||
"salem_connect_to_remote": 0,
|
||||
"jasper_connect_to_remote": 0,
|
||||
@@ -29,7 +29,7 @@
|
||||
"salem_wait_for_connect": 0,
|
||||
"jasper_wait_for_connect": 0,
|
||||
"windows_wait_for_connect": 1,
|
||||
"linux_wait_for_connect": 0,
|
||||
"linux_wait_for_connect": 1,
|
||||
"android_wait_for_connect": 0,
|
||||
"ios_wait_for_connect": 0,
|
||||
"mac_wait_for_connect": 0,
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(o3de_gem_json ${o3de_gem_path}/gem.json)
|
||||
o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name")
|
||||
o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path)
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${o3de_gem_restricted_path}" ${o3de_gem_path} ${o3de_gem_name})
|
||||
|
||||
# Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the
|
||||
# project cmake for this platform.
|
||||
include(${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_gem.cmake)
|
||||
|
||||
ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty)
|
||||
|
||||
add_subdirectory(Code)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Source/${Name}EditorSystemComponent.cpp
|
||||
Source/${Name}EditorSystemComponent.h
|
||||
Source/${Name}Widget.cpp
|
||||
Source/${Name}Widget.h
|
||||
Source/${Name}.qrc
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Source/${Name}EditorModule.cpp
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Tests/${Name}EditorTest.cpp
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Include/${Name}/${Name}Bus.h
|
||||
Source/${Name}ModuleInterface.h
|
||||
Source/${Name}SystemComponent.cpp
|
||||
Source/${Name}SystemComponent.h
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Source/${Name}Module.cpp
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(FILES
|
||||
Tests/${Name}Test.cpp
|
||||
)
|
||||
@@ -0,0 +1,168 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR}
|
||||
# Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}
|
||||
# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform
|
||||
# in which case it will see if that platform is present here or in the restricted folder.
|
||||
# i.e. It could here in our gem : Gems/${Name}/Code/Platform/<platorm_name> or
|
||||
# <restricted_folder>/<platform_name>/Gems/${Name}/Code
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name})
|
||||
|
||||
# Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the
|
||||
# traits for this platform. Traits for a platform are defines for things like whether or not something in this gem
|
||||
# is supported by this platform.
|
||||
include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
|
||||
# Add the ${Name}.Static target
|
||||
# Note: We include the common files and the platform specific files which are set in ${NameLower}_common_files.cmake
|
||||
# and in ${pal_dir}/${NameLower}_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
ly_add_target(
|
||||
NAME ${Name}.Static STATIC
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
${NameLower}_files.cmake
|
||||
${pal_dir}/${NameLower}_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
Include
|
||||
PRIVATE
|
||||
Source
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::AzCore
|
||||
AZ::AzFramework
|
||||
)
|
||||
|
||||
# Here add ${Name} target, it depends on the ${Name}.Static
|
||||
ly_add_target(
|
||||
NAME ${Name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
${NameLower}_shared_files.cmake
|
||||
${pal_dir}/${NameLower}_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
Include
|
||||
PRIVATE
|
||||
Source
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
Gem::${Name}.Static
|
||||
)
|
||||
|
||||
# By default, we will specify that the above target ${Name} would be used by
|
||||
# Client and Server type targets when this gem is enabled. If you don't want it
|
||||
# active in Clients or Servers by default, delete one of both of the following lines:
|
||||
ly_create_alias(NAME ${Name}.Clients NAMESPACE Gem TARGETS Gem::${Name})
|
||||
ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name})
|
||||
|
||||
# If we are on a host platform, we want to add the host tools targets like the ${Name}.Editor target which
|
||||
# will also depend on ${Name}.Static
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_target(
|
||||
NAME ${Name}.Editor.Static STATIC
|
||||
NAMESPACE Gem
|
||||
AUTOMOC
|
||||
AUTORCC
|
||||
FILES_CMAKE
|
||||
${NameLower}_editor_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Source
|
||||
PUBLIC
|
||||
Include
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::AzToolsFramework
|
||||
Gem::${Name}.Static
|
||||
)
|
||||
|
||||
ly_add_target(
|
||||
NAME ${Name}.Editor GEM_MODULE
|
||||
NAMESPACE Gem
|
||||
AUTOMOC
|
||||
FILES_CMAKE
|
||||
${NameLower}_editor_shared_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Source
|
||||
PUBLIC
|
||||
Include
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
Gem::${Name}.Editor.Static
|
||||
)
|
||||
|
||||
# By default, we will specify that the above target ${Name} would be used by
|
||||
# Tool and Builder type targets when this gem is enabled. If you don't want it
|
||||
# active in Tools or Builders by default, delete one of both of the following lines:
|
||||
ly_create_alias(NAME ${Name}.Tools NAMESPACE Gem TARGETS Gem::${Name}.Editor)
|
||||
ly_create_alias(NAME ${Name}.Builders NAMESPACE Gem TARGETS Gem::${Name}.Editor)
|
||||
|
||||
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Tests
|
||||
################################################################################
|
||||
# See if globally, tests are supported
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
# We globally support tests, see if we support tests on this platform for ${Name}.Static
|
||||
if(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED)
|
||||
# We support ${Name}.Tests on this platform, add ${Name}.Tests target which depends on ${Name}.Static
|
||||
ly_add_target(
|
||||
NAME ${Name}.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
${NameLower}_files.cmake
|
||||
${NameLower}_tests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Tests
|
||||
Source
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzTest
|
||||
AZ::AzFramework
|
||||
Gem::${Name}.Static
|
||||
)
|
||||
|
||||
# Add ${Name}.Tests to googletest
|
||||
ly_add_googletest(
|
||||
NAME Gem::${Name}.Tests
|
||||
)
|
||||
endif()
|
||||
|
||||
# If we are a host platform we want to add tools test like editor tests here
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# We are a host platform, see if Editor tests are supported on this platform
|
||||
if(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED)
|
||||
# We support ${Name}.Editor.Tests on this platform, add ${Name}.Editor.Tests target which depends on ${Name}.Editor
|
||||
ly_add_target(
|
||||
NAME ${Name}.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
${NameLower}_editor_tests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Tests
|
||||
Source
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzTest
|
||||
Gem::${Name}.Editor
|
||||
)
|
||||
|
||||
# Add ${Name}.Editor.Tests to googletest
|
||||
ly_add_googletest(
|
||||
NAME Gem::${Name}.Editor.Tests
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,40 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}Requests
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(${SanitizedCppName}Requests, "{${Random_Uuid}}");
|
||||
virtual ~${SanitizedCppName}Requests() = default;
|
||||
// Put your public methods here
|
||||
};
|
||||
|
||||
class ${SanitizedCppName}BusTraits
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
using ${SanitizedCppName}RequestBus = AZ::EBus<${SanitizedCppName}Requests, ${SanitizedCppName}BusTraits>;
|
||||
using ${SanitizedCppName}Interface = AZ::Interface<${SanitizedCppName}Requests>;
|
||||
|
||||
} // namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Android
|
||||
# i.e. ../Source/Android/${Name}Android.cpp
|
||||
# ../Source/Android/${Name}Android.h
|
||||
# ../Include/Android/${Name}Android.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Android
|
||||
# i.e. ../Source/Android/${Name}Android.cpp
|
||||
# ../Source/Android/${Name}Android.h
|
||||
# ../Include/Android/${Name}Android.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(PAL_TRAIT_${NameUpper}_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED FALSE)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Linux
|
||||
# i.e. ../Source/Linux/${Name}Linux.cpp
|
||||
# ../Source/Linux/${Name}Linux.h
|
||||
# ../Include/Linux/${Name}Linux.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Linux
|
||||
# i.e. ../Source/Linux/${Name}Linux.cpp
|
||||
# ../Source/Linux/${Name}Linux.h
|
||||
# ../Include/Linux/${Name}Linux.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(PAL_TRAIT_${NameUpper}_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED TRUE)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Mac
|
||||
# i.e. ../Source/Mac/${Name}Mac.cpp
|
||||
# ../Source/Mac/${Name}Mac.h
|
||||
# ../Include/Mac/${Name}Mac.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Mac
|
||||
# i.e. ../Source/Mac/${Name}Mac.cpp
|
||||
# ../Source/Mac/${Name}Mac.h
|
||||
# ../Include/Mac/${Name}Mac.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(PAL_TRAIT_${NameUpper}_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED TRUE)
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Windows
|
||||
# i.e. ../Source/Windows/${Name}Windows.cpp
|
||||
# ../Source/Windows/${Name}Windows.h
|
||||
# ../Include/Windows/${Name}Windows.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for Windows
|
||||
# i.e. ../Source/Windows/${Name}Windows.cpp
|
||||
# ../Source/Windows/${Name}Windows.h
|
||||
# ../Include/Windows/${Name}Windows.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(PAL_TRAIT_${NameUpper}_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED TRUE)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for iOS
|
||||
# i.e. ../Source/iOS/${Name}iOS.cpp
|
||||
# ../Source/iOS/${Name}iOS.h
|
||||
# ../Include/iOS/${Name}iOS.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
# Platform specific files for iOS
|
||||
# i.e. ../Source/iOS/${Name}iOS.cpp
|
||||
# ../Source/iOS/${Name}iOS.h
|
||||
# ../Include/iOS/${Name}iOS.h
|
||||
|
||||
set(FILES
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
set(PAL_TRAIT_${NameUpper}_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_TEST_SUPPORTED TRUE)
|
||||
set(PAL_TRAIT_${NameUpper}_EDITOR_TEST_SUPPORTED FALSE)
|
||||
@@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/${Name}">
|
||||
<file alias="toolbar_icon.svg">toolbar_icon.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1,55 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <${Name}ModuleInterface.h>
|
||||
#include <${Name}EditorSystemComponent.h>
|
||||
|
||||
void Init${SanitizedCppName}Resources()
|
||||
{
|
||||
// We must register our Qt resources (.qrc file) since this is being loaded from a separate module (gem)
|
||||
Q_INIT_RESOURCE(${SanitizedCppName});
|
||||
}
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}EditorModule
|
||||
: public ${SanitizedCppName}ModuleInterface
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(${SanitizedCppName}EditorModule, "${ModuleClassId}", ${SanitizedCppName}ModuleInterface);
|
||||
AZ_CLASS_ALLOCATOR(${SanitizedCppName}EditorModule, AZ::SystemAllocator, 0);
|
||||
|
||||
${SanitizedCppName}EditorModule()
|
||||
{
|
||||
Init${SanitizedCppName}Resources();
|
||||
|
||||
// Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
|
||||
// Add ALL components descriptors associated with this gem to m_descriptors.
|
||||
// This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
|
||||
// This happens through the [MyComponent]::Reflect() function.
|
||||
m_descriptors.insert(m_descriptors.end(), {
|
||||
${SanitizedCppName}EditorSystemComponent::CreateDescriptor(),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add required SystemComponents to the SystemEntity.
|
||||
* Non-SystemComponents should not be added here
|
||||
*/
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const override
|
||||
{
|
||||
return AZ::ComponentTypeList {
|
||||
azrtti_typeid<${SanitizedCppName}EditorSystemComponent>(),
|
||||
};
|
||||
}
|
||||
};
|
||||
}// namespace ${SanitizedCppName}
|
||||
|
||||
AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}EditorModule)
|
||||
@@ -0,0 +1,78 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
#include <AzToolsFramework/API/ViewPaneOptions.h>
|
||||
|
||||
#include <${Name}Widget.h>
|
||||
#include <${Name}EditorSystemComponent.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
void ${SanitizedCppName}EditorSystemComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<${SanitizedCppName}EditorSystemComponent, ${SanitizedCppName}SystemComponent>()
|
||||
->Version(0);
|
||||
}
|
||||
}
|
||||
|
||||
${SanitizedCppName}EditorSystemComponent::${SanitizedCppName}EditorSystemComponent() = default;
|
||||
|
||||
${SanitizedCppName}EditorSystemComponent::~${SanitizedCppName}EditorSystemComponent() = default;
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
BaseSystemComponent::GetProvidedServices(provided);
|
||||
provided.push_back(AZ_CRC_CE("${SanitizedCppName}EditorService"));
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
BaseSystemComponent::GetIncompatibleServices(incompatible);
|
||||
incompatible.push_back(AZ_CRC_CE("${SanitizedCppName}EditorService"));
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
|
||||
{
|
||||
BaseSystemComponent::GetRequiredServices(required);
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
|
||||
{
|
||||
BaseSystemComponent::GetDependentServices(dependent);
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::Activate()
|
||||
{
|
||||
${SanitizedCppName}SystemComponent::Activate();
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::Deactivate()
|
||||
{
|
||||
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
|
||||
${SanitizedCppName}SystemComponent::Deactivate();
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}EditorSystemComponent::NotifyRegisterViews()
|
||||
{
|
||||
AzToolsFramework::ViewPaneOptions options;
|
||||
options.paneRect = QRect(100, 100, 500, 400);
|
||||
options.showOnToolsToolbar = true;
|
||||
options.toolbarIcon = ":/${Name}/toolbar_icon.svg";
|
||||
|
||||
// Register our custom widget as a dockable tool with the Editor
|
||||
AzToolsFramework::RegisterViewPane<${SanitizedCppName}Widget>("${Name}", "Tools", options);
|
||||
}
|
||||
|
||||
} // namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,45 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <${Name}SystemComponent.h>
|
||||
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
/// System component for ${SanitizedCppName} editor
|
||||
class ${SanitizedCppName}EditorSystemComponent
|
||||
: public ${SanitizedCppName}SystemComponent
|
||||
, private AzToolsFramework::EditorEvents::Bus::Handler
|
||||
{
|
||||
using BaseSystemComponent = ${SanitizedCppName}SystemComponent;
|
||||
public:
|
||||
AZ_COMPONENT(${SanitizedCppName}EditorSystemComponent, "${EditorSysCompClassId}", BaseSystemComponent);
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
${SanitizedCppName}EditorSystemComponent();
|
||||
~${SanitizedCppName}EditorSystemComponent();
|
||||
|
||||
private:
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
||||
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
||||
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
|
||||
|
||||
// AZ::Component
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
|
||||
// AzToolsFramework::EditorEventsBus overrides ...
|
||||
void NotifyRegisterViews() override;
|
||||
};
|
||||
} // namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,25 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <${Name}ModuleInterface.h>
|
||||
#include <${Name}SystemComponent.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}Module
|
||||
: public ${SanitizedCppName}ModuleInterface
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(${SanitizedCppName}Module, "${ModuleClassId}", ${SanitizedCppName}ModuleInterface);
|
||||
AZ_CLASS_ALLOCATOR(${SanitizedCppName}Module, AZ::SystemAllocator, 0);
|
||||
};
|
||||
}// namespace ${SanitizedCppName}
|
||||
|
||||
AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}Module)
|
||||
@@ -0,0 +1,45 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/Module/Module.h>
|
||||
#include <${Name}SystemComponent.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}ModuleInterface
|
||||
: public AZ::Module
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(${SanitizedCppName}ModuleInterface, "{${Random_Uuid}}", AZ::Module);
|
||||
AZ_CLASS_ALLOCATOR(${SanitizedCppName}ModuleInterface, AZ::SystemAllocator, 0);
|
||||
|
||||
${SanitizedCppName}ModuleInterface()
|
||||
{
|
||||
// Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
|
||||
// Add ALL components descriptors associated with this gem to m_descriptors.
|
||||
// This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
|
||||
// This happens through the [MyComponent]::Reflect() function.
|
||||
m_descriptors.insert(m_descriptors.end(), {
|
||||
${SanitizedCppName}SystemComponent::CreateDescriptor(),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add required SystemComponents to the SystemEntity.
|
||||
*/
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const override
|
||||
{
|
||||
return AZ::ComponentTypeList{
|
||||
azrtti_typeid<${SanitizedCppName}SystemComponent>(),
|
||||
};
|
||||
}
|
||||
};
|
||||
}// namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,92 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <${Name}SystemComponent.h>
|
||||
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/EditContextConstants.inl>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
void ${SanitizedCppName}SystemComponent::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serialize->Class<${SanitizedCppName}SystemComponent, AZ::Component>()
|
||||
->Version(0)
|
||||
;
|
||||
|
||||
if (AZ::EditContext* ec = serialize->GetEditContext())
|
||||
{
|
||||
ec->Class<${SanitizedCppName}SystemComponent>("${SanitizedCppName}", "[Description of functionality provided by this System Component]")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System"))
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
{
|
||||
provided.push_back(AZ_CRC_CE("${SanitizedCppName}Service"));
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
|
||||
{
|
||||
incompatible.push_back(AZ_CRC_CE("${SanitizedCppName}Service"));
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
|
||||
{
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
|
||||
{
|
||||
}
|
||||
|
||||
${SanitizedCppName}SystemComponent::${SanitizedCppName}SystemComponent()
|
||||
{
|
||||
if (${SanitizedCppName}Interface::Get() == nullptr)
|
||||
{
|
||||
${SanitizedCppName}Interface::Register(this);
|
||||
}
|
||||
}
|
||||
|
||||
${SanitizedCppName}SystemComponent::~${SanitizedCppName}SystemComponent()
|
||||
{
|
||||
if (${SanitizedCppName}Interface::Get() == this)
|
||||
{
|
||||
${SanitizedCppName}Interface::Unregister(this);
|
||||
}
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::Init()
|
||||
{
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::Activate()
|
||||
{
|
||||
${SanitizedCppName}RequestBus::Handler::BusConnect();
|
||||
AZ::TickBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::Deactivate()
|
||||
{
|
||||
AZ::TickBus::Handler::BusDisconnect();
|
||||
${SanitizedCppName}RequestBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
void ${SanitizedCppName}SystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,56 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzCore/Component/TickBus.h>
|
||||
#include <${Name}/${Name}Bus.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}SystemComponent
|
||||
: public AZ::Component
|
||||
, protected ${SanitizedCppName}RequestBus::Handler
|
||||
, public AZ::TickBus::Handler
|
||||
{
|
||||
public:
|
||||
AZ_COMPONENT(${SanitizedCppName}SystemComponent, "${SysCompClassId}");
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
|
||||
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
|
||||
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
|
||||
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
|
||||
|
||||
${SanitizedCppName}SystemComponent();
|
||||
~${SanitizedCppName}SystemComponent();
|
||||
|
||||
protected:
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// ${SanitizedCppName}RequestBus interface implementation
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AZ::Component interface implementation
|
||||
void Init() override;
|
||||
void Activate() override;
|
||||
void Deactivate() override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// AZTickBus interface implementation
|
||||
void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
} // namespace ${SanitizedCppName}
|
||||
@@ -0,0 +1,44 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <${Name}Widget.h>
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
${SanitizedCppName}Widget::${SanitizedCppName}Widget(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
setWindowTitle(QObject::tr("${Name}"));
|
||||
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout(this);
|
||||
|
||||
QLabel* introLabel = new QLabel(QObject::tr("Put your cool stuff here!"), this);
|
||||
mainLayout->addWidget(introLabel, 0, Qt::AlignCenter);
|
||||
|
||||
QString helpText = QString(
|
||||
"For help getting started, visit the <a href=\"https://o3de.org/docs/tools-ui/ui-dev-intro/\">UI Development</a> documentation<br/>or come ask a question in the <a href=\"https://discord.gg/R77Wss3kHe\">sig-ui-ux channel</a> on Discord");
|
||||
|
||||
QLabel* helpLabel = new QLabel(this);
|
||||
helpLabel->setTextFormat(Qt::RichText);
|
||||
helpLabel->setText(helpText);
|
||||
helpLabel->setOpenExternalLinks(true);
|
||||
|
||||
mainLayout->addWidget(helpLabel, 0, Qt::AlignCenter);
|
||||
|
||||
setLayout(mainLayout);
|
||||
}
|
||||
}
|
||||
|
||||
#include <moc_${Name}Widget.cpp>
|
||||
@@ -0,0 +1,28 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
|
||||
|
||||
#include <QWidget>
|
||||
#endif
|
||||
|
||||
namespace ${SanitizedCppName}
|
||||
{
|
||||
class ${SanitizedCppName}Widget
|
||||
: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ${SanitizedCppName}Widget(QWidget* parent = nullptr);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><g><rect fill="none" height="24" width="24"/><path d="M19,3H5C3.89,3,3,3.9,3,5v14c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.11,3,19,3z M19,19H5V7h14V19z M13.5,13 c0,0.83-0.67,1.5-1.5,1.5s-1.5-0.67-1.5-1.5c0-0.83,0.67-1.5,1.5-1.5S13.5,12.17,13.5,13z M12,9c-2.73,0-5.06,1.66-6,4 c0.94,2.34,3.27,4,6,4s5.06-1.66,6-4C17.06,10.66,14.73,9,12,9z M12,15.5c-1.38,0-2.5-1.12-2.5-2.5c0-1.38,1.12-2.5,2.5-2.5 c1.38,0,2.5,1.12,2.5,2.5C14.5,14.38,13.38,15.5,12,15.5z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 607 B |
@@ -0,0 +1,13 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);
|
||||
@@ -0,0 +1,13 @@
|
||||
// {BEGIN_LICENSE}
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
// {END_LICENSE}
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
|
||||
AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);
|
||||
@@ -0,0 +1,8 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Tags": ["Android"],
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# {BEGIN_LICENSE}
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
# {END_LICENSE}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Tags": ["Linux"]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user