-
Hi, sorry this is probably a n00b question because I'm a graphics guy and I don't know much but about physics engines but let's say I have a floor made of several perfectly aligned static physics bodies each made of a single box shape like this : Is there a way to avoid having my character controller returning JPH::CharacterBase::EGroundState::InAir for a few frames when crossing the edge between two adjacent tiles? I know it would be better to merge all the floor static colliders into a single object but I want to keep them separated if possible, what would be the recommend approach? e.g. In Unity I would play with "Default Contact Offset" and use a small offset to deal with this kind of issues. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Are you using CharacterVirtual? If not, then do, it works better with this kind of collision data. Also check what convex radius you have set on the box, if it is big you effectively create a gap between the boxes. If you're using the Character class then the only option is to combine the shapes into a single StaticCompoundShape or MutableCompoundShape (which could be done at run-time) and do |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for all your answers!
Indeed I am using Character, not CharacterVirtual. I have to check the pros/cons of using CharacterVirtual to see if I can change it.
I haven't changed mConvexRadius so I guess it's using default. My boxes are 4x4x0.25 and mConvexRadius = 0.05.
I was currently trying to merge all my static colliders into a single body, but using a StaticCompoundShapes sounds better :)
Is it a recent addition? I may have to update because I'm using 4.0.1 and couldn't find it in body.h Thanks, |
Beta Was this translation helpful? Give feedback.
-
Yes it only exists on master currently |
Beta Was this translation helpful? Give feedback.
Are you using CharacterVirtual? If not, then do, it works better with this kind of collision data.
Also check what convex radius you have set on the box, if it is big you effectively create a gap between the boxes.
If you're using the Character class then the only option is to combine the shapes into a single StaticCompoundShape or MutableCompoundShape (which could be done at run-time) and do
Body::SetEnhancedInternalEdgeRemoval(true)
on the character's body.