UniVRM/Assets/VRM10/vrmlib/Runtime/Material/TextureInfo.cs
ousttrue d53942a7bd merge vrm10
* MeshUtility を UniGLTF 下に移動
* Assets/VRM10 を追加
* JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
2021-01-07 13:37:24 +09:00

30 lines
658 B
C#

using System.Numerics;
namespace VrmLib
{
public class TextureInfo
{
public Texture Texture;
// uv = uv * scaling + offset
public Vector2 Offset;
public Vector2 Scaling = Vector2.One;
public float[] OffsetScaling
{
get => new float[] { Offset.X, Offset.Y, Scaling.X, Scaling.Y };
set
{
Offset.X = value[0];
Offset.Y = value[1];
Scaling.X = value[2];
Scaling.Y = value[3];
}
}
public TextureInfo(Texture texture)
{
Texture = texture;
}
}
}