Open 3D Engine WhiteBox 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.
WhiteBox::EditorWhiteBoxMeshAsset Class Reference

#include <EditorWhiteBoxMeshAsset.h>

Inherits AZ::Data::AssetBus::Handler, WhiteBoxMeshAssetNotificationBus::Handler, IEditorNotifyListener, and AZ::TickBus::Handler.

Public Member Functions

void Release ()
 Release the stored WhiteBoxMeshAsset but retain the AssetId to be loaded again in future.
 
void Reset ()
 
void Associate (const AZ::EntityComponentIdPair &entityComponentIdPair)
 
void TakeOwnershipOfWhiteBoxMesh (const AZStd::string &relativeAssetPath, Api::WhiteBoxMeshPtr whiteBoxMesh)
 Transfer ownership of an in-memory White Box mesh and create an asset at the specified relative path.
 
WhiteBoxMesh * GetWhiteBoxMesh ()
 
AZ::Data::AssetId GetWhiteBoxMeshAssetId () const
 
AZ::Data::Asset< Pipeline::WhiteBoxMeshAssetGetWhiteBoxMeshAsset ()
 
bool InUse () const
 Helper to return if the White Box mesh asset id is valid or not (if it is valid, the asset is in use).
 
void Load ()
 
void Save ()
 Write the asset to disk at its existing location.
 
void Save (const AZStd::string &absolutePath)
 Write the asset to disk at an arbitrary location.
 
bool Loaded () const
 
void Serialize ()
 Store the in-memory representation of the WhiteBoxMesh to the current WhiteBoxMeshAsset.
 

Static Public Member Functions

static AZ_CLASS_ALLOCATOR_DECL void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Handle creating, loading and setting White Box mesh assets.

Note
Used by the EditorWhiteBoxComponent to delegate asset handling responsibilities.

Member Function Documentation

◆ Associate()

void WhiteBox::EditorWhiteBoxMeshAsset::Associate ( const AZ::EntityComponentIdPair &  entityComponentIdPair)

Associate an EditorWhiteBoxMeshAsset with a specific entity/component id pair that changes will be propagated to.

◆ GetWhiteBoxMesh()

WhiteBoxMesh * WhiteBox::EditorWhiteBoxMeshAsset::GetWhiteBoxMesh ( )

Returns the WhiteBoxMesh stored on this asset.

Note
If an asset has not been set or loaded this value will be null.
Do not hold onto a reference to this pointer for longer than a function call.

◆ GetWhiteBoxMeshAsset()

AZ::Data::Asset< Pipeline::WhiteBoxMeshAsset > WhiteBox::EditorWhiteBoxMeshAsset::GetWhiteBoxMeshAsset ( )

Returns the WhiteBoxMeshAsset.

Note
If an asset has not been set or loaded the asset will be empty/invalid.

◆ GetWhiteBoxMeshAssetId()

AZ::Data::AssetId WhiteBox::EditorWhiteBoxMeshAsset::GetWhiteBoxMeshAssetId ( ) const

Returns the AssetId of the White Box mesh asset.

Note
If an asset has not been set or loaded this value will be invalid.

◆ Load()

void WhiteBox::EditorWhiteBoxMeshAsset::Load ( )

Request a load of the stored asset.

Note
If the asset is not in use (asset id is invalid) the call will be a noop.

◆ Loaded()

bool WhiteBox::EditorWhiteBoxMeshAsset::Loaded ( ) const

Returns if the asset is both set and loaded.

Note
An asset may be in use, but not yet loaded (InUse() != Loaded()).

◆ Reset()

void WhiteBox::EditorWhiteBoxMeshAsset::Reset ( )

Release the stored WhiteBoxMeshAsset and invalidate the AssetId to full clear the asset from use.

Note
m_entityComponentIdPair is not reset.

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