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, NormalTexture = 1 << 4 new in Git master, TextureTransformation = 1 << 5 new in Git master }
Material flag.
using Flags = Containers::EnumSet<Flag>
Material flags.

Constructors, destructors, conversion operators

PhongMaterialData(Flags flags, const Color4& ambientColor, UnsignedInt ambientTexture, const Color4& diffuseColor, UnsignedInt diffuseTexture, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt normalTexture, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in Git master
Constructor.
PhongMaterialData(Flags flags, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) deprecated in Git master explicit noexcept
Constructor.
PhongMaterialData(Flags flags, Float shininess, const void* importerState = nullptr) deprecated in 2018.10 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() const -> Color4
Ambient color.
auto ambientColor() -> Color4& deprecated in Git master
auto ambientTexture() const -> UnsignedInt
Ambient texture ID.
auto ambientTexture() -> UnsignedInt& deprecated in Git master
auto diffuseColor() const -> Color4
Diffuse color.
auto diffuseColor() -> Color4& deprecated in Git master
auto diffuseTexture() const -> UnsignedInt
Diffuse texture ID.
auto diffuseTexture() -> UnsignedInt& deprecated in Git master
auto specularColor() const -> Color4
Specular color.
auto specularColor() -> Color4& deprecated in Git master
auto specularTexture() const -> UnsignedInt
Specular texture ID.
auto specularTexture() -> UnsignedInt& deprecated in Git master
auto normalTexture() const -> UnsignedInt new in Git master
Normal texture ID.
auto textureMatrix() const -> Matrix3 new in Git master
Texture coordinate transformation matrix.
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

DiffuseTexture

The material has a diffuse texture

SpecularTexture

The material has a specular texture

NormalTexture new in Git master

The material has a normal texture

TextureTransformation new in Git master

The material has a texture coordinate transformation

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, const Color4& ambientColor, UnsignedInt ambientTexture, const Color4& diffuseColor, UnsignedInt diffuseTexture, const Color4& specularColor, UnsignedInt specularTexture, UnsignedInt normalTexture, const Matrix3& textureMatrix, MaterialAlphaMode alphaMode, Float alphaMask, Float shininess, const void* importerState = nullptr) explicit noexcept new in Git master

Constructor.

Parameters
flags Material flags
ambientColor Ambient color. Use 0x000000ff_rgbaf for a default value for a non-textured material and 0xffffffff_rgbaf for a default value for a textured material.
ambientTexture Ambient texture ID. Ignored if flags doesn't have Flag::AmbientTexture
diffuseColor Diffuse color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
diffuseTexture Diffuse texture ID. Ignored if flags doesn't have Flag::DiffuseTexture
specularColor Specular color. Use 0xffffffff_rgbaf for a default value for both a non-textured and a textured material.
specularTexture Specular texture ID. Ignored if flags doesn't have Flag::SpecularTexture.
normalTexture Normal texture ID. Ignored if flags doesn't have Flag::NormalTexture.
textureMatrix Texture coordinate transformation. Ignored if flags doesn't have Flag::TextureTransformation.
alphaMode Alpha mode. Use MaterialAlphaMode::Opaque for a default value.
alphaMask Alpha mask value. Use 0.5f for a default value.
shininess Shininess. Use 80.0f for a default value.
importerState Importer-specific state

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() const

Ambient color.

If the material has Flag::AmbientTexture, the color and texture is multiplied together.

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

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

Ambient texture ID.

Available only if the material has Flag::AmbientTexture. Multiplied with ambientColor().

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

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

Diffuse color.

If the material has Flag::DiffuseTexture, the color and texture is multiplied together.

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

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

Diffuse texture ID.

Available only if the material has Flag::DiffuseTexture. Multiplied with diffuseColor().

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

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

Specular color.

If the material has Flag::SpecularTexture, the color and texture is multiplied together.

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

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

Specular texture ID.

Available only if the material has Flag::SpecularTexture. Multiplied with specularColor().

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

UnsignedInt Magnum::Trade::PhongMaterialData::normalTexture() const new in Git master

Normal texture ID.

Available only if the material has Flag::NormalTexture.

Matrix3 Magnum::Trade::PhongMaterialData::textureMatrix() const new in Git master

Texture coordinate transformation matrix.

If the material doesn't have Flag::TextureTransformation, returns an identity matrix.

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

Debug output operator.

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

Debug output operator.