Initial stub terrain gem (#3368)

This is the initial Terrain Gem. In this PR, it doesn't do anything, but it contains all of the initial code, icons, and build scripts for the gem to compile and build successfully. The follow-up PR will contain the first round of functioning code.

Also, with the creation of the gem, the TerrainSurfaceDataSystemComponent is getting relocated from the SurfaceData Gem to the Terrain Gem. This should have no impact, as that component has provided no active functionality in o3de. (It will start working again with the initial terrain system code in the next PR)

This also adds a couple of null guards to prefab code to prevent AP crashes, and fixed an incorrect service dependency in the VegetationSystemComponent that was exposed by moving the TerrainSurfaceDataSystemComponent.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-08-23 15:41:57 -05:00
committed by GitHub
parent ea5bfe0269
commit 97a053a540
40 changed files with 830 additions and 23 deletions
@@ -650,7 +650,10 @@ namespace AzToolsFramework
AZStd::unique_ptr<AZ::Entity> Instance::DetachContainerEntity()
{
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
if (m_containerEntity)
{
m_instanceEntityMapper->UnregisterEntity(m_containerEntity->GetId());
}
return AZStd::move(m_containerEntity);
}
}
@@ -65,16 +65,24 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils
AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities();
for (auto it = entities.begin(); it != entities.end(); )
{
(*it)->InvalidateDependencies();
AZ::Entity::DependencySortOutcome evaluation = (*it)->EvaluateDependenciesGetDetails();
if (evaluation.IsSuccess())
if (*it)
{
++it;
(*it)->InvalidateDependencies();
AZ::Entity::DependencySortOutcome evaluation = (*it)->EvaluateDependenciesGetDetails();
if (evaluation.IsSuccess())
{
++it;
}
else
{
AZ_Error(
"Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", (*it)->GetName().c_str(),
(*it)->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str());
it = entities.erase(it);
}
}
else
{
AZ_Error("Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s",
(*it)->GetName().c_str(), (*it)->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str());
it = entities.erase(it);
}
}
@@ -10,7 +10,6 @@
#include <SurfaceDataSystemComponent.h>
#include <Components/SurfaceDataColliderComponent.h>
#include <Components/SurfaceDataShapeComponent.h>
#include <TerrainSurfaceDataSystemComponent.h>
namespace SurfaceData
{
@@ -20,7 +19,6 @@ namespace SurfaceData
SurfaceDataSystemComponent::CreateDescriptor(),
SurfaceDataColliderComponent::CreateDescriptor(),
SurfaceDataShapeComponent::CreateDescriptor(),
Terrain::TerrainSurfaceDataSystemComponent::CreateDescriptor(),
});
}
@@ -28,7 +26,6 @@ namespace SurfaceData
{
return AZ::ComponentTypeList{
azrtti_typeid<SurfaceDataSystemComponent>(),
azrtti_typeid<Terrain::TerrainSurfaceDataSystemComponent>(),
};
}
}
@@ -19,8 +19,6 @@ set(FILES
Include/SurfaceData/Utility/SurfaceDataUtility.h
Source/SurfaceDataSystemComponent.cpp
Source/SurfaceDataSystemComponent.h
Source/TerrainSurfaceDataSystemComponent.cpp
Source/TerrainSurfaceDataSystemComponent.h
Source/SurfaceTag.cpp
Source/Components/SurfaceDataColliderComponent.cpp
Source/Components/SurfaceDataColliderComponent.h
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Height</title>
<g id="icon-/-Environmental-/-Terrain-Height" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M15,4 L22,20 L7.9986687,19.9993631 L7.9986687,14.9993631 L10,15 L8,11 L7.9986687,11.0013631 L7.9986687,8.00136309 L8,8 L10.8,13.6 L15,4 Z M15,7 L13,12 L17,12 L15,7 Z M7.21914721,0.964363085 L7.21914721,5.50135833 L5.8081113,5.50135833 L5.8081113,6.20344432 L7.21914721,6.20344432 L7.21914721,7.31885826 L5.8081113,7.31885826 L5.8081113,7.94758992 L7.21914721,7.94758992 L7.21914721,9.12604407 L6.01490518,9.12604407 L6.01490518,9.69309095 L7.21914721,9.69309095 L7.21914721,10.8434468 L6.01490518,10.8434468 L6.01490518,11.3367478 L7.21914721,11.3367478 L7.21914721,12.561057 L6.01490518,12.561057 L6.01490518,13.2062487 L7.21914721,13.2062487 L7.21914721,14.3024381 L6.01490518,14.3024381 L6.01490518,14.9912747 L7.21914721,14.9912747 L7.21914721,16.0640829 L6.01490518,16.0640829 L6.01490518,16.762272 L7.21914721,16.762272 L7.21914721,17.9022362 L6.01490518,17.9022362 L6.01490518,18.5465186 L7.21914721,18.5465186 L7.21914721,19.5980239 L6.01490518,19.5980239 L6.01490518,20.2294467 L7.21914721,20.2294467 L7.21914721,21.2565316 L5.8081113,21.2565316 L5.8081113,21.9825184 L7.21914721,21.9825184 L7.21914721,23.0479225 L2.9026687,23.0479225 C2.35038395,23.0479225 1.9026687,22.6002072 1.9026687,22.0479225 L1.9026687,1.96436309 C1.9026687,1.41207834 2.35038395,0.964363085 2.9026687,0.964363085 L7.21914721,0.964363085 Z M4.60708525,1.76269886 C4.1792616,1.76269886 3.832442,2.10951846 3.832442,2.53734212 C3.832442,2.96516577 4.1792616,3.31198537 4.60708525,3.31198537 C5.03490891,3.31198537 5.38172851,2.96516577 5.38172851,2.53734212 C5.38172851,2.10951846 5.03490891,1.76269886 4.60708525,1.76269886 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Mesh</title>
<g id="icon-/-Environmental-/-Terrain-Mesh" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M16,5.23640192 L23,21.2364019 L1,21.2364019 L3.153,16.9310652 L10.848,16.9310652 L10.867,16.9694019 L16,5.23640192 Z M11.279112,8.05162125 C11.8313968,8.05162125 12.279112,8.4993365 12.279112,9.05162125 L12.279112,9.57054521 L9.49851168,15.5710293 L2,15.5710293 C1.44771525,15.5710293 1,15.123314 1,14.5710293 L1,9.05162125 C1,8.4993365 1.44771525,8.05162125 2,8.05162125 L11.279112,8.05162125 Z M16,8.23640192 L14,13.2364019 L18,13.2364019 L16,8.23640192 Z M11.339186,5.23184324 L11.339186,7.11169525 L1.939926,7.11169525 L1.939926,5.23184324 L11.339186,5.23184324 Z M10.39926,2.41206524 L10.39926,4.29191724 L2.879852,4.29191724 L2.879852,2.41206524 L10.39926,2.41206524 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Generate Terrian </title>
<g id="icon-/-Environmental-/-Generate-Terrian-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M16,5.23640192 L23,21.2364019 L1,21.2364019 L3.153,16.9311553 L10.7351274,16.9317461 L10.786,16.8081553 L10.867,16.9694019 L16,5.23640192 Z M10.7866981,7.88269686 C11.1462033,8.9008023 11.3517156,9.91858532 11.3517156,10.6951961 C11.3517156,13.0695588 9.43072532,14.9943601 7.06106374,14.9943601 C4.69140216,14.9943601 2.77041189,13.0695588 2.77041189,10.6951961 C2.77041189,9.98779834 2.94092524,9.08030022 3.24301589,8.15472512 L5.48573411,10.2222098 L7.16571378,8.51342542 L8.83993571,10.2222098 L10.7866981,7.88269686 Z M16,8.23640192 L14,13.2364019 L18,13.2364019 L16,8.23640192 Z M7.06106374,3.69215527 C8.35768587,3.69215527 9.51997507,5.07798918 10.306728,6.72204766 L8.83082438,8.28190713 L7.15660245,6.58611652 L5.47662277,8.28190713 L3.80919728,6.73502979 C4.59603726,5.08529116 5.76103013,3.69215527 7.06106374,3.69215527 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Refactor</title>
<g id="icon-/-Environmental-/-Terrain-Refactor" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
<path d="M2,20 L8,8 L10.8,13.6 L15,4 L22,20 L2,20 Z M8,11 L6,15 L10,15 L8,11 Z M15,7 L13,12 L17,12 L15,7 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 611 B

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain World Debugger</title>
<g id="icon-/-Environmental-/-Terrain-World-Debugger" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
<path d="M16,5.23640192 L23,21.2364019 L1,21.2364019 L4.034,15.1675981 L5.534,15.1675981 L5,16.2364019 L9,16.2364019 L8.466,15.1675981 L9.966,15.1675981 L10.867,16.9694019 L16,5.23640192 Z M5.7575896,2.84113022 C6.03130743,3.01216811 5.99303429,3.29144758 5.82199641,3.56516541 C5.5939459,3.93012252 5.63692265,4.11800916 5.79661523,4.47152561 C6.28699059,4.39735197 7.01109383,4.59333567 7.42167058,4.8498925 C7.55852949,4.93541144 7.6668821,5.06655002 7.80374101,5.15206897 C8.11735815,5.15774162 8.40246897,5.20903391 8.76170575,5.24321288 L9.24631309,4.46767902 C8.9379383,4.03250676 8.70982422,3.7208123 8.56197083,3.53259562 C8.34019074,3.25027061 9.17154039,2.55841555 9.4400416,2.93949264 C9.57872751,3.13632611 9.82791397,3.48184986 10.187601,3.9760639 C10.2921591,4.119728 10.3942808,4.6608066 10.3267772,4.76883491 L9.87364273,5.4940017 C10.1587536,5.54529399 10.3697384,5.61369961 10.5807233,5.68210522 C10.8373278,5.77901716 11.1395519,5.9044354 11.4132698,6.07547329 L11.7101975,5.60028961 C11.8353154,5.40005911 12.2927086,5.36754107 12.4693791,5.39797939 C13.0265899,5.49398048 13.4462261,5.56768275 13.7282877,5.61908617 C14.2855266,5.72063845 13.9217192,6.73248862 13.5801311,6.66829019 C13.3524057,6.62549124 12.9722579,6.55710151 12.4396878,6.46312102 L12.2686499,6.73683885 C12.5480881,7.10174828 13.0794962,7.47936459 13.5424736,8.2230391 C13.2332304,8.82332896 12.3709586,10.4987773 10.9556581,13.249384 C10.2300617,13.3746794 8.81376094,13.077921 8.3917912,12.9411097 L8.22075331,13.2148276 C8.50116176,13.5796109 8.72927585,13.8913054 8.90509558,14.149911 C9.16882518,14.5378194 8.27592007,15.0939625 8.02702481,14.743014 C7.89765153,14.5605944 7.64842782,14.2153849 7.2793537,13.7073854 C7.12105098,13.489495 7.07511207,13.0179769 7.14377888,12.908087 L7.42238579,12.4622227 C7.14866796,12.2911849 6.90345644,12.0745273 6.70386456,11.8863761 C6.50427268,11.6982249 6.37880675,11.4929604 6.22483451,11.3333155 L5.71101869,12.1555927 C5.66374222,12.2312508 5.39038727,12.3573847 5.30398078,12.3447359 C4.6772029,12.2529836 4.15546889,12.1592118 3.73877875,12.0634204 C3.21667547,11.8756628 3.41280304,11.0226842 3.88693529,11.0142164 C4.12232485,11.0454571 4.51197472,11.0986403 5.0558849,11.1737659 L5.54049224,10.3982321 C5.32378704,10.1359549 5.18120779,9.85656443 5.03862853,9.57717395 C4.8732633,9.53727464 4.70789807,9.49737534 4.57103915,9.4118564 C4.1604624,9.15529957 3.78986942,8.48459472 3.61306352,8.05695233 C3.17970079,8.03988668 2.99858532,8.18114181 2.77053481,8.54609893 C2.59949692,8.81981676 2.32495313,9.10238902 2.0512353,8.93135114 C1.77751746,8.76031325 1.77825895,8.55548589 1.94929684,8.28176806 C2.34838524,7.64309311 2.76327156,7.33075241 3.4931381,7.27936476 C3.53871006,6.80038239 3.65840797,6.3042867 3.94347111,5.84809031 C4.22853425,5.39189392 4.59344369,5.11245575 5.00397276,4.86152389 C4.73020724,4.18299733 4.73852278,3.70999986 5.13761117,3.07132492 C5.30864906,2.79760708 5.48387176,2.67009234 5.7575896,2.84113022 Z M16,8.23640192 L14,13.2364019 L18,13.2364019 L16,8.23640192 Z M8.03008933,6.27169476 C7.86593803,6.90855503 7.62722372,7.47571465 7.31394641,7.9731736 C7.00066911,8.47063256 6.59764439,8.93015918 6.10487226,9.35175347 C6.78174598,10.4775099 7.41236887,11.2247577 7.99674093,11.5934967 C8.5453571,11.9396737 9.08387287,12.311171 9.87590139,12.1865085 C10.2486081,11.6217646 11.911756,8.7895471 12.3207747,8.14675221 C11.6119238,7.43916872 11.2609677,7.0257827 10.6750595,6.74648915 C9.90539682,6.37960262 8.70735067,6.16885245 8.03008933,6.27169476 Z M4.85586389,6.41821659 C4.37125655,7.19375045 4.50249049,8.10037522 5.14116544,8.49946362 C5.27802436,8.58498256 5.3267053,8.57787184 5.47944458,8.48580763 C5.99590493,8.07119781 6.32940283,7.74343935 6.4799383,7.50253224 C6.63347019,7.25682987 6.79975217,6.83183484 6.97878426,6.22754717 C7.02310864,5.99705844 6.98840321,5.84780422 6.85154429,5.76228528 C6.21286935,5.36319688 5.34047123,5.64268273 4.85586389,6.41821659 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain World Renderer</title>
<g id="icon-/-Environmental-/-Terrain-World-Renderer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
<path d="M14.128,5.993 L14.1280665,8 L16.5280665,8 L16.528,7.493 L16.75,7.999 L16.5280665,8 L16.5280665,10.4 L17.8,10.399 L18.85,12.799 L16.5280665,12.8 L16.5280665,15.2 L18.9280665,15.2 L18.928,12.978 L19.9,15.199 L18.9280665,15.2 L18.9280665,17.6 L20.95,17.599 L22,20 L14.1280665,20 L14.1280665,17.6 L11.7280665,17.6 L11.7280665,20 L2,20 L8,8 L10.8,13.6 L12.2,10.399 L14.1280665,10.4 L14.1280665,8 L13.25,7.999 L14.128,5.993 Z M18.9280665,17.6 L16.5280665,17.6 L16.5280665,20 L18.9280665,20 L18.9280665,17.6 Z M16.5280665,15.2 L14.1280665,15.2 L14.1280665,17.6 L16.5280665,17.6 L16.5280665,15.2 Z M14.1280665,12.8 L11.7280665,12.8 L11.7280665,15.2 L14.1280665,15.2 L14.1280665,12.8 Z M8,11 L6,15 L10,15 L8,11 Z M16.5280665,10.4 L14.1280665,10.4 L14.1280665,12.8 L16.5280665,12.8 L16.5280665,10.4 Z M15,4 L15.7,5.599 L14.3,5.599 L15,4 Z" id="Combined-Shape" fill="#8B572A"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Height - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Terrain-Height---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M15.0973313,4.03563691 L22.0973313,20.0356369 L8.096,20.035 L8.096,15.035 L10.0973313,15.0356369 L8.0973313,11.0356369 L8.096,11.037 L8.096,8.037 L8.0973313,8.03563691 L10.8973313,13.6356369 L15.0973313,4.03563691 Z M15.0973313,7.03563691 L13.0973313,12.0356369 L17.0973313,12.0356369 L15.0973313,7.03563691 Z M7.31647851,1 L7.31647851,5.53699525 L5.9054426,5.53699525 L5.9054426,6.23908123 L7.31647851,6.23908123 L7.31647851,7.35449518 L5.9054426,7.35449518 L5.9054426,7.98322684 L7.31647851,7.98322684 L7.31647851,9.16168098 L6.11223647,9.16168098 L6.11223647,9.72872786 L7.31647851,9.72872786 L7.31647851,10.8790837 L6.11223647,10.8790837 L6.11223647,11.3723847 L7.31647851,11.3723847 L7.31647851,12.5966939 L6.11223647,12.5966939 L6.11223647,13.2418856 L7.31647851,13.2418856 L7.31647851,14.338075 L6.11223647,14.338075 L6.11223647,15.0269116 L7.31647851,15.0269116 L7.31647851,16.0997198 L6.11223647,16.0997198 L6.11223647,16.7979089 L7.31647851,16.7979089 L7.31647851,17.9378731 L6.11223647,17.9378731 L6.11223647,18.5821555 L7.31647851,18.5821555 L7.31647851,19.6336608 L6.11223647,19.6336608 L6.11223647,20.2650836 L7.31647851,20.2650836 L7.31647851,21.2921685 L5.9054426,21.2921685 L5.9054426,22.0181553 L7.31647851,22.0181553 L7.31647851,23.0835594 L3,23.0835594 C2.44771525,23.0835594 2,22.6358441 2,22.0835594 L2,2 C2,1.44771525 2.44771525,1 3,1 L7.31647851,1 Z M4.70441655,1.79833578 C4.27659289,1.79833578 3.92977329,2.14515537 3.92977329,2.57297903 C3.92977329,3.00080269 4.27659289,3.34762229 4.70441655,3.34762229 C5.13224021,3.34762229 5.47905981,3.00080269 5.47905981,2.57297903 C5.47905981,2.14515537 5.13224021,1.79833578 4.70441655,1.79833578 Z" id="Combined-Shape-Copy" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Mesh - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Terrain-Mesh---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M16,5.23640192 L23,21.2364019 L1,21.2364019 L3.153,16.9310652 L10.848,16.9310652 L10.867,16.9694019 L16,5.23640192 Z M11.279112,8.05162125 C11.8313968,8.05162125 12.279112,8.4993365 12.279112,9.05162125 L12.279112,9.57054521 L9.49851168,15.5710293 L2,15.5710293 C1.44771525,15.5710293 1,15.123314 1,14.5710293 L1,9.05162125 C1,8.4993365 1.44771525,8.05162125 2,8.05162125 L11.279112,8.05162125 Z M16,8.23640192 L14,13.2364019 L18,13.2364019 L16,8.23640192 Z M11.339186,5.23184324 L11.339186,7.11169525 L1.939926,7.11169525 L1.939926,5.23184324 L11.339186,5.23184324 Z M10.39926,2.41206524 L10.39926,4.29191724 L2.879852,4.29191724 L2.879852,2.41206524 L10.39926,2.41206524 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Generate Terrian - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Generate-Terrian---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M16,5.23640192 L23,21.2364019 L1,21.2364019 L3.153,16.9311553 L10.7351274,16.9317461 L10.786,16.8081553 L10.867,16.9694019 L16,5.23640192 Z M10.7866981,7.88269686 C11.1462033,8.9008023 11.3517156,9.91858532 11.3517156,10.6951961 C11.3517156,13.0695588 9.43072532,14.9943601 7.06106374,14.9943601 C4.69140216,14.9943601 2.77041189,13.0695588 2.77041189,10.6951961 C2.77041189,9.98779834 2.94092524,9.08030022 3.24301589,8.15472512 L5.48573411,10.2222098 L7.16571378,8.51342542 L8.83993571,10.2222098 L10.7866981,7.88269686 Z M16,8.23640192 L14,13.2364019 L18,13.2364019 L16,8.23640192 Z M7.06106374,3.69215527 C8.35768587,3.69215527 9.51997507,5.07798918 10.306728,6.72204766 L8.83082438,8.28190713 L7.15660245,6.58611652 L5.47662277,8.28190713 L3.80919728,6.73502979 C4.59603726,5.08529116 5.76103013,3.69215527 7.06106374,3.69215527 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain Refactor - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Terrain-Refactor---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M2,20 L8,8 L10.8,13.6 L15,4 L22,20 L2,20 Z M8,11 L6,15 L10,15 L8,11 Z M15,7 L13,12 L17,12 L15,7 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain World Debugger - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Terrain-World-Debugger---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M16.1386919,4 L23.1386919,20 L1.13869185,20 L4.17269185,13.9311962 L5.67269185,13.9311962 L5.13869185,15 L9.13869185,15 L8.60469185,13.9311962 L10.1046919,13.9311962 L11.0056919,15.733 L16.1386919,4 Z M5.89628145,1.6047283 C6.16999928,1.77576619 6.13172615,2.05504566 5.96068826,2.32876349 C5.73263775,2.6937206 5.7756145,2.88160724 5.93530708,3.23512368 C6.42568244,3.16095005 7.14978568,3.35693375 7.56036243,3.61349058 C7.69722134,3.69900952 7.80557395,3.8301481 7.94243286,3.91566705 C8.25605,3.9213397 8.54116082,3.97263199 8.9003976,4.00681096 L9.38500494,3.2312771 C9.07663015,2.79610484 8.84851607,2.48441038 8.70066268,2.2961937 C8.47888259,2.01386869 9.31023224,1.32201362 9.57873345,1.70309072 C9.71741936,1.89992419 9.96660582,2.24544794 10.3262928,2.73966198 C10.430851,2.88332607 10.5329727,3.42440468 10.4654691,3.53243299 L10.0123346,4.25759977 C10.2974454,4.30889207 10.5084303,4.37729768 10.7194151,4.4457033 C10.9760197,4.54261523 11.2782438,4.66803348 11.5519616,4.83907137 L11.8488893,4.36388769 C11.9740073,4.16365719 12.4314004,4.13113915 12.6080709,4.16157747 C13.1652817,4.25757856 13.5849179,4.33128082 13.8669795,4.38268425 C14.4242185,4.48423653 14.0604111,5.4960867 13.718823,5.43188827 C13.4910975,5.38908932 13.1109498,5.32069959 12.5783797,5.2267191 L12.4073418,5.50043693 C12.68678,5.86534636 13.2181881,6.24296266 13.6811655,6.98663718 C13.3719223,7.58692704 12.5096505,9.26237536 11.09435,12.0129821 C10.3687536,12.1382775 8.95245279,11.8415191 8.53048305,11.7047078 L8.35944516,11.9784257 C8.63985361,12.343209 8.8679677,12.6549035 9.04378743,12.9135091 C9.30751703,13.3014174 8.41461192,13.8575606 8.16571666,13.506612 C8.03634338,13.3241925 7.78711967,12.9789829 7.41804555,12.4709835 C7.25974283,12.2530931 7.21380392,11.7815749 7.28247073,11.6716851 L7.56107764,11.2258208 C7.28735981,11.0547829 7.04214829,10.8381254 6.84255641,10.6499742 C6.64296453,10.461823 6.5174986,10.2565585 6.36352636,10.0969136 L5.84971054,10.9191908 C5.80243407,10.9948489 5.52907912,11.1209828 5.44267263,11.108334 C4.81589475,11.0165817 4.29416074,10.9228098 3.8774706,10.8270185 C3.35536732,10.6392609 3.55149489,9.78628232 4.02562714,9.77781449 C4.2610167,9.8090552 4.65066657,9.86223838 5.19457675,9.93736403 L5.67918409,9.16183016 C5.46247889,8.899553 5.31989964,8.62016251 5.17732038,8.34077202 C5.01195515,8.30087272 4.84658992,8.26097342 4.709731,8.17545447 C4.29915425,7.91889765 3.92856127,7.2481928 3.75175537,6.82055041 C3.31839264,6.80348476 3.13727717,6.94473989 2.90922666,7.309697 C2.73818877,7.58341484 2.46364498,7.8659871 2.18992715,7.69494921 C1.91620931,7.52391133 1.91695081,7.31908397 2.08798869,7.04536614 C2.48707709,6.40669119 2.90196341,6.09435049 3.63182995,6.04296284 C3.67740191,5.56398047 3.79709982,5.06788478 4.08216296,4.61168839 C4.36722611,4.155492 4.73213554,3.87605383 5.14266461,3.62512197 C4.86889909,2.9465954 4.87721463,2.47359794 5.27630303,1.834923 C5.44734091,1.56120516 5.62256361,1.43369042 5.89628145,1.6047283 Z M16.1386919,7 L14.1386919,12 L18.1386919,12 L16.1386919,7 Z M8.16878118,5.03529284 C8.00462988,5.67215311 7.76591557,6.23931272 7.45263826,6.73677168 C7.13936096,7.23423064 6.73633624,7.69375726 6.24356411,8.11535154 C6.92043783,9.241108 7.55106072,9.98835574 8.13543278,10.3570948 C8.68404895,10.7032718 9.22256472,11.0747691 10.0145932,10.9501066 C10.3872999,10.3853627 12.0504479,7.55314517 12.4594665,6.91035029 C11.7506156,6.20276679 11.3996595,5.78938078 10.8137513,5.51008723 C10.0440887,5.1432007 8.84604252,4.93245053 8.16878118,5.03529284 Z M4.99455574,5.18181467 C4.5099484,5.95734853 4.64118234,6.8639733 5.27985729,7.2630617 C5.41671621,7.34858064 5.46539716,7.34146992 5.61813643,7.24940571 C6.13459678,6.83479589 6.46809468,6.50703743 6.61863015,6.26613032 C6.77216204,6.02042794 6.93844402,5.59543292 7.11747611,4.99114525 C7.16180049,4.76065652 7.12709506,4.6114023 6.99023614,4.52588336 C6.3515612,4.12679496 5.47916308,4.40628081 4.99455574,5.18181467 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon / Environmental / Terrain World Renderer - box</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
<stop stop-color="#ADADAD" stop-opacity="0" offset="0%"></stop>
<stop stop-color="#9D9D9D" offset="100%"></stop>
</linearGradient>
<path d="M20.924815,0 C23.1021676,0 23.9566542,1.77846722 23.9566542,3.01865122 C23.9566542,4.25883521 23.9566542,18.7815894 23.9566542,20.6420628 C23.9566542,22.3929727 22.7281352,23.9566542 20.924815,23.9566542 C19.1214948,23.9566542 4.64929841,23.9566542 2.80929064,23.9566542 C1.38661643,23.9566542 0,22.5147712 0,21.1586662 C0,19.8025612 0,4.03532882 0,2.67255351 C0,1.3097782 1.36539793,0 2.60955829,0 C3.85371865,0 18.9601214,0 20.924815,0 Z" id="path-2"></path>
</defs>
<g id="icon-/-Environmental-/-Terrain-World-Renderer---box" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon/general/color/-box-template">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Path-3" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<g id="Group" mask="url(#mask-3)" fill="#8B572A">
<g id="icon/color/AI" style="mix-blend-mode: multiply;">
<rect id="Lights" x="0" y="0" width="24" height="24"></rect>
</g>
</g>
</g>
<path d="M14.128,5.993 L14.1280665,8 L16.5280665,8 L16.528,7.493 L16.75,7.999 L16.5280665,8 L16.5280665,10.4 L17.8,10.399 L18.85,12.799 L16.5280665,12.8 L16.5280665,15.2 L18.9280665,15.2 L18.928,12.978 L19.9,15.199 L18.9280665,15.2 L18.9280665,17.6 L20.95,17.599 L22,20 L14.1280665,20 L14.1280665,17.6 L11.7280665,17.6 L11.7280665,20 L2,20 L8,8 L10.8,13.6 L12.2,10.399 L14.1280665,10.4 L14.1280665,8 L13.25,7.999 L14.128,5.993 Z M18.9280665,17.6 L16.5280665,17.6 L16.5280665,20 L18.9280665,20 L18.9280665,17.6 Z M16.5280665,15.2 L14.1280665,15.2 L14.1280665,17.6 L16.5280665,17.6 L16.5280665,15.2 Z M14.1280665,12.8 L11.7280665,12.8 L11.7280665,15.2 L14.1280665,15.2 L14.1280665,12.8 Z M8,11 L6,15 L10,15 L8,11 Z M16.5280665,10.4 L14.1280665,10.4 L14.1280665,12.8 L16.5280665,12.8 L16.5280665,10.4 Z M15,4 L15.7,5.599 L14.3,5.599 L15,4 Z" id="Combined-Shape-Copy" fill="#FFFFFF"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+8
View File
@@ -0,0 +1,8 @@
#
# 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
#
#
add_subdirectory(Code)
+139
View File
@@ -0,0 +1,139 @@
#
# 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
#
#
ly_add_target(
NAME Terrain.Static STATIC
NAMESPACE Gem
FILES_CMAKE
terrain_files.cmake
INCLUDE_DIRECTORIES
PUBLIC
Include
PRIVATE
Source
BUILD_DEPENDENCIES
PUBLIC
AZ::AzCore
AZ::AzFramework
Gem::Atom_RPI.Public
Gem::Atom_Utils.Static
Gem::GradientSignal
Gem::SurfaceData
Gem::LmbrCentral
)
ly_add_target(
NAME Terrain ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
NAMESPACE Gem
FILES_CMAKE
terrain_shared_files.cmake
INCLUDE_DIRECTORIES
PUBLIC
Include
PRIVATE
Source
BUILD_DEPENDENCIES
PRIVATE
Gem::Terrain.Static
Gem::LmbrCentral
RUNTIME_DEPENDENCIES
Gem::LmbrCentral
)
# the above module is for use in all client/server types
ly_create_alias(NAME Terrain.Servers NAMESPACE Gem TARGETS Gem::Terrain)
ly_create_alias(NAME Terrain.Clients NAMESPACE Gem TARGETS Gem::Terrain)
# If we are on a host platform, we want to add the host tools targets like the Terrain.Editor target which
# will also depend on Terrain.Static
if(PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_target(
NAME Terrain.Editor MODULE
NAMESPACE Gem
AUTOMOC
OUTPUT_NAME Gem.Terrain.Editor
FILES_CMAKE
terrain_editor_shared_files.cmake
COMPILE_DEFINITIONS
PRIVATE
TERRAIN_EDITOR
INCLUDE_DIRECTORIES
PRIVATE
Source
PUBLIC
Include
BUILD_DEPENDENCIES
PUBLIC
AZ::AzToolsFramework
Gem::GradientSignal
Gem::LmbrCentral
Gem::Terrain.Static
)
# the above module is for use in dev tool situations
ly_create_alias(NAME Terrain.Builders NAMESPACE Gem TARGETS Gem::Terrain.Editor)
ly_create_alias(NAME Terrain.Tools NAMESPACE Gem TARGETS Gem::Terrain.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 Terrain.Static
if(PAL_TRAIT_TERRAIN_TEST_SUPPORTED)
# We support Terrain.Tests on this platform, add Terrain.Tests target which depends on Terrain.Static
ly_add_target(
NAME Terrain.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
NAMESPACE Gem
FILES_CMAKE
terrain_files.cmake
terrain_tests_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Tests
Source
BUILD_DEPENDENCIES
PRIVATE
AZ::AzTest
AZ::AzFramework
Gem::Terrain.Static
)
# Add Terrain.Tests to googletest
ly_add_googletest(
NAME Gem::Terrain.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_TERRAIN_EDITOR_TEST_SUPPORTED)
# We support Terrain.Editor.Tests on this platform, add Terrain.Editor.Tests target which depends on Terrain.Editor
ly_add_target(
NAME Terrain.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
NAMESPACE Gem
FILES_CMAKE
terrain_editor_tests_files.cmake
INCLUDE_DIRECTORIES
PRIVATE
Tests
Source
BUILD_DEPENDENCIES
PRIVATE
AZ::AzTest
Gem::Terrain.Editor
)
# Add Terrain.Editor.Tests to googletest
ly_add_googletest(
NAME Gem::Terrain.Editor.Tests
)
endif()
endif()
endif()
@@ -6,7 +6,7 @@
*
*/
#include <TerrainSurfaceDataSystemComponent.h>
#include <Components/TerrainSurfaceDataSystemComponent.h>
#include <AzCore/Debug/Profiler.h>
#include <AzCore/Math/MathUtils.h>
#include <AzCore/Serialization/EditContext.h>
@@ -58,7 +58,7 @@ namespace Terrain
editContext->Class<TerrainSurfaceDataSystemComponent>("Terrain Surface Data System", "Manages surface data requests against legacy terrain")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "Surface Data")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b))
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System"))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(0, &TerrainSurfaceDataSystemComponent::m_configuration, "Configuration", "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
@@ -78,18 +78,18 @@ namespace Terrain
void TerrainSurfaceDataSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("SurfaceDataProviderService", 0xfe9fb95e));
services.push_back(AZ_CRC("TerrainSurfaceDataProviderService", 0xa1ac7717));
services.push_back(AZ_CRC_CE("SurfaceDataProviderService"));
services.push_back(AZ_CRC_CE("TerrainSurfaceDataProviderService"));
}
void TerrainSurfaceDataSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("TerrainSurfaceDataProviderService", 0xa1ac7717));
services.push_back(AZ_CRC_CE("TerrainSurfaceDataProviderService"));
}
void TerrainSurfaceDataSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("SurfaceDataSystemService", 0x1d44d25f));
services.push_back(AZ_CRC_CE("SurfaceDataSystemService"));
}
void TerrainSurfaceDataSystemComponent::Activate()
@@ -0,0 +1,68 @@
/*
* 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 <Components/TerrainSystemComponent.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/EditContextConstants.inl>
#include <Atom/RPI.Public/FeatureProcessorFactory.h>
namespace Terrain
{
void TerrainSystemComponent::Reflect(AZ::ReflectContext* context)
{
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
{
serialize->Class<TerrainSystemComponent, AZ::Component>()
->Version(0);
if (AZ::EditContext* ec = serialize->GetEditContext())
{
ec->Class<TerrainSystemComponent>("Terrain", "The Terrain System Component enables Terrain.")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System"))
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
;
}
}
}
void TerrainSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC_CE("TerrainService"));
}
void TerrainSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
{
incompatible.push_back(AZ_CRC_CE("TerrainService"));
}
void TerrainSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC_CE("RPISystem"));
}
void TerrainSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
{
}
void TerrainSystemComponent::Init()
{
}
void TerrainSystemComponent::Activate()
{
}
void TerrainSystemComponent::Deactivate()
{
}
}
@@ -0,0 +1,40 @@
/*
* 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/Component/Component.h>
namespace Terrain
{
class TerrainSystem;
class TerrainSystemComponent
: public AZ::Component
{
public:
AZ_COMPONENT(TerrainSystemComponent, "{CD5A517E-3BD8-49AE-8F9B-33C6FC47EC67}");
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);
protected:
////////////////////////////////////////////////////////////////////////
// AZ::Component interface implementation
void Init() override;
void Activate() override;
void Deactivate() override;
////////////////////////////////////////////////////////////////////////
TerrainSystem* m_terrainSystem{ nullptr };
};
}
@@ -0,0 +1,32 @@
/*
* 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 <AzCore/Serialization/SerializeContext.h>
#include <EditorComponents/EditorTerrainSystemComponent.h>
namespace Terrain
{
void EditorTerrainSystemComponent::Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<EditorTerrainSystemComponent, AZ::Component>()->Version(1);
}
}
void EditorTerrainSystemComponent::Activate()
{
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
}
void EditorTerrainSystemComponent::Deactivate()
{
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
}
} // namespace Terrain
@@ -0,0 +1,43 @@
/*
* 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/Component/Component.h>
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
namespace Terrain
{
/// System component for Terrain editor
class EditorTerrainSystemComponent
: public AZ::Component
, private AzToolsFramework::EditorEvents::Bus::Handler
{
public:
AZ_COMPONENT(EditorTerrainSystemComponent, "{5E9f2200-9099-4325-BABD-6A533A1ABEA8}");
static void Reflect(AZ::ReflectContext* context);
EditorTerrainSystemComponent() = default;
private:
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC_CE("TerrainEditorService"));
}
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
required.push_back(AZ_CRC_CE("TerrainService"));
}
// AZ::Component
void Activate() override;
void Deactivate() override;
};
} // namespace Terrain
@@ -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
*
*/
#include <EditorTerrainModule.h>
#include <EditorComponents/EditorTerrainSystemComponent.h>
namespace Terrain
{
EditorTerrainModule::EditorTerrainModule()
{
m_descriptors.insert(
m_descriptors.end(),
{
Terrain::EditorTerrainSystemComponent::CreateDescriptor(),
});
}
AZ::ComponentTypeList EditorTerrainModule::GetRequiredSystemComponents() const
{
AZ::ComponentTypeList requiredComponents = TerrainModule::GetRequiredSystemComponents();
requiredComponents.insert(
requiredComponents.end(),
{
azrtti_typeid<EditorTerrainSystemComponent>(),
});
return requiredComponents;
}
}
AZ_DECLARE_MODULE_CLASS(Gem_TerrainEditor, Terrain::EditorTerrainModule)
@@ -0,0 +1,26 @@
/*
* 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 <TerrainModule.h>
namespace Terrain
{
class EditorTerrainModule
: public TerrainModule
{
public:
AZ_RTTI(EditorTerrainModule, "{68693F28-7051-4C14-85EA-DE6FD8CFCBD6}", TerrainModule);
AZ_CLASS_ALLOCATOR(EditorTerrainModule, AZ::SystemAllocator, 0);
EditorTerrainModule();
AZ::ComponentTypeList GetRequiredSystemComponents() const override;
};
}
@@ -0,0 +1,42 @@
/*
* 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 <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Module/Module.h>
#include <TerrainModule.h>
#include <Components/TerrainSystemComponent.h>
#include <Components/TerrainSurfaceDataSystemComponent.h>
namespace Terrain
{
TerrainModule::TerrainModule()
: AZ::Module()
{
m_descriptors.insert(m_descriptors.end(), {
TerrainSystemComponent::CreateDescriptor(),
TerrainSurfaceDataSystemComponent::CreateDescriptor(),
});
}
AZ::ComponentTypeList TerrainModule::GetRequiredSystemComponents() const
{
return AZ::ComponentTypeList{
azrtti_typeid<TerrainSystemComponent>(),
azrtti_typeid<TerrainSurfaceDataSystemComponent>(),
};
}
}
#if !defined(TERRAIN_EDITOR)
// DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
// The first parameter should be GemName_GemIdLower
// The second should be the fully qualified name of the class above
AZ_DECLARE_MODULE_CLASS(Gem_Terrain, Terrain::TerrainModule)
#endif
+26
View File
@@ -0,0 +1,26 @@
/*
* 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/Module/Module.h>
namespace Terrain
{
class TerrainModule
: public AZ::Module
{
public:
AZ_RTTI(TerrainModule, "{B1CFB3A0-EA27-4AF0-A16D-E943C98FED88}", AZ::Module);
AZ_CLASS_ALLOCATOR(TerrainModule, AZ::SystemAllocator, 0);
TerrainModule();
AZ::ComponentTypeList GetRequiredSystemComponents() const override;
};
}
@@ -0,0 +1,31 @@
/*
* 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 <AzTest/AzTest.h>
class TerrainEditorTest
: public ::testing::Test
{
protected:
void SetUp() override
{
}
void TearDown() override
{
}
};
TEST_F(TerrainEditorTest, SanityTest)
{
ASSERT_TRUE(true);
}
AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);
+31
View File
@@ -0,0 +1,31 @@
/*
* 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 <AzTest/AzTest.h>
class TerrainTest
: public ::testing::Test
{
protected:
void SetUp() override
{
}
void TearDown() override
{
}
};
TEST_F(TerrainTest, SanityTest)
{
ASSERT_TRUE(true);
}
AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV);
@@ -0,0 +1,16 @@
#
# 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
#
#
set(FILES
Source/EditorComponents/EditorTerrainSystemComponent.cpp
Source/EditorComponents/EditorTerrainSystemComponent.h
Source/EditorTerrainModule.cpp
Source/EditorTerrainModule.h
Source/TerrainModule.cpp
Source/TerrainModule.h
)
@@ -0,0 +1,11 @@
#
# 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
#
#
set(FILES
Tests/TerrainEditorTest.cpp
)
+14
View File
@@ -0,0 +1,14 @@
#
# 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
#
#
set(FILES
Source/Components/TerrainSurfaceDataSystemComponent.cpp
Source/Components/TerrainSurfaceDataSystemComponent.h
Source/Components/TerrainSystemComponent.cpp
Source/Components/TerrainSystemComponent.h
)
@@ -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
#
#
set(FILES
Source/TerrainModule.h
Source/TerrainModule.cpp
)
@@ -0,0 +1,11 @@
#
# 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
#
#
set(FILES
Tests/TerrainTest.cpp
)
+10
View File
@@ -0,0 +1,10 @@
{
"gem_name": "Terrain",
"display_name": "Terrain (WIP)",
"license": "Apache-2.0 Or MIT",
"origin": "Open 3D Engine - o3de.org",
"summary": "The Terrain Gem is a WIP (work-in-progress) Gem for providing terrain services including authoring workflows, rendering, and physics.",
"canonical_tags": [ "Gem" ],
"user_tags": [ "Environment", "Terrain" ],
"icon_path": "preview.png"
}
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa
size 41127
@@ -47,19 +47,24 @@ namespace Vegetation
void VegetationSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("VegetationSystemService", 0xa2322728));
services.push_back(AZ_CRC_CE("VegetationSystemService"));
}
void VegetationSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("VegetationSystemService", 0xa2322728));
services.push_back(AZ_CRC_CE("VegetationSystemService"));
}
void VegetationSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC("VegetationAreaSystemService", 0x36da2b62));
services.push_back(AZ_CRC("VegetationInstanceSystemService", 0x823a6007));
services.push_back(AZ_CRC("SurfaceDataProviderService", 0xfe9fb95e));
services.push_back(AZ_CRC_CE("VegetationAreaSystemService"));
services.push_back(AZ_CRC_CE("VegetationInstanceSystemService"));
services.push_back(AZ_CRC_CE("SurfaceDataSystemService"));
}
void VegetationSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& services)
{
services.push_back(AZ_CRC_CE("SurfaceDataProviderService"));
}
void VegetationSystemComponent::Reflect(AZ::ReflectContext* context)
@@ -22,6 +22,7 @@ namespace Vegetation
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services);
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services);
static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& services);
static void Reflect(AZ::ReflectContext* context);
VegetationSystemComponent();
+1
View File
@@ -76,6 +76,7 @@
"Gems/StartingPointInput",
"Gems/StartingPointMovement",
"Gems/SurfaceData",
"Gems/Terrain",
"Gems/TestAssetBuilder",
"Gems/TextureAtlas",
"Gems/TickBusOrderViewer",