< Summary

Information
Class: JeremyAnsel.Media.WavefrontObj.ObjMaterial
Assembly: JeremyAnsel.Media.WavefrontObj
File(s): C:\projects\jeremyansel-media-wavefrontobj\JeremyAnsel.Media.WavefrontObj\JeremyAnsel.Media.WavefrontObj\ObjMaterial.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 129
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.ctor(...)100%11100%

File(s)

C:\projects\jeremyansel-media-wavefrontobj\JeremyAnsel.Media.WavefrontObj\JeremyAnsel.Media.WavefrontObj\ObjMaterial.cs

#LineLine coverage
 1// <copyright file="ObjMaterial.cs" company="Jérémy Ansel">
 2// Copyright (c) 2017, 2019 Jérémy Ansel
 3// </copyright>
 4// <license>
 5// Licensed under the MIT license. See LICENSE.txt
 6// </license>
 7
 8namespace JeremyAnsel.Media.WavefrontObj;
 9
 10[System.Diagnostics.DebuggerDisplay("Material:{Name}")]
 11public class ObjMaterial
 12{
 313    public ObjMaterial()
 14    {
 315        this.ReflectionMap = new ObjMaterialReflectionMap();
 16
 317        this.IlluminationModel = 2;
 318        this.DissolveFactor = 1.0f;
 319        this.Sharpness = 60;
 320        this.OpticalDensity = 1.0f;
 321    }
 22
 23    public ObjMaterial(string? name)
 324        : this()
 25    {
 326        this.Name = name;
 327    }
 28
 29    public string? Name { get; set; }
 30
 31    public ObjMaterialColor? AmbientColor { get; set; }
 32
 33    public ObjMaterialColor? DiffuseColor { get; set; }
 34
 35    public ObjMaterialColor? EmissiveColor { get; set; }
 36
 37    public ObjMaterialColor? SpecularColor { get; set; }
 38
 39    public ObjMaterialColor? TransmissionColor { get; set; }
 40
 41    public int IlluminationModel { get; set; }
 42
 43    public float DissolveFactor { get; set; }
 44
 45    public bool IsHaloDissolve { get; set; }
 46
 47    public float SpecularExponent { get; set; }
 48
 49    public int Sharpness { get; set; }
 50
 51    public float OpticalDensity { get; set; }
 52
 53    public bool IsAntiAliasingEnabled { get; set; }
 54
 55    public ObjMaterialMap? AmbientMap { get; set; }
 56
 57    public ObjMaterialMap? DiffuseMap { get; set; }
 58
 59    public ObjMaterialMap? EmissiveMap { get; set; }
 60
 61    public ObjMaterialMap? SpecularMap { get; set; }
 62
 63    public ObjMaterialMap? SpecularExponentMap { get; set; }
 64
 65    public ObjMaterialMap? DissolveMap { get; set; }
 66
 67    public ObjMaterialMap? DecalMap { get; set; }
 68
 69    public ObjMaterialMap? DispMap { get; set; }
 70
 71    public ObjMaterialMap? BumpMap { get; set; }
 72
 73    public ObjMaterialReflectionMap ReflectionMap { get; private set; }
 74
 75    /// <summary>
 76    ///     PBR Extension: Pr
 77    /// </summary>
 78    public float Roughness { get; set; }
 79
 80    /// <summary>
 81    ///     PBR Extension: map_Pr
 82    /// </summary>
 83    public ObjMaterialMap? RoughnessMap { get; set; }
 84
 85    /// <summary>
 86    ///     PBR Extension: Pm
 87    /// </summary>
 88    public float Metallic { get; set; }
 89
 90    /// <summary>
 91    ///     PBR Extension: map_Pm
 92    /// </summary>
 93    public ObjMaterialMap? MetallicMap { get; set; }
 94
 95    /// <summary>
 96    ///     PBR Extension: Ps
 97    /// </summary>
 98    public float Sheen { get; set; }
 99
 100    /// <summary>
 101    ///     PBR Extension: map_Ps
 102    /// </summary>
 103    public ObjMaterialMap? SheenMap { get; set; }
 104
 105    /// <summary>
 106    ///     PBR Extension: Pc
 107    /// </summary>
 108    public float ClearCoatThickness { get; set; }
 109
 110    /// <summary>
 111    ///     PBR Extension: Pcr
 112    /// </summary>
 113    public float ClearCoatRoughness { get; set; }
 114
 115    /// <summary>
 116    ///     PBR Extension: aniso
 117    /// </summary>
 118    public float Anisotropy { get; set; }
 119
 120    /// <summary>
 121    ///     PBR Extension: anisor
 122    /// </summary>
 123    public float AnisotropyRotation { get; set; }
 124
 125    /// <summary>
 126    ///     PBR Extension: norm
 127    /// </summary>
 128    public ObjMaterialMap? Norm { get; set; }
 129}

Methods/Properties

.ctor()
.ctor(string)