2017-09-15 08:22:51 -07:00
|
|
|
using System.Collections.Generic;
|
2018-01-31 21:09:08 -06:00
|
|
|
using System.IO;
|
2018-02-16 09:56:51 -05:00
|
|
|
using System.Numerics;
|
2017-09-15 08:22:51 -07:00
|
|
|
|
|
|
|
|
namespace ACE.DatLoader.Entity
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-08-10 19:56:25 -04:00
|
|
|
/// A vertex position, normal, and texture coords
|
2017-09-15 08:22:51 -07:00
|
|
|
/// </summary>
|
2018-01-31 21:09:08 -06:00
|
|
|
public class SWVertex : IUnpackable
|
2017-09-15 08:22:51 -07:00
|
|
|
{
|
2018-08-10 19:56:25 -04:00
|
|
|
public Vector3 Origin { get; private set; }
|
|
|
|
|
public Vector3 Normal { get; private set; }
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-08-10 19:56:25 -04:00
|
|
|
public List<Vec2Duv> UVs { get; private set; }
|
2018-01-31 21:09:08 -06:00
|
|
|
|
|
|
|
|
public void Unpack(BinaryReader reader)
|
2017-09-15 08:22:51 -07:00
|
|
|
{
|
2018-02-03 20:41:21 -06:00
|
|
|
var numUVs = reader.ReadUInt16();
|
2018-08-10 19:56:25 -04:00
|
|
|
UVs = new List<Vec2Duv>(numUVs);
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-08-10 19:56:25 -04:00
|
|
|
Origin = reader.ReadVector3();
|
|
|
|
|
Normal = reader.ReadVector3();
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-01-31 21:09:08 -06:00
|
|
|
UVs.Unpack(reader, numUVs);
|
2017-09-15 08:22:51 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|