37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System.Numerics;
|
|
using AcDream.Core.Net;
|
|
using AcDream.Core.Physics;
|
|
using AcDream.Runtime;
|
|
|
|
namespace AcDream.App.Streaming;
|
|
|
|
/// <summary>
|
|
/// One-way boundary from an already accepted wire Position into Runtime's
|
|
/// presentation-independent teleport destination. Canonical physics consumes
|
|
/// the packet first; this adapter neither gates nor applies it.
|
|
/// </summary>
|
|
internal static class RuntimeTeleportDestinationAdapter
|
|
{
|
|
public static RuntimeTeleportDestination FromAcceptedPosition(
|
|
in WorldSession.EntityPositionUpdate update)
|
|
{
|
|
var position = update.Position;
|
|
return new RuntimeTeleportDestination(
|
|
update.Guid,
|
|
update.InstanceSequence,
|
|
update.PositionSequence,
|
|
update.TeleportSequence,
|
|
update.ForcePositionSequence,
|
|
new Position(
|
|
position.LandblockId,
|
|
new Vector3(
|
|
position.PositionX,
|
|
position.PositionY,
|
|
position.PositionZ),
|
|
new Quaternion(
|
|
position.RotationX,
|
|
position.RotationY,
|
|
position.RotationZ,
|
|
position.RotationW)));
|
|
}
|
|
}
|