cesium-native 0.43.0
Loading...
Searching...
No Matches
Material.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Library.h>
6#include <CesiumGltf/MaterialNormalTextureInfo.h>
7#include <CesiumGltf/MaterialOcclusionTextureInfo.h>
8#include <CesiumGltf/MaterialPBRMetallicRoughness.h>
9#include <CesiumGltf/NamedObject.h>
10#include <CesiumGltf/TextureInfo.h>
11
12#include <optional>
13#include <string>
14#include <vector>
15
16namespace CesiumGltf {
20struct CESIUMGLTF_API Material final : public CesiumGltf::NamedObject {
24 static constexpr const char* TypeName = "Material";
25
29 struct AlphaMode {
32 inline static const std::string OPAQUE = "OPAQUE";
33
38 inline static const std::string MASK = "MASK";
39
43 inline static const std::string BLEND = "BLEND";
44 };
45
52 std::optional<CesiumGltf::MaterialPBRMetallicRoughness> pbrMetallicRoughness;
53
64 std::optional<CesiumGltf::MaterialNormalTextureInfo> normalTexture;
65
75 std::optional<CesiumGltf::MaterialOcclusionTextureInfo> occlusionTexture;
76
86 std::optional<CesiumGltf::TextureInfo> emissiveTexture;
87
94 std::vector<double> emissiveFactor = {0, 0, 0};
95
105 std::string alphaMode = AlphaMode::OPAQUE;
106
117 double alphaCutoff = 0.5;
118
127 bool doubleSided = false;
128
135 int64_t getSizeBytes() const {
136 int64_t accum = 0;
137 accum += int64_t(sizeof(Material));
139 int64_t(sizeof(CesiumGltf::NamedObject));
140 if (this->pbrMetallicRoughness) {
141 accum += this->pbrMetallicRoughness->getSizeBytes() -
143 }
144 if (this->normalTexture) {
145 accum += this->normalTexture->getSizeBytes() -
147 }
148 if (this->occlusionTexture) {
149 accum += this->occlusionTexture->getSizeBytes() -
151 }
152 if (this->emissiveTexture) {
153 accum += this->emissiveTexture->getSizeBytes() -
154 int64_t(sizeof(CesiumGltf::TextureInfo));
155 }
156 accum += int64_t(sizeof(double) * this->emissiveFactor.capacity());
157 return accum;
158 }
159};
160} // namespace CesiumGltf
Classes for working with glTF models.
A set of parameter values that are used to define the metallic-roughness material model from Physical...
Known values for The alpha rendering mode of the material.
Definition Material.h:29
The material appearance of a primitive.
Definition Material.h:20
std::optional< CesiumGltf::MaterialNormalTextureInfo > normalTexture
The tangent space normal texture.
Definition Material.h:64
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Material.h:135
std::optional< CesiumGltf::MaterialOcclusionTextureInfo > occlusionTexture
The occlusion texture.
Definition Material.h:75
std::optional< CesiumGltf::MaterialPBRMetallicRoughness > pbrMetallicRoughness
A set of parameter values that are used to define the metallic-roughness material model from Physical...
Definition Material.h:52
std::optional< CesiumGltf::TextureInfo > emissiveTexture
The emissive texture.
Definition Material.h:86
The base class for objects in a glTF that have a name.
Definition NamedObject.h:15
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition NamedObject.h:29
Reference to a texture.
Definition TextureInfo.h:14