Class C2SFrameVRPosePacket

java.lang.Object
net.timtaran.interactivemc.network.sync.packet.C2SFrameVRPosePacket
All Implemented Interfaces:
net.xmx.velthoric.network.IVxNetPacket

public class C2SFrameVRPosePacket extends Object implements net.xmx.velthoric.network.IVxNetPacket
Client-to-Server packet containing the player's current VR pose.

This packet is sent every frame from the client to transmit the current position and rotation data for all VR body parts. The server stores this data for physics simulation and network replication to other players.

  • Constructor Summary

    Constructors
    Constructor
    Description
    C2SFrameVRPosePacket(org.vivecraft.api.data.VRPose pose)
    Constructs a new VR pose packet.
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(net.xmx.velthoric.network.VxByteBuf buf)
    Decodes the packet from a network buffer.
    void
    encode(net.xmx.velthoric.network.VxByteBuf buf)
    Encodes the packet's VR pose data into a network buffer.
    void
    handle(dev.architectury.networking.NetworkManager.PacketContext context)
    Handles the VR pose packet on the server side.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • C2SFrameVRPosePacket

      public C2SFrameVRPosePacket(org.vivecraft.api.data.VRPose pose)
      Constructs a new VR pose packet.
      Parameters:
      pose - the VR pose containing current body part data
  • Method Details

    • encode

      public void encode(net.xmx.velthoric.network.VxByteBuf buf)
      Encodes the packet's VR pose data into a network buffer.

      Serializes all body parts, seated state, handedness, and FBT mode.

      Specified by:
      encode in interface net.xmx.velthoric.network.IVxNetPacket
      Parameters:
      buf - the buffer to write to
    • decode

      public static C2SFrameVRPosePacket decode(net.xmx.velthoric.network.VxByteBuf buf)
      Decodes the packet from a network buffer.

      Reconstructs the VR pose from the serialized data by reading all body parts and player state flags.

      Parameters:
      buf - the buffer to read from
      Returns:
      a new instance of the VR pose packet with decoded data
    • handle

      public void handle(dev.architectury.networking.NetworkManager.PacketContext context)
      Handles the VR pose packet on the server side.

      Updates the server-side VR pose data store with the player's current pose, which is then used for physics simulation and replication to other players.

      Specified by:
      handle in interface net.xmx.velthoric.network.IVxNetPacket
      Parameters:
      context - the packet context containing the player and network info