ace/Source/ACE.Server/Network/Structure/Extensions.cs
gmriggs 7622d272fd
Fixing jump in multiplayer, refactoring movement and animation systems for network and game layers (#1070)
* Fixing jump in multiplayer, refactoring movement and animation systems for network and game layers

* Fixing stamina dropping to 0 while running

* Fixing some monsters getting stuck if they wakeup during idle emote

* Reverting position

* Fixing magic aftercast speed
2018-10-23 00:16:53 -04:00

32 lines
784 B
C#

using System.IO;
using System.Numerics;
namespace ACE.Server.Network.Structure
{
public static class Extensions
{
public static Vector3 ReadVector3(this BinaryReader reader)
{
var v = new Vector3();
v.X = reader.ReadSingle();
v.Y = reader.ReadSingle();
v.Z = reader.ReadSingle();
return v;
}
public static Quaternion ReadQuaternion(this BinaryReader reader)
{
// note that AC sends quaternions with the W-component first...
var q = new Quaternion();
q.W = reader.ReadSingle();
q.X = reader.ReadSingle();
q.Y = reader.ReadSingle();
q.Z = reader.ReadSingle();
return q;
}
}
}