Classes

Assets/Asset Access

Brief descriptions

Structures

nau::IAssetAccessor

Provides generic interface for accessing assets.

nau::AssetContentInfo

Encapsulates asset info.

nau::IAssetView

Provides an interface for an asset view.

nau::IAssetViewFactory

Provides an interface for creating asset views.

Classes

nau::IAssetContentProvider

Detailed information

IAssetAccessor

engine/core/modules/assets/include/nau/assets/asset_accessor.h

struct IAssetAccessor : public IRefCounted

Provides generic interface for accessing assets.

Implementations are to provide concrete functions for accessing supported types of assets.

Subclassed by nau::IAnimationAssetAccessor, nau::IMaterialAssetAccessor, nau::IMeshAssetAccessor, nau::IShaderAssetAccessor, nau::ISkeletonAssetAccessor, nau::ITextureAssetAccessor, nau::IUiAssetAccessor

Public Types

using Ptr = nau::Ptr<IAssetAccessor>

AssetContentInfo

engine/core/modules/assets/include/nau/assets/asset_content_provider.h

struct AssetContentInfo

Encapsulates asset info.

Public Functions

inline explicit operator bool() const

< Settings to apply on load.

Public Members

eastl::string kind
io::FsPath path

< Asset kind. It has to be a kind supported by the corresponding asset view container

RuntimeObject::Ptr importSettings

< Path to the asset file.


IAssetView

engine/core/modules/assets/include/nau/assets/asset_view.h

struct IAssetView : public virtual IRefCounted

Provides an interface for an asset view.

A view is an interpretation of a collection of data, i.e. an asset or a resource. An asset may have several different views each providing various ways of addressing the asset. An example is a texture resource in rendering. A texture in DirectX render framework can be a shader resource (that is, input data for a shader) or a render target (that is, an output for a shader). Its usages may switch in-between draw calls. Each use case is supplied by a corresponding view, however the actual resource, i.e. a dedicated space in memory, that is to say a collection of bytes, is the same.

Subclassed by nau::MaterialAssetView, nau::ShaderAssetView, nau::SkeletonAssetView, nau::SkinnedMeshAssetView, nau::StaticMeshAssetView, nau::TextureAssetView, nau::animation::data::AnimationAssetView, nau::physics::ConvexHullAssetView, nau::physics::TriMeshAssetView, nau::ui::data::UiAssetView

Public Types

using Ptr = nau::Ptr<IAssetView>

IAssetViewFactory

engine/core/modules/assets/include/nau/assets/asset_view_factory.h

struct IAssetViewFactory : public virtual IRttiObject

Provides an interface for creating asset views.

See also: IAssetView.

Subclassed by nau::GraphicsAssetViewFactory

Public Functions

virtual IRttiObject eastl::vector< const rtti::TypeInfo * > getAssetViewTypes () const =0

Retrieves a collection of all available asset view types for this factory.

Returns:

A collection of all available asset view types.

virtual async::Task<IAssetView::Ptr> createAssetView(nau::Ptr<> accessor, const rtti::TypeInfo &viewType) = 0

Schedules asset view creation operation.

Parameters:
  • accessor[in] A pointer to the object (depending on the asset type) containing the asset data.

  • viewType[in] Type of the asset to create the view of.

Returns:

Task object providing the operation status as well as access to the created asset view.

IAssetContentProvider

engine/core/modules/assets/include/nau/assets/asset_content_provider.h

class IAssetContentProvider

Private Types

using AssetContent = eastl::tuple<Ptr<>, AssetContentInfo>

Private Functions

virtual ~IAssetContentProvider() = default
virtual Result<AssetContent> openStreamOrContainer(const AssetPath &assetPath) = 0
virtual eastl::vector<eastl::string_view> getSupportedSchemes() const = 0