UUxtGrabTargetComponent
Interactable component that listens to grab events from near pointers.
A pointer that starts grabing while near the actor is considered a grabbing pointer. The grab is released when the pointer stops grabing, regardless of whether it is still near or not.
The GrabComponent does not react to grabbing pointers by itself, but serves as a base class for manipulation.
class UUxtGrabTargetComponent;
Header
#include <Interactions/UxtGrabTargetComponent.h>
Inheritance
Inherits from UUxtManipulatorComponent, IUxtGrabTarget, IUxtGrabHandler, IUxtFarTarget, IUxtFarHandler, UActorComponent
Inherited by UUxtManipulatorComponentBase
Public Functions
Name | |
---|---|
UUxtGrabTargetComponent() | |
void | FindGrabPointer(UUxtNearPointerComponent * NearPointer, UUxtFarPointerComponent * FarPointer, bool & Success, FUxtGrabPointerData & PointerData, int & Index) const |
void | GetPrimaryGrabPointer(bool & Valid, FUxtGrabPointerData & PointerData) const |
void | GetSecondaryGrabPointer(bool & Valid, FUxtGrabPointerData & PointerData) const |
bool | ForceEndGrab() |
FTransform | GetGrabPointCentroid(const FTransform & ToWorldTransform) const |
FVector | GetTargetCentroid() const |
bool | GetTickOnlyWhileGrabbed() const |
void | SetTickOnlyWhileGrabbed(bool bEnable) |
const TArray< FUxtGrabPointerData > & | GetGrabPointers() const |
virtual void | OnExternalManipulationStarted() override |
Protected Functions
Public Attributes
Name | |
---|---|
FUxtEnterFarFocusDelegate | OnEnterFarFocus |
FUxtUpdateFarFocusDelegate | OnUpdateFarFocus |
FUxtExitFarFocusDelegate | OnExitFarFocus |
FUxtEnterGrabFocusDelegate | OnEnterGrabFocus |
FUxtUpdateGrabFocusDelegate | OnUpdateGrabFocus |
FUxtExitGrabFocusDelegate | OnExitGrabFocus |
FUxtBeginGrabDelegate | OnBeginGrab |
FUxtUpdateGrabDelegate | OnUpdateGrab |
FUxtEndGrabDelegate | OnEndGrab |
int32 | InteractionMode |
int32 | GrabModes |
Additional inherited members
Public Functions inherited from UUxtManipulatorComponent
Name | |
---|---|
bool | GetAutoDetectConstraints() const |
void | SetAutoDetectConstraints(bool bNewAutoDetectConstraints) |
const TArray< FComponentReference > & | GetSelectedConstraints() const |
void | AddConstraint(const FComponentReference & NewConstraint) |
void | RemoveConstraint(const FComponentReference & NewConstraint) |
bool | GetRelativeToInitialScale() const |
void | SetRelativeToInitialScale(const bool Value) |
float | GetMinScale() const |
void | SetMinScale(const float Value) |
float | GetMaxScale() const |
void | SetMaxScale(const float Value) |
Protected Functions inherited from UUxtManipulatorComponent
Name | |
---|---|
virtual void | TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override |
void | InitializeConstraints(USceneComponent * NewTargetComponent) |
void | ApplyConstraints(FTransform & Transform, EUxtTransformMode TransformMode, bool bIsOneHanded, bool bIsNear) const |
Public Functions inherited from IUxtGrabTarget
Name | |
---|---|
bool | IsGrabFocusable(const UPrimitiveComponent * Primitive) const |
Public Functions inherited from IUxtGrabHandler
Name | |
---|---|
bool | CanHandleGrab(UPrimitiveComponent * Primitive) const |
Public Functions inherited from IUxtFarTarget
Name | |
---|---|
bool | IsFarFocusable(const UPrimitiveComponent * Primitive) const |
Public Functions inherited from IUxtFarHandler
Name | |
---|---|
bool | CanHandleFar(UPrimitiveComponent * Primitive) const |
void | OnUpdatedFarFocus(UUxtFarPointerComponent * Pointer) |
void | OnFarPressed(UUxtFarPointerComponent * Pointer) |
void | OnFarDragged(UUxtFarPointerComponent * Pointer) |
void | OnFarReleased(UUxtFarPointerComponent * Pointer) |
Public Functions Documentation
function UUxtGrabTargetComponent
UUxtGrabTargetComponent()
function FindGrabPointer
void FindGrabPointer(
UUxtNearPointerComponent * NearPointer,
UUxtFarPointerComponent * FarPointer,
bool & Success,
FUxtGrabPointerData & PointerData,
int & Index
) const
Returns true if the pointer is currently grabbing the actor. PointerData will contain the associated grab data for the pointer. Index is the order in which pointers started grabbing.
function GetPrimaryGrabPointer
void GetPrimaryGrabPointer(
bool & Valid,
FUxtGrabPointerData & PointerData
) const
Returns the first active grab pointer. If no pointer is grabbing the Valid output will be false.
function GetSecondaryGrabPointer
void GetSecondaryGrabPointer(
bool & Valid,
FUxtGrabPointerData & PointerData
) const
Returns the second active grab pointer. If less than two pointers are grabbing the Valid output will be false.
function ForceEndGrab
bool ForceEndGrab()
Release all currently grabbing pointers. Returns true if any pointers were grabbing and have been released, false if no pointers were grabbing.
function GetGrabPointCentroid
FTransform GetGrabPointCentroid(
const FTransform & ToWorldTransform
) const
Compute the centroid of the grab points in world space.
function GetTargetCentroid
FVector GetTargetCentroid() const
Compute the centroid of the pointer targets in world space.
function GetTickOnlyWhileGrabbed
bool GetTickOnlyWhileGrabbed() const
function SetTickOnlyWhileGrabbed
void SetTickOnlyWhileGrabbed(
bool bEnable
)
function GetGrabPointers
const TArray< FUxtGrabPointerData > & GetGrabPointers() const
Returns a list of all currently grabbing pointers.
function OnExternalManipulationStarted
virtual void OnExternalManipulationStarted() override
Protected Functions Documentation
function BeginPlay
virtual void BeginPlay() override
Reimplements: UUxtManipulatorComponent::BeginPlay
Reimplemented by: UUxtManipulatorComponentBase::BeginPlay
function IsGrabFocusable_Implementation
virtual bool IsGrabFocusable_Implementation(
const UPrimitiveComponent * Primitive
) const override
function CanHandleGrab_Implementation
virtual bool CanHandleGrab_Implementation(
UPrimitiveComponent * Primitive
) const override
function OnEnterGrabFocus_Implementation
virtual void OnEnterGrabFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnUpdateGrabFocus_Implementation
virtual void OnUpdateGrabFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnExitGrabFocus_Implementation
virtual void OnExitGrabFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnBeginGrab_Implementation
virtual void OnBeginGrab_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnUpdateGrab_Implementation
virtual void OnUpdateGrab_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnEndGrab_Implementation
virtual void OnEndGrab_Implementation(
UUxtNearPointerComponent * Pointer
) override
function IsFarFocusable_Implementation
virtual bool IsFarFocusable_Implementation(
const UPrimitiveComponent * Primitive
) const override
function CanHandleFar_Implementation
virtual bool CanHandleFar_Implementation(
UPrimitiveComponent * Primitive
) const override
function OnFarPressed_Implementation
virtual void OnFarPressed_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnFarReleased_Implementation
virtual void OnFarReleased_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnFarDragged_Implementation
virtual void OnFarDragged_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnEnterFarFocus_Implementation
virtual void OnEnterFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnExitFarFocus_Implementation
virtual void OnExitFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnUpdatedFarFocus_Implementation
virtual void OnUpdatedFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function GetPointerCentroid
FTransform GetPointerCentroid() const
Compute the average transform of currently grabbing pointers
Public Attributes Documentation
variable OnEnterFarFocus
FUxtEnterFarFocusDelegate OnEnterFarFocus;
Event raised when entering grab focus.
variable OnUpdateFarFocus
FUxtUpdateFarFocusDelegate OnUpdateFarFocus;
Event raised when grab focus updates.
variable OnExitFarFocus
FUxtExitFarFocusDelegate OnExitFarFocus;
Event raised when exiting grab.
variable OnEnterGrabFocus
FUxtEnterGrabFocusDelegate OnEnterGrabFocus;
Event raised when entering grab focus.
variable OnUpdateGrabFocus
FUxtUpdateGrabFocusDelegate OnUpdateGrabFocus;
Event raised when grab focus updates.
variable OnExitGrabFocus
FUxtExitGrabFocusDelegate OnExitGrabFocus;
Event raised when exiting grab.
variable OnBeginGrab
FUxtBeginGrabDelegate OnBeginGrab;
Event raised when grab starts.
variable OnUpdateGrab
FUxtUpdateGrabDelegate OnUpdateGrab;
Event raised when grab updates.
variable OnEndGrab
FUxtEndGrabDelegate OnEndGrab;
Event raised when grab ends.
variable InteractionMode
int32 InteractionMode;
Property that indicates if the object is grabbable with far or near interaction or both.
variable GrabModes
int32 GrabModes;
Enabled grab modes.
Updated on 2 November 2021 at 11:40:26 Coordinated Universal Time