Kav/Geometry/Model.cs

29 lines
624 B
C#
Raw Normal View History

2020-08-04 09:32:02 +00:00
using Microsoft.Xna.Framework;
namespace Kav
{
public class Model
{
public Mesh[] Meshes { get; }
2020-08-05 19:15:22 +00:00
public Model(Mesh[] meshes)
2020-08-04 09:32:02 +00:00
{
Meshes = meshes;
}
2020-08-05 19:15:22 +00:00
public void ApplyTransform(Matrix transform)
{
foreach (var mesh in Meshes)
{
foreach (var meshPart in mesh.MeshParts)
{
if (meshPart.Effect is TransformEffect transformEffect)
{
transformEffect.World = transform;
}
}
}
}
2020-08-04 09:32:02 +00:00
}
}