-
Notifications
You must be signed in to change notification settings - Fork 2
Add utils for rendering #7
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good!
impl From<flat::Vector3> for flat::RenderAnchor { | ||
fn from(value: flat::Vector3) -> Self { | ||
Self { | ||
world: value, | ||
relative: None, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should consider something like this instead? It would also remove the need for this
impl From<flat::Vector3> for flat::RenderAnchor { | |
fn from(value: flat::Vector3) -> Self { | |
Self { | |
world: value, | |
relative: None, | |
} | |
} | |
} | |
impl flat::RenderAnchor { | |
pub fn from_vec(value: impl Into<flat::Vector3>) -> Self { | |
Self { | |
world: value.into(), | |
relative: None, | |
} | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it because RenderAnchor::from_vec(v)
is so much longer than v.into()
😅 And it would be inconsistent with From<CarAnchor>
and From<BallAnchor>
for relative.
From<T> for RenderMessage
impls.