Show / Hide Table of Contents

    UUxtHandConstraintComponent

    Component that calculates a goal based on hand tracking and moves the owning actor.

    Several zones around the hand supported: radial and ulnar for the thumb side and its opposite, as well as above and below the hand. The goal position is computed by casting a ray in the direction of the zone at a bounding box around the hand joints.

    The constraint can be oriented on either the hand rotation alone or facing the player.

    class UUxtHandConstraintComponent;
    

    Header

    #include <Behaviors/UxtHandConstraintComponent.h>

    Inheritance

    Inherits from UActorComponent

    Inherited by UUxtPalmUpConstraintComponent

    Public Functions

    Name
    UUxtHandConstraintComponent()
    EControllerHand GetTrackedHand() const
    const FBox & GetHandBounds() const
    bool IsConstraintActive() const
    const FVector & GetGoalLocation() const
    const FQuat & GetGoalRotation() const
    virtual bool IsHandUsableForConstraint(EControllerHand NewHand)

    Protected Functions

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

    Public Attributes

    Name
    EControllerHand Hand
    EUxtHandConstraintZone Zone
    EUxtHandConstraintOffsetMode OffsetMode
    EUxtHandConstraintRotationMode RotationMode
    float GoalMargin
    bool bMoveOwningActor
    float LocationLerpTime
    float RotationLerpTime
    FUxtHandConstraintActivatedDelegate OnConstraintActivated
    FUxtHandConstraintDeactivatedDelegate OnConstraintDeactivated
    FUxtHandConstraintBeginTrackingDelegate OnBeginTracking
    FUxtHandConstraintEndTrackingDelegate OnEndTracking

    Public Functions Documentation

    function UUxtHandConstraintComponent

    UUxtHandConstraintComponent()
    

    function GetTrackedHand

    EControllerHand GetTrackedHand() const
    

    function GetHandBounds

    const FBox & GetHandBounds() const
    

    function IsConstraintActive

    bool IsConstraintActive() const
    

    function GetGoalLocation

    const FVector & GetGoalLocation() const
    

    function GetGoalRotation

    const FQuat & GetGoalRotation() const
    

    function IsHandUsableForConstraint

    virtual bool IsHandUsableForConstraint(
        EControllerHand NewHand
    )
    

    Reimplemented by: UUxtPalmUpConstraintComponent::IsHandUsableForConstraint

    Returns true if the given hand is eligible for the constraint. If the hand is rejected the constraint will be deactivated.

    Protected Functions Documentation

    function BeginPlay

    virtual void BeginPlay() override
    

    function TickComponent

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

    Public Attributes Documentation

    variable Hand

    EControllerHand Hand = EControllerHand::AnyHand;
    

    Hand to use for the constraint. If set to 'Any Hand' the first tracked hand will be used, until tracking is lost.

    variable Zone

    EUxtHandConstraintZone Zone = EUxtHandConstraintZone::UlnarSide;
    

    Safe zone that determines the target location of the constraint relative to the hand.

    variable OffsetMode

    EUxtHandConstraintOffsetMode OffsetMode = EUxtHandConstraintOffsetMode::LookAtCamera;
    

    Determines how the offset vector is computed.

    variable RotationMode

    EUxtHandConstraintRotationMode RotationMode = EUxtHandConstraintRotationMode::LookAtCamera;
    

    Determines how the goal rotation is computed.

    variable GoalMargin

    float GoalMargin = 0.0f;
    

    Margin between the hand bounding box and the goal location.

    variable bMoveOwningActor

    bool bMoveOwningActor = true;
    

    Actor transform is moved towards the goal if true. Disable this to only compute the goal without changing the actor transform.

    variable LocationLerpTime

    float LocationLerpTime = 0.05f;
    

    Interpolation time for smoothed translation. Set to zero to disable smoothing.

    variable RotationLerpTime

    float RotationLerpTime = 0.05f;
    

    Interpolation time for smoothed rotation. Set to zero to disable smoothing.

    variable OnConstraintActivated

    FUxtHandConstraintActivatedDelegate OnConstraintActivated;
    

    Event raised when the constraint becomes active, as indicated by the bIsConstraintActive property.

    variable OnConstraintDeactivated

    FUxtHandConstraintDeactivatedDelegate OnConstraintDeactivated;
    

    Event raised when the constraint becomes inactive, as indicated by the bIsConstraintActive property.

    variable OnBeginTracking

    FUxtHandConstraintBeginTrackingDelegate OnBeginTracking;
    

    Event raised when the constraint begins tracking a hand.

    variable OnEndTracking

    FUxtHandConstraintEndTrackingDelegate OnEndTracking;
    

    Event raised when the constraint ends tracking a hand.


    Updated on 19 August 2021 at 17:42:51 Coordinated Universal Time

    • Improve this Doc
    Back to top Generated by DocFX