Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.15k
stars
435
forks
source link
fix: provide non Rigidbody contact events and Rigidbody prioritization #3094
This extends the RigidbodyContactEventManager by adding a new interface that provides ContactEventHandlerInfo:
ContactEventHandlerInfo.ProvideNonRigidBodyContactEvents: When set to true, non-Rigidbody collisions with the registered Rigidbody will generate contact event notifications.
If you want a registered Rigidbody to generate contact event notifications when colliding with non-registered objects that just have colliders (i.e. terrain, static world objects, etc.) , then setting this to true will generate contact events.
ContactEventHandlerInfo.HasContactEventPriority: When set to true, the Rigidbody will be prioritized as the instance that generates the event if the Rigidbody colliding does not have priority.
If this value is tied to ownership and a non-kinematic body collides with a kinematic body and the sequence of the collision places the kinematic body first in the contact event processing, then the non-kinematic body will be considered "preferred" when triggering the contact event notification.
The ContactEventHandlerInfo is queried each time there are contact events to be processed.
This addition does not impact any previous configurations/uses of RigidbodyContactEventManager.
Added IContactEventHandlerWithInfo that derives from IContactEventHandler that can be updated per frame to provide ContactEventHandlerInfo information to the RigidbodyContactEventManager when processing collisions.
ContactEventHandlerInfo.ProvideNonRigidBodyContactEvents: When set to true, non-Rigidbody collisions with the registered Rigidbody will generate contact event notifications.
ContactEventHandlerInfo.HasContactEventPriority: When set to true, the Rigidbody will be prioritized as the instance that generates the event if the Rigidbody colliding does not have priority.
Testing and Documentation
Includes integration tests (wip).
Requires public documentation update (part of Rigidbody pass).
Includes XML API Documentation additions and updates.
This extends the
RigidbodyContactEventManager
by adding a new interface that providesContactEventHandlerInfo
:ContactEventHandlerInfo.ProvideNonRigidBodyContactEvents
: When set to true, non-Rigidbody
collisions with the registeredRigidbody
will generate contact event notifications.Rigidbody
to generate contact event notifications when colliding with non-registered objects that just have colliders (i.e. terrain, static world objects, etc.) , then setting this to true will generate contact events.ContactEventHandlerInfo.HasContactEventPriority
: When set to true, theRigidbody
will be prioritized as the instance that generates the event if theRigidbody
colliding does not have priority.The
ContactEventHandlerInfo
is queried each time there are contact events to be processed.This addition does not impact any previous configurations/uses of
RigidbodyContactEventManager
.MTT-9182
Changelog
IContactEventHandlerWithInfo
that derives fromIContactEventHandler
that can be updated per frame to provideContactEventHandlerInfo
information to theRigidbodyContactEventManager
when processing collisions.ContactEventHandlerInfo.ProvideNonRigidBodyContactEvents
: When set to true, non-Rigidbody
collisions with the registeredRigidbody
will generate contact event notifications.ContactEventHandlerInfo.HasContactEventPriority
: When set to true, theRigidbody
will be prioritized as the instance that generates the event if theRigidbody
colliding does not have priority.Testing and Documentation