mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
35 lines
1,017 B
C#
35 lines
1,017 B
C#
using System.IO;
|
|
using System.Numerics;
|
|
|
|
namespace ACE.DatLoader.Entity
|
|
{
|
|
/// <summary>
|
|
/// Frame consists of a Vector3 Origin and a Quaternion Orientation
|
|
/// </summary>
|
|
public class Frame : IUnpackable
|
|
{
|
|
public Vector3 Origin { get; private set; }
|
|
public Quaternion Orientation { get; private set; }
|
|
|
|
public Frame()
|
|
{
|
|
}
|
|
|
|
public Frame(ACE.Entity.Position position)
|
|
{
|
|
Origin = new Vector3(position.PositionX, position.PositionY, position.PositionZ);
|
|
Orientation = new Quaternion(position.RotationX, position.RotationY, position.RotationZ, position.RotationW);
|
|
}
|
|
|
|
public void Unpack(BinaryReader reader)
|
|
{
|
|
Origin = reader.ReadVector3();
|
|
|
|
var qw = reader.ReadSingle();
|
|
var qx = reader.ReadSingle();
|
|
var qy = reader.ReadSingle();
|
|
var qz = reader.ReadSingle();
|
|
Orientation = new Quaternion(qx, qy, qz, qw);
|
|
}
|
|
}
|
|
}
|