valence_protocol/packets/play/
player_position_look_s2c.rs

1use bitfield_struct::bitfield;
2use valence_math::DVec3;
3
4use crate::{Decode, Encode, Packet, VarInt};
5
6#[derive(Copy, Clone, PartialEq, Debug, Encode, Decode, Packet)]
7pub struct PlayerPositionLookS2c {
8    pub position: DVec3,
9    pub yaw: f32,
10    pub pitch: f32,
11    pub flags: PlayerPositionLookFlags,
12    pub teleport_id: VarInt,
13}
14
15#[bitfield(u8)]
16#[derive(PartialEq, Eq, Encode, Decode)]
17pub struct PlayerPositionLookFlags {
18    pub x: bool,
19    pub y: bool,
20    pub z: bool,
21    pub y_rot: bool,
22    pub x_rot: bool,
23    #[bits(3)]
24    _pad: u8,
25}