Magnum::Trade::PhongMaterialData class

Phong material data.

Base classes

class AbstractMaterialData
Base for material data.

Public types

enum (anonymous): UnsignedInt { AmbientTextureID = 0, DiffuseTextureID = 1, SpecularTextureID = 3 }
enum class Flag: UnsignedShort { DoubleSided = 1 << 0, AmbientTexture = 1 << 1, DiffuseTexture = 1 << 2, SpecularTexture = 1 << 3 }
Material flag.
using Flags = Containers::EnumSet<Flag>
Material flags.

Constructors, destructors, conversion operators

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

Public functions

auto operator=(const PhongMaterialData&) -> PhongMaterialData& deleted
Copying is not allowed.
auto operator=(PhongMaterialData&& other) -> PhongMaterialData& noexcept
Move assignment.
auto flags() const -> Flags
Material flags.
auto ambientColor() -> Color4&
Ambient color.
auto ambientColor() const -> Color4
auto ambientTexture() -> UnsignedInt&
Ambient texture ID.
auto ambientTexture() const -> UnsignedInt
auto diffuseColor() -> Color4&
Diffuse color.
auto diffuseColor() const -> Color4
auto diffuseTexture() -> UnsignedInt&
Diffuse texture ID.
auto diffuseTexture() const -> UnsignedInt
auto specularColor() -> Color4&
Specular color.
auto specularColor() const -> Color4
auto specularTexture() -> UnsignedInt&
Specular texture ID.
auto specularTexture() const -> UnsignedInt
auto shininess() const -> Float
Shininess.

Enum documentation

enum Magnum::Trade::PhongMaterialData::(anonymous): UnsignedInt

Enumerators
AmbientTextureID

Ambient texture ID for mapping with texture coordinates

DiffuseTextureID

Diffuse texture ID for mapping with texture coordinates

SpecularTextureID

Specular texture ID for mapping with texture coordinates

enum class Magnum::Trade::PhongMaterialData::Flag: UnsignedShort

Material flag.

A superset of AbstractMaterialData::Flag.

Enumerators
DoubleSided


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

AmbientTexture

The material has an ambient texture instead of color

DiffuseTexture

The material has a diffuse texture instead of color

SpecularTexture

The material has a specular texture instead of color

Typedef documentation

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

Material flags.

A superset of AbstractMaterialData::Flags.

Function documentation

Magnum::Trade::PhongMaterialData::PhongMaterialData(Flags flags, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept

Constructor.

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

Colors and textures should be specified using member functions based on what flags are set. Ambient color (if set) is by default 0x000000ff_rgbaf, diffuse and specular color is by default 0xffffffff_rgbaf, all texture IDs (if any) are by default set to 0.

Magnum::Trade::PhongMaterialData::PhongMaterialData(Flags flags, Float shininess, const void* importerState = nullptr) explicit noexcept

Constructor.

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

Material flags.

A superset of AbstractMaterialData::flags().

Color4& Magnum::Trade::PhongMaterialData::ambientColor()

Ambient color.

Available only if the material doesn't have Flag::AmbientTexture.

Color4 Magnum::Trade::PhongMaterialData::ambientColor() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UnsignedInt& Magnum::Trade::PhongMaterialData::ambientTexture()

Ambient texture ID.

Available only if the material has Flag::AmbientTexture.

UnsignedInt Magnum::Trade::PhongMaterialData::ambientTexture() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Color4& Magnum::Trade::PhongMaterialData::diffuseColor()

Diffuse color.

Available only if the material doesn't have Flag::DiffuseTexture.

Color4 Magnum::Trade::PhongMaterialData::diffuseColor() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UnsignedInt& Magnum::Trade::PhongMaterialData::diffuseTexture()

Diffuse texture ID.

Available only if the material has Flag::DiffuseTexture.

UnsignedInt Magnum::Trade::PhongMaterialData::diffuseTexture() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Color4& Magnum::Trade::PhongMaterialData::specularColor()

Specular color.

Available only if the material doesn't have Flag::SpecularTexture.

Color4 Magnum::Trade::PhongMaterialData::specularColor() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UnsignedInt& Magnum::Trade::PhongMaterialData::specularTexture()

Specular texture ID.

Available only if the material has Flag::SpecularTexture.

UnsignedInt Magnum::Trade::PhongMaterialData::specularTexture() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

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

Debug output operator.

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

Debug output operator.