Initial Terrain System (#3401)
This represents the very beginnings of the Terrain System presented in Sig-Content RFC 4 ( https://github.com/o3de/sig-content/blob/main/rfcs/rfc-4-terrain-system.md ). There is some basic working functionality in this PR, but the system as a whole should not be considered working yet. The gem is disabled by default in all projects. All of the code below is contained in the Terrain Gem, which is disabled by default. The following components exist and can be experimented with, but should not be expected to be functionally complete yet: Terrain World - level component for enabling terrain Terrain World Debugger - level component for enabling terrain debugging features Terrain Layer Spawner - component for defining a region of terrain Terrain Height Gradient List - component for defining a list of gradients to use as terrain heights Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <AzCore/Serialization/EditContextConstants.inl>
|
||||
|
||||
#include <Atom/RPI.Public/FeatureProcessorFactory.h>
|
||||
#include <TerrainRenderer/TerrainFeatureProcessor.h>
|
||||
#include <TerrainSystem/TerrainSystem.h>
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
@@ -32,6 +34,8 @@ namespace Terrain
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
;
|
||||
}
|
||||
|
||||
Terrain::TerrainFeatureProcessor::Reflect(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +64,18 @@ namespace Terrain
|
||||
|
||||
void TerrainSystemComponent::Activate()
|
||||
{
|
||||
// Currently, the Terrain System Component owns the Terrain System instance because the Terrain World component gets recreated
|
||||
// every time an entity is added or removed to a level. If this ever changes, the Terrain System ownership could move into
|
||||
// the level component.
|
||||
m_terrainSystem = new TerrainSystem();
|
||||
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<Terrain::TerrainFeatureProcessor>();
|
||||
}
|
||||
|
||||
void TerrainSystemComponent::Deactivate()
|
||||
{
|
||||
delete m_terrainSystem;
|
||||
m_terrainSystem = nullptr;
|
||||
|
||||
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<Terrain::TerrainFeatureProcessor>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user