Closed aclysma closed 5 years ago
Hi! Actually, the next version of nphysics which will be released at the end of next week or the week after will no longer have any lifetimes in any Desc structures, except for the descriptors of deformable bodies. For example, here is what the RigidBodyDesc
will look like: https://github.com/rustsim/nphysics/blob/ccd/src/object/rigid_body.rs#L804-L823
Regarding serialization, keep in mind you will have some difficulty for serializing collider descriptors since there is currently no way of serializing an Arc<Box<Shape<N>>>
because it's a trait-object. See that issue. So you will have some custom serialization code to write to handle the collider shapes.
Thanks, sounds great!
Thanks for all the work on this great library! This may be more of a question than an issue..
I have two use-cases:
My first thought is that additional helper structs could easily be implemented (even potentially in a separate crate) that are reference-free and explicitly designed with serialization in mind, but I was wondering if I was missing something that might make that step unnecessary.
Another option might be to break apart the RigidBodyDesc.. so for example there would be types (not a serious naming suggestion):
There would need to be some way to combine them like:
But maybe there is already a good solution that would make something like this unnecessary?