VRTK
VRTK copied to clipboard
CollisionTracker collisionValidity is this behaviour intended?
Environment
- Source of VRTK (GitHub).
- Version of VRTK (GitHub master 9e7ea2cb0a387f3f8e3f57a431d5c1b12d4baaee).
- Version of the Unity software (e.g. Unity 2019.2.0f1).
- Hardware used (Vive).
- SDK used (OpenVR).
Steps to reproduce
- Open Example Scene
- Search for RightInteractor, there is a CollisionTracker component
- the collision tracker has a ForwardingSourceValidity rule CollisionValidity
- look into CollisionValidity. it basically says: the game object should Not contain IgnoreInteractorCollisionTag
- Search for WellBase. It has IgnoreInteractorCollisionTag.
- Use visual studio debug mode attach to unity, and put break point in CollisionNotifier.CanEmit()
- Use right hand to touch WellBase. Find out that the ForwardSource game object is the RightInteractor and the rule accepted (returns true) because right hand has no IgnoreInteractorCollisionTag.
Expected behavior
I expect the intention of the set up is to check whether the 'target' can be touched (emit collision event) rather than always check on the 'source'.
Current behavior
The source checking has very limited use.
I just find out there should be more component involved in the set up.
- CollisionTracker (forwarding source validity checks the source, you can leave it blank)
- hook CollisionTracker.CollisionStarted to CollisionNotifierEventProxyEmitter.Receive
- CollisionNotifierEventProxyEmitter has a ReceiveValidity rule, the RuleSource you can select 'Colliding Source'. This will rule check against the target collider's rigidbody gameObject (or collider's gameObject if no rigidbody attached)
Two issues I can see then.
- the Left/RightInteractor collision tracker's Forwarding Source Validity should leave blank, because target validity (check target for IgnoreInteractorCollisionTag) is handled by subsequent components
- CollisionNotifierEventProxyEmitter.RuleSource is missing an enum to handle non-trigger CollisionData.
I'm not sure what the issue is here?
The rule is to make sure a Collision Tracker cannot pass the message on to a Collision Notifier
Not to check if a collision can occur between two objects.
Can you provide a really simple explanation as I may not be understanding fully?
I understand that the rule is to make sure a Collision Tracker cannot pass the message on to a Collision Notifier.
I notice that RightInteractor's Collision Tracker, when collided with WellBase (with a IgnoreInteractorCollisionTag), the message is also passed on to collision notifier.
The forwarding source validity rule is to ignore interactor collision tag. Its intention is clear that any touching "target" having that tag should not emit collision message. But because it is checking the "source", interactor never had the ignore tag and collision message is always emited.
There is no trivial logic error in the touch/grab interactions because the Active Collisions Container has a ActiveCollisionValidity rule that says only accept (InteractableFacade, ClimbInteracbleFacade, ControllableJointDriveContainerTag). WellBase has not one of them so it is not touchable. yet the collision message is emitted.