4#ifndef GREM_CORE_FORMATS_OBJ_HPP
5#define GREM_CORE_FORMATS_OBJ_HPP
168 result.
load(mtlString);
Definition ArrayList.hpp:27
Base exception type for runtime errors.
Definition Error.hpp:38
Optional value type that holds either a value or no value.
Definition Optional.hpp:58
IlluminationModel
Illumination model to use when rendering a specific Material.
Definition obj.hpp:110
@ BLINN_PHONG_RAYTRACE_FRESNEL
Implementation-defined.
Definition obj.hpp:116
@ LAMBERT
Implementation-defined.
Definition obj.hpp:112
@ BLINN_PHONG_RAYTRACE_GLASS
Implementation-defined.
Definition obj.hpp:115
@ BLINN_PHONG_RAYTRACE_REFRACT_FRESNEL
Implementation-defined.
Definition obj.hpp:118
@ BLINN_PHONG_REFLECT
Implementation-defined.
Definition obj.hpp:119
@ BLINN_PHONG_REFLECT_GLASS
Implementation-defined.
Definition obj.hpp:120
@ SHADOW
Implementation-defined.
Definition obj.hpp:121
@ BLINN_PHONG_RAYTRACE
Implementation-defined.
Definition obj.hpp:114
@ BLINN_PHONG_RAYTRACE_REFRACT
Implementation-defined.
Definition obj.hpp:117
@ BLINN_PHONG
Implementation-defined.
Definition obj.hpp:113
@ FLAT
Implementation-defined.
Definition obj.hpp:111
Definition aliases.hpp:18
String toString(int value)
Definition String.hpp:23
vec< 3, float > vec3
Definition math.hpp:439
StringBase< char, std::char_traits< char >, std::allocator< char > > String
Definition String.hpp:17
StringViewBase< char, std::char_traits< char > > StringView
Definition StringView.hpp:16
Collection of Node elements defined by an OBJ file.
Definition obj.hpp:83
Buffer< vec2 > textureCoordinates
List of texture coordinates referenced by the face vertices defined in this asset.
Definition obj.hpp:100
Buffer< vec3 > normals
List of normal vectors referenced by the face vertices defined in this asset.
Definition obj.hpp:101
Buffer< vec3 > vertices
List of vertex positions referenced by the face vertices defined in this asset.
Definition obj.hpp:99
ArrayList< Node > nodes
List of object nodes belonging to this asset.
Definition obj.hpp:102
ArrayList< String > materialLibraryFilenames
List of relative filepaths of the material libraries associated with this asset.
Definition obj.hpp:98
static Asset parse(StringView objString)
Parse an asset from an OBJ string.
bool messageAttachesToPrecedingFilepath() const noexcept override
Definition obj.hpp:42
Error(const auto &message, StringView::iterator position, size_t lineNumber)
Definition obj.hpp:33
void writeMessage(String &output) const override
Definition obj.hpp:38
size_t lineNumber
Line number, starting at 1 for the first line, where the error occured.
Definition obj.hpp:31
StringView::iterator position
Iterator into the source OBJ string where the error originated from.
Definition obj.hpp:26
Single vertex of a polygonal Face element.
Definition obj.hpp:50
uint32_t normalIndex
Index of the normal vector in the Asset that define the vertex normal.
Definition obj.hpp:53
uint32_t vertexIndex
Index of the vertex coordinates in the Asset that define the vertex position.
Definition obj.hpp:51
uint32_t textureCoordinateIndex
Index of the texture coordinates in the Asset that define the texture coordinates of the vertex.
Definition obj.hpp:52
Face element forming a single polygon of FaceVertex vertices.
Definition obj.hpp:59
Buffer< FaceVertex > vertices
List of vertices that make up the polygon.
Definition obj.hpp:60
Group of polygonal Face elements within a Node.
Definition obj.hpp:66
String name
Name of the group, or empty if no name was specified.
Definition obj.hpp:67
String materialName
Name of the material of this group, which should be found in one of the associated material libraries...
Definition obj.hpp:69
ArrayList< Face > faces
List of faces belonging to this group.
Definition obj.hpp:68
Object containing a list of Mesh elements within an Asset.
Definition obj.hpp:75
String name
Name of the object, or empty if no name was specified.
Definition obj.hpp:76
ArrayList< Mesh > meshes
List of meshes belonging to this object.
Definition obj.hpp:77
Material library that stores the material properties for objects defined in an Asset.
Definition obj.hpp:153
static Library parse(StringView mtlString)
Parse a material library from an MTL string.
Definition obj.hpp:166
void load(StringView mtlString)
Add materials parsed from an MTL string to the material library.
ArrayList< Material > materials
List of materials belonging to this library.
Definition obj.hpp:184
Material properties of a Node.
Definition obj.hpp:127
IlluminationModel illuminationModel
Illumination model to use for rendering this material.
Definition obj.hpp:146
String emissiveMapName
Relative filepath of the emissive map image, or empty for no emissive map.
Definition obj.hpp:132
float specularExponent
Specular exponent factor to multiply the sampled specular exponent map value by.
Definition obj.hpp:142
String dissolveFactorMapName
Relative filepath of the dissolve factor map image, or empty for no dissolve factor map.
Definition obj.hpp:134
String specularExponentMapName
Relative filepath of the specular exponent map image, or empty for no specular exponent map.
Definition obj.hpp:133
vec3 emissiveColor
Emissive color factor to multiply the sampled emissive map value by.
Definition obj.hpp:141
String occlusionRoughnessMetallicMapName
Relative filepath of the occlusion-roughness-metallic map image, or empty for no ORM map.
Definition obj.hpp:137
float dissolveFactor
Dissolve factor to multiply the sampled dissolve factor map value by.
Definition obj.hpp:143
String specularMapName
Relative filepath of the specular map image, or empty for no specular map.
Definition obj.hpp:131
Optional< float > roughnessFactor
Roughness factor to multiply the sampled roughness value by, or an empty optional if unspecified.
Definition obj.hpp:144
String normalMapName
Relative filepath of the normal map image, or empty for no normal map.
Definition obj.hpp:136
vec3 specularColor
Specular color factor to multiply the sampled specular map value by.
Definition obj.hpp:140
vec3 ambientColor
Ambient color factor to multiply the sampled ambient map value by.
Definition obj.hpp:138
String bumpMapName
Relative filepath of the bump map image, or empty for no bump map.
Definition obj.hpp:135
String name
Name of the material.
Definition obj.hpp:128
String diffuseMapName
Relative filepath of the diffuse map image, or empty for no diffuse map.
Definition obj.hpp:130
Optional< float > metallicFactor
Metallic factor to multiply the sampled metallic value by, or an empty optional if unspecified.
Definition obj.hpp:145
String ambientMapName
Relative filepath of the ambient map image, or empty for no ambient map.
Definition obj.hpp:129
vec3 diffuseColor
Diffuse color factor to multiply the sampled diffuse map value by.
Definition obj.hpp:139