Kav/Geometry/Mesh.cs

24 lines
540 B
C#

using Microsoft.Xna.Framework;
namespace Kav
{
public class Mesh
{
public MeshPart[] MeshParts { get; }
public BoundingBox BoundingBox { get; }
public Mesh(MeshPart[] meshParts)
{
MeshParts = meshParts;
BoundingBox boundingBox = new BoundingBox();
foreach (var meshPart in MeshParts)
{
boundingBox = BoundingBox.CreateMerged(boundingBox, meshPart.BoundingBox);
}
BoundingBox = boundingBox;
}
}
}