Post

Replies

Boosts

Views

Activity

Non-convex collision?
Hi! I think this should be a pretty normal usage of ARKit / RealityKit I have a static mesh for my environment, that I want to have static collision properties. My options for making this interact with dynamic bodies are: ShapeResource.generateConvex(...) -- which overshoots my shape dramatically. Entity.generateCollisionShapes(...) which also overshoots. I notice additional APIs around ShapeResource -- ShapeResource.generateStaticMesh(positions:faceIndices) seems to be exactly what I need. So far, I haven't been able to invoke this successfully to set my collision box. Questions: Is this not, a completely normal thing for developers to want to do? Why is there no support for this out-of-the-box in RealityKit/ARKit? To support this in my app, everywhere I've read has said I need to parse the .obj of my terrain manually, and find triangulated faces and pipe them into this function. That feels like a very standardized process -- and given that RealityKit is already forcing me to use .usdz, why should this not be a part of the SDK? Regardless- I triangulated my terrain mesh, and have been working on parsing code to get the positions and faceIndices for this set up (as an extension on Entity). Is this the right approach? Am I missing something more obvious? Thanks, Justin
6
0
826
Mar ’24