General Workflow

Avatar Interaction Standard provides the mechanism of the avatar's interation with interactable objects, which is schematically shown below:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4ee66628-1ccb-4050-a27b-15c6e9fc647d/Untitled.png

As is seen from the scheme, the Standard consists of two main components: InteractionSenderController and InteractionReceiverController. Former is being added to the avatar and initiates the interaction, while the latter is being added to the object, and the associated events are being initiated at moments of focusing on and/ or interaction with this object.

InteractionSenderController

InteractionSenderController component looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/502ebd48-3516-48af-a53c-f1f60c0a4396/Untitled.png

Interact Button parameter holds the name of the the Button-type input element in the AvatarOverallInput component and interprets it as an interaction button. Ray Origin parameter holds the reference to the object, the position of which is the emitter of interaction ray. Said ray, in turn, is emitted in the direction of the avatar's overview. The length and thickness of the interaction ray are defined by the parameters Ray Length and Ray Thickness accordingly. Receiver parameter indicates the current interactable object, that's being intersected with by this component's interaction ray.

In case the InteractionSenderController component's interaction ray intersects with interactable object, it is considered that the avatar is focused on the object. If at this moment the avatar, controlled by either the player or the AI, presses the interaction button, it is considered that the avatar has interacted with the object. At the moments of focusing and interaction, object's InteractionReceiverController component performs associated events, which could be supplemented with arbitrary actions.

InteractionReceiverController

InteractionReceiverController component looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/20a43774-febf-4fe0-b0e8-a18e3a98be75/Untitled.png

OnSenderFocused and OnSenderUnfocused events are being performed at the moments of avatar's focusing and defocusing on the object. Herewith, InteractionSenderController component that initiates these events is being transferred as an input argument.

OnInteractionActive event triggers when the object is being focused on by at least one avatar. Therefore, OnInteractionInactive triggers when the object is not focused on by any avatar at all. Usually, these events are being supplemented with the actions on visualization of object's interactivity, e.g. change the material or parameters in highlight shader.

OnInteractionPerform event triggers when focused avatar presses the interaction button. Herewith, InteractionSenderController component that initiates these events, is being transferred as an input argument.