ITADN

Add plugin for interpolating arbitrary components

#74OpenTheButlah 创建于 2024-01-03
T
TheButlahcommented
We should introduce a plugin that handles interpolation of data. # Rationale We decided to move away from [lightyear](https://docs.rs/lightyear), which means that we will soon not have client side interpolation of transforms and other data. Depending on the client's bandwidth, they might not get a high framerate of data from the server, and when they do it will have jitter. This will result in kinda janky poses. # Triage This does not block other work because even without interpolation, we could just directly sync data from the latest server updates into the ecs. # Proposed design I think we would model this after other prior art in this space, such as `lightyear` and `bevy_easings`. We might even be able to directly use `bevy_easings` instead, as one of the bevy maintainers (mockersf) wrote it. The main question I have with bevy_easings is if it supports multiple samples for interpolation. A potential API if we don't use `bevy_easings`: ``` ```rust #[derive(Component)] struct Interpolated<T: InterpolatedComponent> { samples: Vec<T>, timestamps: Vec<Duration>, } ``` And then, the `InterpolatedComponent` trait should seek to use the easing functions and traits from the [`interpolation` crate](https://docs.rs/interpolation/).
0 条评论