yog_event/client/render.rs
1//! What the client draws.
2
3use yog_data::Schema;
4
5/// Fired every frame when the HUD is rendered.
6/// `delta_tick` is the partial-tick interpolation factor (0.0–1.0).
7#[derive(Debug, Clone, Schema)]
8pub struct Hud {
9 pub delta_tick: f32,
10}
11
12/// Fired every frame at the end of world rendering (the frame's graphics
13/// carry the camera: `view_proj`, `camera_pos`).
14#[derive(Debug, Clone, Schema)]
15pub struct World {
16 pub delta_tick: f32,
17}
18
19/// A mod's screen drawn this frame (after its background); keyed by the screen's id.
20#[derive(Debug, Clone, Schema)]
21pub struct Ui {
22 pub ui_id: String,
23}
24
25/// The camera this frame, as vanilla placed it, and what the mods make of
26/// it: each handler adds to `out`, seeing the one before's.
27#[derive(Debug, Clone, Schema)]
28pub struct Camera {
29 pub frame: yog_body::CameraFrame,
30 pub out: yog_body::CameraOut,
31}
32
33/// A tracked entity's body this frame (`yog_body::wire`): each handler
34/// adds its ops to `ops` (pose vanilla parts, turn, draw meshes…).
35#[derive(Debug, Clone, Schema)]
36pub struct Body {
37 pub frame: yog_body::Frame,
38 pub ops: yog_body::Ops,
39}
40
41/// A stack's tooltip picture drawn in `rect` (`[x, y, w, h]`, screen
42/// pixels); keyed by the item (`item::Picture` sized it).
43#[derive(Debug, Clone, Schema)]
44pub struct Tooltip {
45 pub item: String,
46 pub snbt: String,
47 pub rect: [f32; 4],
48}
49
50/// The picture of a book page of type `drawn` drawn in `rect` (`[x, y, w,
51/// h]`, screen pixels), every frame the page is open; keyed by its `drawer`.
52#[derive(Debug, Clone, Schema)]
53pub struct Page {
54 pub drawer: String,
55 /// The page's `data`.
56 pub data: yog_data::Value,
57 pub rect: [f32; 4],
58}