2020-08-04 09:32:02 +00:00
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
namespace Kav
|
|
|
|
{
|
|
|
|
public class Model
|
|
|
|
{
|
|
|
|
public Mesh[] Meshes { get; }
|
|
|
|
|
2020-10-02 05:26:40 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-05 19:15:22 +00:00
|
|
|
public Model(Mesh[] meshes)
|
2020-08-04 09:32:02 +00:00
|
|
|
{
|
|
|
|
Meshes = meshes;
|
|
|
|
}
|
2020-10-02 05:26:40 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-04 09:32:02 +00:00
|
|
|
}
|
|
|
|
}
|