UUxtNearPointerComponent
Adds poke and grab interactions to an actor. It keeps track of all overlapping poke targets and raises focus events on the closest one. Targets use the transform of pointers focusing them to drive their interactions.
class UUxtNearPointerComponent;
Header
#include <Input/UxtNearPointerComponent.h>
Inheritance
Inherits from UUxtPointerComponent, UActorComponent
Public Functions
Name | |
---|---|
UUxtNearPointerComponent() | |
virtual | ~UUxtNearPointerComponent() |
virtual void | BeginPlay() override |
virtual void | EndPlay(const EEndPlayReason::Type EndPlayReason) override |
virtual void | TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override |
virtual void | SetActive(bool bNewActive, bool bReset =false) override |
virtual UObject * | GetFocusTarget() const override |
virtual FTransform | GetCursorTransform() const override |
void | UpdatePokeInteraction() |
UObject * | GetFocusedGrabTarget(FVector & OutClosestPointOnTarget, FVector & Normal) const |
UObject * | GetFocusedPokeTarget(FVector & OutClosestPointOnTarget, FVector & Normal) const |
UPrimitiveComponent * | GetFocusedGrabPrimitive(FVector & OutClosestPointOnTarget, FVector & Normal) const |
UPrimitiveComponent * | GetFocusedPokePrimitive(FVector & OutClosestPointOnTarget, FVector & Normal) const |
bool | SetFocusedGrabTarget(UActorComponent * NewFocusedTarget, bool bEnableFocusLock) |
bool | SetFocusedPokeTarget(UActorComponent * NewFocusedTarget, bool bEnableFocusLock) |
bool | IsGrabbing() const |
bool | GetIsPoking() const |
FTransform | GetGrabPointerTransform() const |
FTransform | GetPokePointerTransform() const |
float | GetPokePointerRadius() const |
Public Attributes
Name | |
---|---|
TEnumAsByte< ECollisionChannel > | TraceChannel |
float | ProximityRadius |
float | PokeRadius |
float | GrabRadius |
float | PokeDepth |
float | DebounceDepth |
Protected Attributes
Name | |
---|---|
FUxtGrabPointerFocus * | GrabFocus |
FUxtPokePointerFocus * | PokeFocus |
Additional inherited members
Public Functions inherited from UUxtPointerComponent
Name | |
---|---|
UUxtPointerComponent() =default | |
bool | GetFocusLocked() const |
virtual void | SetFocusLocked(bool bLocked) |
Public Attributes inherited from UUxtPointerComponent
Name | |
---|---|
EControllerHand | Hand |
Protected Attributes inherited from UUxtPointerComponent
Name | |
---|---|
bool | bFocusLocked |
Public Functions Documentation
function UUxtNearPointerComponent
UUxtNearPointerComponent()
function ~UUxtNearPointerComponent
virtual ~UUxtNearPointerComponent()
function BeginPlay
virtual void BeginPlay() override
function EndPlay
virtual void EndPlay(
const EEndPlayReason::Type EndPlayReason
) override
function TickComponent
virtual void TickComponent(
float DeltaTime,
ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override
function SetActive
virtual void SetActive(
bool bNewActive,
bool bReset =false
) override
function GetFocusTarget
virtual UObject * GetFocusTarget() const override
function GetCursorTransform
virtual FTransform GetCursorTransform() const override
function UpdatePokeInteraction
void UpdatePokeInteraction()
Update poke distances and detect if poking the target.
function GetFocusedGrabTarget
UObject * GetFocusedGrabTarget(
FVector & OutClosestPointOnTarget,
FVector & Normal
) const
Returns currently focused grab target or null if there is none.
function GetFocusedPokeTarget
UObject * GetFocusedPokeTarget(
FVector & OutClosestPointOnTarget,
FVector & Normal
) const
Returns currently focused poke target or null if there is none.
function GetFocusedGrabPrimitive
UPrimitiveComponent * GetFocusedGrabPrimitive(
FVector & OutClosestPointOnTarget,
FVector & Normal
) const
Returns currently focused grab primitive or null if there is none.
function GetFocusedPokePrimitive
UPrimitiveComponent * GetFocusedPokePrimitive(
FVector & OutClosestPointOnTarget,
FVector & Normal
) const
Returns currently focused poke primitive or null if there is none.
function SetFocusedGrabTarget
bool SetFocusedGrabTarget(
UActorComponent * NewFocusedTarget,
bool bEnableFocusLock
)
Set a focused grab target explicitly which will receive grasp events. If bEnableFocusLock is true, then the new focus target will be locked until released by calling SetFocusLocked.
function SetFocusedPokeTarget
bool SetFocusedPokeTarget(
UActorComponent * NewFocusedTarget,
bool bEnableFocusLock
)
Set a focused poke target explicitly which will receive grasp events. If bEnableFocusLock is true, then the new focus target will be locked until released by calling SetFocusLocked.
function IsGrabbing
bool IsGrabbing() const
function GetIsPoking
bool GetIsPoking() const
function GetGrabPointerTransform
FTransform GetGrabPointerTransform() const
function GetPokePointerTransform
FTransform GetPokePointerTransform() const
function GetPokePointerRadius
float GetPokePointerRadius() const
Public Attributes Documentation
variable TraceChannel
TEnumAsByte< ECollisionChannel > TraceChannel = ECollisionChannel::ECC_Visibility;
variable ProximityRadius
float ProximityRadius = 20.0f;
variable PokeRadius
float PokeRadius = 0.75f;
variable GrabRadius
float GrabRadius = 3.5f;
variable PokeDepth
float PokeDepth = 30.0f;
The depth beyond the front face at which a front face pokable no longer recieves poke events. While poking a front face pokable, if the near pointer moves beyond this depth, the pokable will receive a poke end event.
variable DebounceDepth
float DebounceDepth = 0.5f;
The distance the fingertip must be from a pokeable in order to fire a poke end event. This is used in order to distinguish the queries for poke begin and poke end so you cannot easily cause end touch to fire one frame and begin touch to fire on the next frame.
Protected Attributes Documentation
variable GrabFocus
FUxtGrabPointerFocus * GrabFocus;
Focus of the grab pointer
variable PokeFocus
FUxtPokePointerFocus * PokeFocus;
Focus of the poke pointer
Updated on 19 August 2021 at 17:42:51 Coordinated Universal Time