Kav/Geometry/Model.cs

65 lines
1.5 KiB
C#

using Microsoft.Xna.Framework;
namespace Kav
{
public class Model
{
public Mesh[] Meshes { get; }
private Color albedoValue;
public Color Albedo
{
get { return albedoValue; }
set
{
foreach (var mesh in Meshes)
{
foreach (var meshPart in mesh.MeshParts)
{
meshPart.Albedo = value.ToVector3();
}
}
}
}
public Model(Mesh[] meshes)
{
Meshes = meshes;
}
public void DisableAlbedoMaps()
{
foreach (var mesh in Meshes)
{
foreach (var meshPart in mesh.MeshParts)
{
meshPart.DisableAlbedoMap = true;
}
}
}
public void DisableNormalMaps()
{
foreach (var mesh in Meshes)
{
foreach (var meshPart in mesh.MeshParts)
{
meshPart.DisableNormalMap = true;
}
}
}
public void DisableMetallicRoughnessMaps()
{
foreach (var mesh in Meshes)
{
foreach (var meshPart in mesh.MeshParts)
{
meshPart.DisableMetallicRoughnessMap = true;
}
}
}
}
}