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: UnsignedByte { AmbientTexture = 1 << 0, DiffuseTexture = 1 << 1, SpecularTexture = 1 << 2 }
Material flag.
using Flags = Containers::EnumSet<Flag>
Material flags.

Constructors, destructors, conversion operators

PhongMaterialData(Flags flags, Float shininess, const void* importerState = nullptr) 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: UnsignedByte

Material flag.

Enumerators
AmbientTexture

The material has ambient texture instead of color

DiffuseTexture

The material has diffuse texture instead of color

SpecularTexture

The material has specular texture instead of color

Typedef documentation

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

Material flags.

Function documentation

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

Constructor.

Parameters
flags Material flags
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.

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.