You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for all the work on this great library! This may be more of a question than an issue..
I have two use-cases:
RigidBodyDesc has a lifetime as mentioned in RigdBodyDesc can't be stored #205. I have a queue of these descriptions that would be used to create bodies later in the frame. It's a bit painful to enqueue this object because of the lifetimes.
I'd like to store body/collider descriptions in some sort of data file, likely pulled in using serde. I haven't looked at serde yet so perhaps it supports this, but I imagine if the lifetimes weren't there, it would be more straightforward to serialize structs like RigidBodyDesc.
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):
ColliderDesc
RigidBodyDescWithoutColliders
RigidBodyDescWithColliders<'a>
There would need to be some way to combine them like:
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 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?
The text was updated successfully, but these errors were encountered: