mixed-reality-extension-sdk
mixed-reality-extension-sdk copied to clipboard
[Bug] Actors filtered by GroupMask should be invisible to the input layer
Actors with colliders on them that aren't rendered due to GroupMask association: colliders remain active and intercept input events even though the mesh is not rendered.
This is by design, to maintain physics synchronization.
This bug is specific to input events. Local input must not be intercepted by these invisible objects.
So when an object is invisible, we should locally disable its collider as well? I guess that works with our current single-simulation physics system. Or do you propose ignoring them in the input raycast?
After in-person discussion, we decided that the best solution to this issue is to allow collider.enabled
to be a group mask as well. This is because the collider's state should not be dependent on the visual state of an actor (appearance.enabled
). As such, I'm closing this issue because it is already tracked as #328
#328 talks about game layers, not layer masking. Reopening this issue.
Here is a solution I think will work for the majority of cases, and keeps the API simple:
Colliders follow visibility group mask unless the actor has a rigid body.
This addresses the two top-level concerns:
- Masked actors should not collide.
- Agreement in physics simulation.
This may mean putting actors with rigid bodies into a physics layer, but that's an implementation detail (not reflected in the API).
I think Eric's suggested solution is in the right direction, but a slightly different approach may solve this without requiring a separate physics layer:
Colliders always follow visibility group mask
When actor has a rigid body, visibility can only be on or off, not group masked
I think Eric's suggested solution is in the right direction, but a slightly different approach may solve this without requiring a separate physics layer:
Colliders always follow visibility group mask When actor has a rigid body, visibility can only be on or off, not group masked
@sorenhan Is the desire here that colliders within a group mask collide with each other, but not colliders in other group masks? Without layers, this will up the complexity greatly in managing per object collisions based on whether they are masked or not.
You are right, Tom, my suggestion wouldn't work. with my suggestion, you'd still have some group masked actors that could collide with some rigid body actors. The complete proper design here may needn to be tied with #704 - separate collision layer for rigidbodies (and things the rigid bodies can collide with) versus non-rigidbody collisions (input interaction raycasts, character controller).