FUxtPointerFocus
Utility class that is used by components to manage different pointers and their focus targets.
struct FUxtPointerFocus;
Header
#include <UxtPointerFocus.h>
Inheritance
Inherited by FUxtGrabPointerFocus, FUxtPokePointerFocus
Public Functions
Name | |
---|---|
virtual | ~FUxtPointerFocus() |
const FVector & | GetClosestTargetPoint() const |
const FVector & | GetClosestTargetNormal() const |
UObject * | GetFocusedTarget() const |
UPrimitiveComponent * | GetFocusedPrimitive() const |
UObject * | GetFocusedTargetChecked() const |
void | SelectClosestTarget(UUxtNearPointerComponent * Pointer, const FTransform & PointerTransform, const TArray< FOverlapResult > & Overlaps) |
void | UpdateClosestTarget(const FTransform & PointerTransform) |
void | SelectClosestPointOnTarget(UUxtNearPointerComponent * Pointer, const FTransform & PointerTransform, UActorComponent * NewTarget) |
void | ClearFocus(UUxtNearPointerComponent * Pointer) |
void | UpdateFocus(UUxtNearPointerComponent * Pointer) const |
UActorComponent * | FindInterfaceComponent(AActor * Owner) const |
Protected Functions
Name | |
---|---|
void | SetFocus(UUxtNearPointerComponent * Pointer, const FTransform & PointerTransform, const FUxtPointerFocusSearchResult & FocusResult) |
FUxtPointerFocusSearchResult | FindClosestTarget(const TArray< FOverlapResult > & Overlaps, const FVector & Point) const |
FUxtPointerFocusSearchResult | FindClosestPointOnComponent(UActorComponent * Target, const FVector & Point) const |
virtual UClass * | GetInterfaceClass() const =0 |
virtual bool | ImplementsTargetInterface(UObject * Target) const =0 |
virtual bool | GetClosestPointOnTarget(const UActorComponent * Target, const UPrimitiveComponent * Primitive, const FVector & Point, FVector & OutClosestPoint, FVector & OutNormal) const =0 |
virtual void | RaiseEnterFocusEvent(UPrimitiveComponent * Target, UUxtNearPointerComponent * Pointer) const =0 |
virtual void | RaiseUpdateFocusEvent(UPrimitiveComponent * Target, UUxtNearPointerComponent * Pointer) const =0 |
virtual void | RaiseExitFocusEvent(UPrimitiveComponent * Target, UUxtNearPointerComponent * Pointer) const =0 |
Public Functions Documentation
function ~FUxtPointerFocus
inline virtual ~FUxtPointerFocus()
function GetClosestTargetPoint
const FVector & GetClosestTargetPoint() const
Get the closest point on the surface of the focused target
function GetClosestTargetNormal
const FVector & GetClosestTargetNormal() const
Get the poke normal from the closest point on the surface
function GetFocusedTarget
UObject * GetFocusedTarget() const
Get the currently focused target object.
function GetFocusedPrimitive
UPrimitiveComponent * GetFocusedPrimitive() const
Get the currently focused primitive component
function GetFocusedTargetChecked
UObject * GetFocusedTargetChecked() const
Get the currently focused target object. Returns null if the target does not implement the expected interface.
function SelectClosestTarget
void SelectClosestTarget(
UUxtNearPointerComponent * Pointer,
const FTransform & PointerTransform,
const TArray< FOverlapResult > & Overlaps
)
Select and set the focused target among the list of overlaps.
function UpdateClosestTarget
void UpdateClosestTarget(
const FTransform & PointerTransform
)
Update the ClosestTargetPoint while focus is locked
function SelectClosestPointOnTarget
void SelectClosestPointOnTarget(
UUxtNearPointerComponent * Pointer,
const FTransform & PointerTransform,
UActorComponent * NewTarget
)
Select the closest primitive from the owner of the given target component. The target component will be the new focus, unless no usable primitive can be found.
function ClearFocus
void ClearFocus(
UUxtNearPointerComponent * Pointer
)
Clear the focused target.
function UpdateFocus
void UpdateFocus(
UUxtNearPointerComponent * Pointer
) const
Notify the focused target of a pointer update.
function FindInterfaceComponent
UActorComponent * FindInterfaceComponent(
AActor * Owner
) const
Find a component of the actor that implements the required interface.
Find a component of the actor that implements the given interface type.
Protected Functions Documentation
function SetFocus
void SetFocus(
UUxtNearPointerComponent * Pointer,
const FTransform & PointerTransform,
const FUxtPointerFocusSearchResult & FocusResult
)
Set the focus to the given target object, primitive, and point on the target.
function FindClosestTarget
FUxtPointerFocusSearchResult FindClosestTarget(
const TArray< FOverlapResult > & Overlaps,
const FVector & Point
) const
Find the closest target object, primitive, and point among the overlaps.
function FindClosestPointOnComponent
FUxtPointerFocusSearchResult FindClosestPointOnComponent(
UActorComponent * Target,
const FVector & Point
) const
Find the closest primitive and point on the owner of the given component.
function GetInterfaceClass
virtual UClass * GetInterfaceClass() const =0
Reimplemented by: FUxtGrabPointerFocus::GetInterfaceClass, FUxtPokePointerFocus::GetInterfaceClass
Get the interface class that targets for the pointer must implement.
function ImplementsTargetInterface
virtual bool ImplementsTargetInterface(
UObject * Target
) const =0
Reimplemented by: FUxtGrabPointerFocus::ImplementsTargetInterface, FUxtPokePointerFocus::ImplementsTargetInterface
Returns true if the given object implements the required target interface.
function GetClosestPointOnTarget
virtual bool GetClosestPointOnTarget(
const UActorComponent * Target,
const UPrimitiveComponent * Primitive,
const FVector & Point,
FVector & OutClosestPoint,
FVector & OutNormal
) const =0
Reimplemented by: FUxtGrabPointerFocus::GetClosestPointOnTarget, FUxtPokePointerFocus::GetClosestPointOnTarget
Find the closest point on the given primitive using the distance function of the target interface.
function RaiseEnterFocusEvent
virtual void RaiseEnterFocusEvent(
UPrimitiveComponent * Target,
UUxtNearPointerComponent * Pointer
) const =0
Reimplemented by: FUxtGrabPointerFocus::RaiseEnterFocusEvent, FUxtPokePointerFocus::RaiseEnterFocusEvent
Notify the target object that it has entered focus.
function RaiseUpdateFocusEvent
virtual void RaiseUpdateFocusEvent(
UPrimitiveComponent * Target,
UUxtNearPointerComponent * Pointer
) const =0
Reimplemented by: FUxtGrabPointerFocus::RaiseUpdateFocusEvent, FUxtPokePointerFocus::RaiseUpdateFocusEvent
Notify the focused target object that the pointer has been updated.
function RaiseExitFocusEvent
virtual void RaiseExitFocusEvent(
UPrimitiveComponent * Target,
UUxtNearPointerComponent * Pointer
) const =0
Reimplemented by: FUxtGrabPointerFocus::RaiseExitFocusEvent, FUxtPokePointerFocus::RaiseExitFocusEvent
Notify the target object that it has exited focus.
Updated on 2 November 2021 at 11:40:26 Coordinated Universal Time