#include "shared/net/proto.hh" namespace shared { namespace net { void set_angles(proto::angles* const proto_angles, const shared::math::angles& angles) noexcept { proto_angles->set_pitch(angles.pitch); proto_angles->set_yaw(angles.yaw); } void set_coords(proto::coords* const proto_coords, const shared::math::coords& coords) noexcept { proto_coords->set_x(coords.x); proto_coords->set_z(coords.z); } void set_vec3(proto::vec3* const proto_vec3, const glm::vec3& vec3) noexcept { proto_vec3->set_x(vec3.x); proto_vec3->set_y(vec3.y); proto_vec3->set_z(vec3.z); } void set_ivec3(proto::ivec3* const proto_ivec3, const glm::ivec3& ivec3) noexcept { proto_ivec3->set_x(ivec3.x); proto_ivec3->set_y(ivec3.y); proto_ivec3->set_z(ivec3.z); } shared::math::angles get_angles(const proto::angles& proto) noexcept { return shared::math::angles{proto.pitch(), proto.yaw()}; } shared::math::coords get_coords(const proto::coords& proto) noexcept { return shared::math::coords{proto.x(), proto.z()}; } glm::vec3 get_vec3(const proto::vec3& proto) noexcept { return glm::vec3{proto.x(), proto.y(), proto.z()}; } glm::ivec3 get_ivec3(const proto::ivec3& proto) noexcept { return glm::ivec3{proto.x(), proto.y(), proto.z()}; } } // namespace net } // namespace shared