Magnum::Trade::AbstractMaterialData class

Base for material data.

Subclasses provide access to parameters for given material type.

Derived classes

class PhongMaterialData
Phong material data.

Public types

enum class Flag: UnsignedShort { DoubleSided = 1 << 0 }
Material flag.
using Flags = Containers::EnumSet<Flag>
Material flags.

Constructors, destructors, conversion operators

AbstractMaterialData(const AbstractMaterialData&) deleted
Copying is not allowed.
AbstractMaterialData(AbstractMaterialData&&) noexcept
Move constructor.
AbstractMaterialData(MaterialType type, Flags flags, MaterialAlphaMode alphaMode, Float alphaMask, const void* importerState = nullptr) protected explicit noexcept
Constructor.
AbstractMaterialData(MaterialType type, const void* importerState = nullptr) deprecated protected explicit noexcept
Constructor.

Public functions

auto operator=(const AbstractMaterialData&) -> AbstractMaterialData& deleted
Copying is not allowed.
auto operator=(AbstractMaterialData&&) -> AbstractMaterialData& noexcept
Move assignment.
auto type() const -> MaterialType
Material type.
auto flags() const -> Flags
Material flags.
auto alphaMode() const -> MaterialAlphaMode
Alpha mode.
auto alphaMask() const -> Float
Alpha mask.
auto importerState() const -> const void*
Importer-specific state.

Enum documentation

enum class Magnum::Trade::AbstractMaterialData::Flag: UnsignedShort

Material flag.

This enum is extended in subclasses.

Enumerators
DoubleSided

The material is double-sided. Back faces should not be culled away but rendered as well, with normals flipped for correct lighting.

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Trade::AbstractMaterialData::Flags

Material flags.

This enum is extended in subclasses.

Function documentation

Magnum::Trade::AbstractMaterialData::AbstractMaterialData(MaterialType type, Flags flags, MaterialAlphaMode alphaMode, Float alphaMask, const void* importerState = nullptr) explicit protected noexcept

Constructor.

Parameters
type Material type
flags Untyped material flags
alphaMode Alpha mode. Use MaterialAlphaMode::Opaque for a default value.
alphaMask Alpha mask value. Use 0.5f for a default value.
importerState Importer-specific state

Magnum::Trade::AbstractMaterialData::AbstractMaterialData(MaterialType type, const void* importerState = nullptr) explicit protected noexcept

Constructor.

Flags Magnum::Trade::AbstractMaterialData::flags() const

Material flags.

Not all bits returned might be defiend by Flag, subclasses define extra values.

Float Magnum::Trade::AbstractMaterialData::alphaMask() const

Alpha mask.

If alphaMode() is MaterialAlphaMode::Mask, alpha values below this value are rendered as fully transparent and alpha values above this value as fully opaque. If alphaMode() is not MaterialAlphaMode::Mask, this value is ignored.

const void* Magnum::Trade::AbstractMaterialData::importerState() const

Importer-specific state.

See AbstractImporter::importerState() for more information.

Debug& operator<<(Debug& debug, AbstractMaterialData::Flag value)

Debug output operator.

Debug& operator<<(Debug& debug, AbstractMaterialData::Flags value)

Debug output operator.