Kav/Data/MeshSpriteDrawData.cs

36 lines
1.2 KiB
C#
Raw Normal View History

2020-12-10 08:34:06 +00:00
using Microsoft.Xna.Framework;
2020-12-12 02:22:54 +00:00
using Microsoft.Xna.Framework.Graphics;
2020-12-10 08:34:06 +00:00
namespace Kav.Data
{
2020-12-12 08:17:10 +00:00
public struct MeshSpriteDrawData : IIndexDrawable, ICullable, ITransformable
2020-12-10 08:34:06 +00:00
{
2020-12-12 02:22:54 +00:00
public SpriteMesh MeshSprite { get; }
public Texture2D Texture { get; }
public Texture2D Normal { get; }
2020-12-10 08:34:06 +00:00
public SpriteBillboardConstraint BillboardConstraint { get; }
public Matrix TransformMatrix { get; }
2020-12-10 21:53:55 +00:00
public UVData UVOffset { get; }
2020-12-10 08:34:06 +00:00
2020-12-12 08:17:10 +00:00
public IndexBuffer IndexBuffer => MeshSprite.IndexBuffer;
public VertexBuffer VertexBuffer => MeshSprite.VertexBuffer;
public BoundingBox BoundingBox => MeshSprite.BoundingBox;
2020-12-10 08:34:06 +00:00
public MeshSpriteDrawData(
2020-12-12 02:22:54 +00:00
SpriteMesh meshSprite,
Texture2D texture,
Texture2D normal,
2020-12-10 08:34:06 +00:00
SpriteBillboardConstraint billboardConstraint,
Matrix transformMatrix,
2020-12-10 21:53:55 +00:00
UVData offset
2020-12-10 08:34:06 +00:00
) {
MeshSprite = meshSprite;
2020-12-12 02:22:54 +00:00
Texture = texture;
Normal = normal;
2020-12-10 08:34:06 +00:00
BillboardConstraint = billboardConstraint;
TransformMatrix = transformMatrix;
2020-12-10 21:53:55 +00:00
UVOffset = offset;
2020-12-10 08:34:06 +00:00
}
}
}