C4 Engine Terathon Software C4 Engine API Documentation

• World Manager

API Links
Developer Links

Interactor::HandleInteractionEvent

Defined in:  C4World.h
Called to handle an interaction event.
Prototype

virtual void HandleInteractionEvent(InteractionEventType type, Node *node, const Point3D *position = nullptr);

Parameters
type The type of event. See the Controller::HandleInteractionEvent for a list of possible types.
node The interactive node to which the event pertains.
position The object-space position on the interactive node at which the event took place. If the type parameter is kInteractionEventDisengage, then this parameter is nullptr.
Description
The HandleInteractionEvent function is called by the World Manager when an interaction event takes place for a particular instance of the Interactor class. If this function is overridden, it must call the base class counterpart first. An overriding function will typical cause the Controller::HandleInteractionEvent function to be called for the controller attached to the node specified by the node parameter. The HandleInteractionEvent function only receives the kInteractionEventEngage, kInteractionEventDisengage, and kInteractionEventTrack events. The remaining two event types, kInteractionEventActivate and kInteractionEventDeactivate, should be sent directly to a controller when the user explicitly provides input with the intent to interact with an object. It can be determined whether an Interactor instance is currently engaged with an interactive object by calling the Interactor::GetInteractionNode function.
See Also

Interactor::SetInteractionProbe

Interactor::GetInteractionNode

Controller::HandleInteractionEvent