Class C2SFrameVRPosePacket
java.lang.Object
net.timtaran.interactivemc.body.player.packet.C2SFrameVRPosePacket
- All Implemented Interfaces:
net.xmx.velthoric.network.IVxNetPacket
Client-to-Server packet for updating the player's 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic C2SFrameVRPosePacketdecode(net.xmx.velthoric.network.VxByteBuf buf) Decodes the packet from a network buffer.voidencode(net.xmx.velthoric.network.VxByteBuf buf) Encodes the packet's VR pose data into a network buffer.voidhandle(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, waitMethods inherited from interface net.xmx.velthoric.network.IVxNetPacket
release
-
Constructor Details
-
C2SFrameVRPosePacket
Constructs a new VR pose packet.- Parameters:
pose- the VR pose containing current body part data
-
-
Method Details
-
decode
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
-
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:
encodein interfacenet.xmx.velthoric.network.IVxNetPacket- Parameters:
buf- the buffer to write to
-
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:
handlein interfacenet.xmx.velthoric.network.IVxNetPacket- Parameters:
context- the packet context containing the player and network info
-