pub struct RenetClientVisualizer<const N: usize> { /* private fields */ }Expand description
Egui visualizer for the renet client. Draws graphs with metrics: RTT, Packet Loss, Kbitps Sent/Received.
N: determines how many values are shown in the graph. 200 is a good value, if updated at 60 fps the graphs would hold 3 seconds of data.
Implementations§
Source§impl<const N: usize> RenetClientVisualizer<N>
impl<const N: usize> RenetClientVisualizer<N>
pub fn new(style: RenetVisualizerStyle) -> Self
Sourcepub fn add_network_info(&mut self, network_info: NetworkInfo)
pub fn add_network_info(&mut self, network_info: NetworkInfo)
Add the network information from the client. Should be called every time the client updates.
§Usage
client.update(delta);
visualizer.add_network_info(client.network_info());Sourcepub fn show_window(&self, ctx: &Context)
pub fn show_window(&self, ctx: &Context)
Renders a new window with all the graphs metrics drawn.
Sourcepub fn draw_received_kbps(&self, ui: &mut Ui)
pub fn draw_received_kbps(&self, ui: &mut Ui)
Draws only the Received Kilobits Per Second metric.
Sourcepub fn draw_sent_kbps(&self, ui: &mut Ui)
pub fn draw_sent_kbps(&self, ui: &mut Ui)
Draws only the Sent Kilobits Per Second metric.
Sourcepub fn draw_packet_loss(&self, ui: &mut Ui)
pub fn draw_packet_loss(&self, ui: &mut Ui)
Draws only the Packet Loss metric.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for RenetClientVisualizer<N>
impl<const N: usize> RefUnwindSafe for RenetClientVisualizer<N>
impl<const N: usize> Send for RenetClientVisualizer<N>
impl<const N: usize> Sync for RenetClientVisualizer<N>
impl<const N: usize> Unpin for RenetClientVisualizer<N>
impl<const N: usize> UnwindSafe for RenetClientVisualizer<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more