C4 Engine
C4 Engine API Documentation

Controller::HandleInteractionEvent

Defined in:  C4Controller.h
Called to handle an event for an interactive node.
Prototype

virtual void HandleInteractionEvent(EventType type, const Point3D *position, Node *initiator = nullptr);

Parameters
type The event type. See the list of possible events below.
position The position, in the target node's local coordinate system, where the event occurred.
initiator The node that caused the event to occur.
Description
The HandleInteractionEvent function is called when an event needs to be handled for an interactive node. The type parameter specifies the type of event that occurred and can be one of the following constants.
kEventInteractionEngage The user has begun looking at an interactive object.
kEventInteractionDisengage The user has stopped looking at an interactive object.
kEventInteractionActivate The user has explicitly activated an interactive object (e.g., with a mouse click).
kEventInteractionDeactivate The user has released the input control used to activate an interactive object.
kEventInteractionTrack The user has changed the interaction position.
By default, a controller activates itself when the kEventInteractionActivate event is received, and no action is taken for other types of events.