IsdkGrabbableComponent is a Pointer handler. It consumes a set of Pointer updates from an Interactable and produces a transformation change on an object. Because Ray, Poke, and Grab interactions all adhere to the Pointer Lifecycle contract, IsdkGrabbableComponent can work with any of them.| Item | Description |
|---|---|
Identifier | A unique string that tells you which interactor in the scene triggered the interaction. |
Type | One of the following types of events: Hover, Unhover, Select, Unselect, Move, and Cancel. |
Pose | A data structure that provides the 3D coordinates and the orientation, or rotation, of the interaction point (ex. the grab point on an object or the poke point on a surface). |
Interactor | A reference to the interactor - in the form of a SceneComponent - that initiated the interaction. |
Interactable | A reference the interactable - in the form of an IPointable - being interacted with. |
IsdkIPointable broadcasts a set of Pointer Events every time it changes state. To enable your application to react to these events, you can bind to the pointer event delegate for the interactable.if (IsValid(Pointable.GetObject()))
{
Pointable.GetInterface()->GetInteractionPointerEventDelegate().AddUniqueDynamic(
this, &UIsdkPointerEventAudioPlayer::HandlePointerEvent);
}
...
void UIsdkPointerEventAudioPlayer::HandlePointerEvent(FIsdkInteractionPointerEvent PointerEvent)
{
UAudioComponent* AudioToPlay = nullptr;
switch (PointerEvent.Type)
{
case EIsdkPointerEventType::Hover:
AudioToPlay = HoverAudio;
break;
case EIsdkPointerEventType::Unhover:
AudioToPlay = UnhoverAudio;
break;
case EIsdkPointerEventType::Select:
AudioToPlay = SelectAudio;
break;
case EIsdkPointerEventType::Unselect:
AudioToPlay = UnselectAudio;
break;
case EIsdkPointerEventType::Move:
AudioToPlay = MoveAudio;
break;
case EIsdkPointerEventType::Cancel:
AudioToPlay = CancelAudio;
break;
}
if (IsValid(AudioToPlay))
{
AudioToPlay->Play();
}
}

IsdkIPointable must adhere to the Pointer Lifecycle contract. This contract defines the order of events the IsdkIPointable can broadcast in order to transition a Pointer through three conceptual states. For more details, see Pointable.