Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability with non trivial reflectable types #15

Closed
JonathanPicques opened this issue Oct 6, 2021 · 1 comment
Closed

Usability with non trivial reflectable types #15

JonathanPicques opened this issue Oct 6, 2021 · 1 comment

Comments

@JonathanPicques
Copy link
Contributor

JonathanPicques commented Oct 6, 2021

I wanted to integrate a fixed point library to ease deterministic computations, but I face a big wall since I16F16 does not implement Reflect and the implementation is far from trivial

What would be the course of action to be able to use such structs easily with register_rollback_type?

use fixed::{traits::Fixed, types::I16F16};

#[derive(Default)]
pub struct Velocity {
    pub x: I16F16,
    pub y: I16F16,
}

Throws

.register_rollback_type::<Vector2D>();
^^^^^^^^^^^^^^^^^^^^^^ the trait `bevy::prelude::Reflect` is not implemented for `Velocity`
@gschup
Copy link
Owner

gschup commented Oct 7, 2021

If you cannot #[derive(Reflect)], then it is indeed going to be complicated. I currently don't have a good answer for you. I will ask around, though.

@gschup gschup closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants