-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
serde Serialize and Deserialise on shape types #10626
Comments
That could also be done for the shapes types recently added in |
Bevy-math looks cool but I've never heard of it until now, is it supposed to replace bevy::prelude::shape in a future release? (I've only briefly looked myself, doesn't parry support these basic shapes?) it would be cool to have more expressive shapes in the future |
For the most part, yes. The high-level goal is to have a nice set of primitive shapes that are reusable and interoperable across Bevy's own crates and 3rd party plugins, so they could be used for mesh creation, rendering shapes via gizmos, collider shapes, raycasting, bounding volumes, some rendering things, and so on. This is unlike the existing shapes in
Yes, but we don't want to depend on Parry and bring Nalgebra to the dependency tree. We also might need to have more control over the shape representations so that they are as efficient and general-purpose as possible while being ergonomic to use. And yes, implementing |
Why shouldn't it implement serialize? |
I guess it's entirely possible, I just looked at it and saw it was complicated with only private fields. Maybe upholding invariants? It would be great, actually, if |
At this point, all of the primitives within |
What problem does this solve or what need does it fill?
I am wanting ot efficiently sync data between server and client. Since
Mesh
is not (and should not) implement serialise, I am using a custom enum. I wanted this enum to have variants likePrism(shape::Box)
but I found outshape::Box
doesn't implement serialise and deserialise.What solution would you like?
#[cfg_attr("serialize-serde", derive(Serialize, Deserialize)] on all of the shapes
What alternative(s) have you considered?
Currently I can manually store the underlying types
Additional context
Thanks so much for bevy! Its awesome to have fun with :)
The text was updated successfully, but these errors were encountered: