r_vec3 position = { 1.0f, 2.0f, 3.0f }; NET_Packet packet; packet.w_begin(M_UPDATE_POSITION); packet.w_vec3(position); send_packet(packet);
NET_Packet packet = receive_packet(); if (packet.r_begin() == M_UPDATE_VELOCITY) { r_vec3 velocity; packet.r_vec3(velocity); // update object's velocity with the new data }This code receives a NET_Packet from the network and checks if it contains a message of type M_UPDATE_VELOCITY. If it does, it reads the r_vec3 data containing the new velocity and updates the object's velocity with it. Based on the code examples and the use of NET_Packet, it can be determined that r_vec3 is part of the game networking library RakNet, which is used for creating multiplayer games.