What is the correct way to handle a body that can collide with some layers and is a sensor to others? #1885
-
|
TL:DR - Is there a built-in way to mark a body and both a sensor and a collider? I've recently read this post and it's similar to a feature I'm trying to add. However, I don't have 2 different shapes where one collides and the other is a sensor. In UE5 you can use the collision settings to set whether a collider will either Ignore, Overlap, Or Block a specific channel/object type. My solution in Bullet was converting these collision settings to 2 different packed uint32 for collision channels and overlap channels. This only works in Bullet because there is an option to add a flag on a collider that marks it as something that will trigger a ghost overlap. Meaning I could have a dynamic body that could be overlapped and that would trigger an overlap and not a collision. I don't see any flags like that in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
|
Beta Was this translation helpful? Give feedback.
BodyCreationSettingsindeed doesn't offer this. If I understand correctly what you want then you can achieve that by installing aContactListenerand overridingOnContactAdded/OnContactPersistedto run your own logic and return that the overlap is a sensor overlap through theioSettingsparameter:JoltPhysics/Jolt/Physics/Collision/ContactListener.h
Line 49 in 7fd7a71