Show / Hide Table of Contents

    UUxtTapToPlaceComponent

    Tap to place is a control used to transform objects at a distance. The control allows you to select an object you wish to place using far interaction. After that, the object will be locked to your gaze and will be placed against surfaces and other objects. Any subsequent far release will end placement, even if the pointer is not pointing at the object being placed.

    class UUxtTapToPlaceComponent;
    

    Header

    #include <Behaviors/UxtTapToPlaceComponent.h>

    Inheritance

    Inherits from UActorComponent, IUxtFarTarget, IUxtFarHandler

    Public Functions

    Name
    UUxtTapToPlaceComponent()
    USceneComponent * GetTargetComponent() const
    void SetTargetComponent(USceneComponent * Target)
    void StartPlacement()
    void EndPlacement()

    Protected Functions

    Name
    virtual void BeginPlay() override
    virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override
    virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
    virtual bool IsFarFocusable_Implementation(const UPrimitiveComponent * Primitive) const override
    virtual bool CanHandleFar_Implementation(UPrimitiveComponent * Primitive) const override
    virtual void OnEnterFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override
    virtual void OnUpdatedFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override
    virtual void OnExitFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override
    virtual void OnFarPressed_Implementation(UUxtFarPointerComponent * Pointer) override
    virtual void OnFarReleased_Implementation(UUxtFarPointerComponent * Pointer) override

    Public Attributes

    Name
    FUxtTapToPlaceBeginFocusDelegate OnBeginFocus
    FUxtTapToPlaceUpdateFocusDelegate OnUpdateFocus
    FUxtTapToPlaceEndFocusDelegate OnEndFocus
    FUxtTapToPlaceBeginPlacingDelegate OnBeginPlacing
    FUxtTapToPlaceEndPlacingDelegate OnEndPlacing
    TEnumAsByte< EUxtTapToPlaceOrientBehavior > OrientationType
    TEnumAsByte< EUxtTapToPlaceMode > PlacementType
    bool KeepOrientationVertical
    float HorizontalSurfaceThreshold
    float DefaultPlacementDistance
    float MaxRaycastDistance
    TEnumAsByte< ECollisionChannel > TraceChannel
    bool bInterpolatePose
    float LerpTime
    bool bUseDefaultSurfaceNormalOffset
    float SurfaceNormalOffset

    Additional inherited members

    Public Functions inherited from IUxtFarTarget

    Name
    bool IsFarFocusable(const UPrimitiveComponent * Primitive) const

    Public Functions inherited from IUxtFarHandler

    Name
    bool CanHandleFar(UPrimitiveComponent * Primitive) const
    void OnEnterFarFocus(UUxtFarPointerComponent * Pointer)
    void OnUpdatedFarFocus(UUxtFarPointerComponent * Pointer)
    void OnExitFarFocus(UUxtFarPointerComponent * Pointer)
    void OnFarPressed(UUxtFarPointerComponent * Pointer)
    void OnFarDragged(UUxtFarPointerComponent * Pointer)
    void OnFarReleased(UUxtFarPointerComponent * Pointer)

    Public Functions Documentation

    function UUxtTapToPlaceComponent

    UUxtTapToPlaceComponent()
    

    function GetTargetComponent

    USceneComponent * GetTargetComponent() const
    

    Get the component to transform.

    function SetTargetComponent

    void SetTargetComponent(
        USceneComponent * Target
    )
    

    Set the component to transform.

    function StartPlacement

    void StartPlacement()
    

    Start placement of the target component.

    function EndPlacement

    void EndPlacement()
    

    End placement of the target component.

    Protected Functions Documentation

    function BeginPlay

    virtual void BeginPlay() override
    

    function TickComponent

    virtual void TickComponent(
        float DeltaTime,
        ELevelTick TickType,
        FActorComponentTickFunction * ThisTickFunction
    ) override
    

    function EndPlay

    virtual void EndPlay(
        const EEndPlayReason::Type EndPlayReason
    ) 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 OnEnterFarFocus_Implementation

    virtual void OnEnterFarFocus_Implementation(
        UUxtFarPointerComponent * Pointer
    ) override
    

    function OnUpdatedFarFocus_Implementation

    virtual void OnUpdatedFarFocus_Implementation(
        UUxtFarPointerComponent * Pointer
    ) override
    

    function OnExitFarFocus_Implementation

    virtual void OnExitFarFocus_Implementation(
        UUxtFarPointerComponent * Pointer
    ) override
    

    function OnFarPressed_Implementation

    virtual void OnFarPressed_Implementation(
        UUxtFarPointerComponent * Pointer
    ) override
    

    function OnFarReleased_Implementation

    virtual void OnFarReleased_Implementation(
        UUxtFarPointerComponent * Pointer
    ) override
    

    Public Attributes Documentation

    variable OnBeginFocus

    FUxtTapToPlaceBeginFocusDelegate OnBeginFocus;
    

    Event raised when a pointer starts focusing the placeable object. bWasAlreadyFocused indicates if the object was already focused by another pointer.

    variable OnUpdateFocus

    FUxtTapToPlaceUpdateFocusDelegate OnUpdateFocus;
    

    Event raised when a focusing pointer updates.

    variable OnEndFocus

    FUxtTapToPlaceEndFocusDelegate OnEndFocus;
    

    Event raised when a pointer ends focusing the placeable object. bIsStillFocused indicates if the object is still focused by another pointer.

    variable OnBeginPlacing

    FUxtTapToPlaceBeginPlacingDelegate OnBeginPlacing;
    

    Event raised when a placeable object is selected.

    variable OnEndPlacing

    FUxtTapToPlaceEndPlacingDelegate OnEndPlacing;
    

    Event raised when a placeable object is deselected and placed.

    variable OrientationType

    TEnumAsByte< EUxtTapToPlaceOrientBehavior > OrientationType = EUxtTapToPlaceOrientBehavior::AlignToSurface;
    

    How the object is oriented against hit surfaces.

    variable PlacementType

    TEnumAsByte< EUxtTapToPlaceMode > PlacementType = EUxtTapToPlaceMode::Head;
    

    How the target should be placed, using head or far pointer.

    variable KeepOrientationVertical

    bool KeepOrientationVertical = false;
    

    Whether the orientation of the object should pitch or roll.

    variable HorizontalSurfaceThreshold

    float HorizontalSurfaceThreshold = 10.0f;
    

    Angle in degrees at which a surface is considered horizontal in AlignToSurface mode. Slightly increasing this value helps avoid jitter resulting from noise in depth data but it can cause objects to lean sideways when moved over slightly inclined surfaces.

    variable DefaultPlacementDistance

    float DefaultPlacementDistance = 150;
    

    Distance to place the object at if no obstructing surface.

    variable MaxRaycastDistance

    float MaxRaycastDistance = 2000;
    

    Max distance to cast to when checking for obstructing surfaces.

    variable TraceChannel

    TEnumAsByte< ECollisionChannel > TraceChannel = ECollisionChannel::ECC_Visibility;
    

    Trace channel for raycast.

    variable bInterpolatePose

    bool bInterpolatePose = true;
    

    Option to ignore interpolation between follow poses

    variable LerpTime

    float LerpTime = 0.1f;
    

    Rate at which its owner will move toward default distance when angular leashing

    variable bUseDefaultSurfaceNormalOffset

    bool bUseDefaultSurfaceNormalOffset = true;
    

    When false, use SurfaceNormalOffset. Otherwise, automatically calculate the offset value.

    variable SurfaceNormalOffset

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Uxt Tap To Place", meta=(DisplayAfter="bUseDefaultSurfaceNormalOffset", EditCondition="!bUseDefaultSurfaceNormalOffset"))
    float SurfaceNormalOffset = 0.0f;
    

    The distance between the pivot point of the object and the surface on which the object is being placed.


    Updated on 2 November 2021 at 11:40:26 Coordinated Universal Time

    • Improve this Doc
    Back to top Generated by DocFX