Class C2SFrameVRPosePacket
java.lang.Object
net.timtaran.interactivemc.network.sync.packet.C2SFrameVRPosePacket
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionC2SFrameVRPosePacket(org.vivecraft.api.data.VRPose pose) Constructs a new VR pose packet. -
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.
-
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:
encodein interfacenet.xmx.velthoric.network.IVxNetPacket- Parameters:
buf- the buffer to write to
-
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
-
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
-