Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add utils for rendering #7

wants to merge 4 commits into from

Conversation

NicEastvillage
Copy link
Contributor

@NicEastvillage NicEastvillage commented Jun 30, 2025

  • Adds Renderer for easy RenderGroup construction.
  • Adds many From<T> for RenderMessage impls.
  • Adds some preset colors.

@NicEastvillage NicEastvillage marked this pull request as ready for review July 2, 2025 20:40
Copy link
Member

@swz-git swz-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good!

Comment on lines +76 to +83
impl From<flat::Vector3> for flat::RenderAnchor {
fn from(value: flat::Vector3) -> Self {
Self {
world: value,
relative: None,
}
}
}
Copy link
Member

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

Suggested change
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,
}
}
}

Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants