Open 3D Engine Vegetation Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Vegetation::InstanceSpawner Class Referenceabstract

#include <InstanceSpawner.h>

Inherited by Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

Public Member Functions

 AZ_RTTI (InstanceSpawner, "{01AD0758-B04A-4B43-BC2B-BDCD77F4EF6A}")
 
 AZ_CLASS_ALLOCATOR (InstanceSpawner, AZ::SystemAllocator)
 
virtual void LoadAssets ()=0
 Start loading any assets that the spawner will need.
 
virtual void UnloadAssets ()=0
 Unload any assets that the spawner loaded.
 
virtual void OnRegisterUniqueDescriptor ()=0
 Perform any extra initialization needed at the point of registering with the vegetation system.
 
virtual void OnReleaseUniqueDescriptor ()=0
 Perform any extra cleanup needed at the point of unregistering with the vegetation system.
 
virtual bool HasEmptyAssetReferences () const =0
 Does this exist but have empty asset references?
 
virtual bool IsLoaded () const =0
 Has this finished loading any assets that are needed?
 
virtual bool IsSpawnable () const =0
 Are the assets loaded, initialized, and spawnable?
 
virtual bool HasRadiusData () const
 Does this spawner have the capability to provide radius data?
 
virtual float GetRadius () const
 Radius of the instances that will be spawned, used by the Distance Between filter.
 
virtual AZStd::string GetName () const =0
 Display name of the instances that will be spawned.
 
virtual InstancePtr CreateInstance (const InstanceData &instanceData)=0
 Create a single instance.
 
virtual void DestroyInstance (InstanceId id, InstancePtr instance)=0
 Destroy a single instance.
 
bool operator== (const InstanceSpawner &rhs) const
 Check for data equivalency. Subclasses are expected to implement this.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

virtual bool DataIsEquivalent (const InstanceSpawner &rhs) const =0
 Subclasses are expected to provide a comparison for data equivalency.
 
void NotifyOnAssetsLoaded ()
 Subclasses are expected to call this whenever assets have loaded / reloaded.
 
void NotifyOnAssetsUnloaded ()
 Subclasses are expected to call this whenever assets have unloaded.
 

Detailed Description

Base class for anything that can be spawned by the Vegetation system.

Member Function Documentation

◆ CreateInstance()

virtual InstancePtr Vegetation::InstanceSpawner::CreateInstance ( const InstanceData instanceData)
pure virtual

Create a single instance.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ DestroyInstance()

virtual void Vegetation::InstanceSpawner::DestroyInstance ( InstanceId  id,
InstancePtr  instance 
)
pure virtual

Destroy a single instance.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ GetName()

virtual AZStd::string Vegetation::InstanceSpawner::GetName ( ) const
pure virtual

Display name of the instances that will be spawned.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ HasEmptyAssetReferences()

virtual bool Vegetation::InstanceSpawner::HasEmptyAssetReferences ( ) const
pure virtual

Does this exist but have empty asset references?

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ IsLoaded()

virtual bool Vegetation::InstanceSpawner::IsLoaded ( ) const
pure virtual

Has this finished loading any assets that are needed?

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ IsSpawnable()

virtual bool Vegetation::InstanceSpawner::IsSpawnable ( ) const
pure virtual

Are the assets loaded, initialized, and spawnable?

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ LoadAssets()

virtual void Vegetation::InstanceSpawner::LoadAssets ( )
pure virtual

Start loading any assets that the spawner will need.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ OnRegisterUniqueDescriptor()

virtual void Vegetation::InstanceSpawner::OnRegisterUniqueDescriptor ( )
pure virtual

Perform any extra initialization needed at the point of registering with the vegetation system.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ OnReleaseUniqueDescriptor()

virtual void Vegetation::InstanceSpawner::OnReleaseUniqueDescriptor ( )
pure virtual

Perform any extra cleanup needed at the point of unregistering with the vegetation system.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.

◆ UnloadAssets()

virtual void Vegetation::InstanceSpawner::UnloadAssets ( )
pure virtual

Unload any assets that the spawner loaded.

Implemented in Vegetation::EmptyInstanceSpawner, and Vegetation::PrefabInstanceSpawner.


The documentation for this class was generated from the following file: