Replies: 2 comments 3 replies
-
Hi, About the question, I would suggest to ask on Jolt discussion as the author of jolt is the real expert here (@jrouwe). If there is something Jolt have and I didn't exposed to C/C# world I would gladly add it. Cheers, |
Beta Was this translation helpful? Give feedback.
-
I'm not sure how large a 'tile' is in your case. I would not place the entire world in a single MutableCompoundShape. The mutability comes at a performance cost. Instead you could divide your level in regions and have a body and a MutableCompoundShape per region, or alternatively have a StaticCompoundShape per region if the collision data in that region doesn't change after it has been loaded.
I think it is best to look at the C++ examples for this: |
Beta Was this translation helpful? Give feedback.
-
Hello!
There's a chance I'm missing the documentation or I need to review the usage patterns in the Jolt main repo so mind me if I've missed something!
I'm implementing Jolt Physics via JoltPhysicsSharp into my Silk.NET Framework/ECS where I support both 3D and 2D focused runtimes, I'm trying to implement a 2D
TilemapCollider
and it seemed that creating a Body using aMutableCompoundShape
made the most sense to attach a shape for each Tile and have it managed by a singular body (I did a similar implementation using Velcro/Box2D physics in a previous iteration and that was the recommended approach there)Does this approach make sense for Jolt Physics? Would it be better to consider a customized approach that links into the broadphase lifecycle with some sort of AABB (thinking aloud an incomplete thought there) or should I try to work out something that creates larger convex shapes from the Tiles? (I tried the latter approach with Velcro and it proved to be quite difficult to merge tile shapes into convex shapes!)
Any ideas are appreciated! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions