Closed Dmajster closed 1 year ago
Thank you very much @Dmajster,
Before going too far, I would like to mention that, thanks to @faassen, heron now features "convex-hull" shapes. That already makes possible the modelisation of complex (convex) collision shapes. If your shapes are convex, it is likely that ConvexHull is a simpler and more reliable solution. For example, convex-hull does not suffer from the "zero mass" and "zero angular intertia" problem.
Of course, TriMeshes and ConvexHull are not fully interchangable, and there is still a value in adding support for TriMesh. This is why I keep the issue and PR open, and I will be very happy to merge this when ready. I just want to make sure you are aware of the ConvexHull solution.
To answer your questions:
Vec3
and ignore the z
component. That's what is done at the other places of the API, and that's what bevy does too. (Transform
takes a translation defined with Vec3
and a rotation defined with Quat
) even when using 2d.Hi,
I merged main
into this branch and solved the conflicts. I also converted your unit test into an integration test where it is easier to make sure that there is no crash in case two trimeshes collide (I just spawn two entities at the same place, and call app.update()
). The test is failing atm.
If you'r still working on this, you can rebase your branch onto my version of the feature/body-trimesh
branch. (For an unknown reason, I couldn't directly push to the PR)
I made this for my own needs, but you may find it interesting: https://github.com/MOZGIII/bevy_trimesh.
It constructs the TriMesh data from the rendering mesh's geometry.
Would be nice to have a way to construct a heron
's [Body::TriMesh
] directly from the underlying rapier's TriMesh
type - or maybe, from a generic Raw(ColliderBuilder)
would be even better?
UPD: submitted #160 as an implementation of a generic collision shape.
Note that this is now indirectly supported via custom collision shapes (#160)
I leave the PR open, because it can still be a nice addition to have first-class support for tri-meshes. But you can close it if you don't want to continue working on it.
Heron is now discontinued. Sorry this change never got merged.
Thank you for your interest in the project and your contributions.
Resolves #41
I have made a new pull request for the Body::TriMesh implementation. This one is based off of Herons main branch. The feature works but still has some todo's left inside as I think they need to be discussed. I have compiled a list of those issues that need to be resolved before this can be reviewed & merged.