mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* Few more vector3 value type fixes * Basic fix for HandleActionStackableSplitToContainer Still need to fix the network messages * Releat logout protection
53 lines
1.4 KiB
C#
53 lines
1.4 KiB
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()
|
|
{
|
|
Origin = Vector3.Zero;
|
|
Orientation = Quaternion.Identity;
|
|
}
|
|
|
|
public Frame(ACE.Entity.Position position)
|
|
{
|
|
Init(position.Pos, position.Rotation);
|
|
}
|
|
|
|
public Frame(Vector3 origin, Quaternion orientation)
|
|
{
|
|
Init(origin, orientation);
|
|
}
|
|
|
|
public void Init(Vector3 origin, Quaternion orientation)
|
|
{
|
|
Origin = origin;
|
|
Orientation = new Quaternion(orientation.X, orientation.Y, orientation.Z, orientation.W);
|
|
}
|
|
|
|
|
|
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);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Origin + " " + Orientation;
|
|
}
|
|
}
|
|
}
|