FXRSimulationState
Simulation state for head movement and hand gestures.
struct FXRSimulationState;
Header
#include <XRSimulationState.h>
Public Functions
Name | |
---|---|
FXRSimulationState() | |
void | Reset() |
void | ResetHandState(EControllerHand Hand) |
bool | IsHandVisible(EControllerHand Hand) const |
void | SetHandVisibility(EControllerHand Hand, bool bIsVisible) |
bool | IsHandControlled(EControllerHand Hand) const |
bool | IsAnyHandControlled() const |
TArray< EControllerHand > | GetControlledHands() const |
bool | SetHandControlEnabled(EControllerHand Hand, bool bEnabled) |
void | GetTargetHandTransform(EControllerHand Hand, FTransform & TargetTransform, bool & bAnimate) const |
void | AddHandInput(EAxis::Type Axis, float Value) |
void | AddHandMovementInput(EAxis::Type TranslationAxis, float Value) |
void | AddHandRotationInput(EAxis::Type RotationAxis, float Value) |
void | SetDefaultHandLocation(EControllerHand Hand) |
void | SetDefaultHandRotation(EControllerHand Hand) |
FName | GetTargetPose(EControllerHand Hand) const |
void | SetTargetPose(EControllerHand Hand, FName PoseName) |
void | ResetTargetPose(EControllerHand Hand) |
void | TogglePoseForControlledHands(FName PoseName) |
bool | HasGripToWristTransform(EControllerHand Hand) const |
FTransform | GetGripToWristTransform(EControllerHand Hand) const |
void | SetGripToWristTransform(EControllerHand Hand, const FTransform & GripToWristTransform) |
void | ClearGripToWristTransform(EControllerHand Hand) |
Public Attributes
Name | |
---|---|
EXRSimulationHandMode | HandInputMode |
FVector | RelativeHeadPosition |
FQuat | RelativeHeadOrientation |
Public Functions Documentation
function FXRSimulationState
FXRSimulationState()
function Reset
void Reset()
Reset to default.
function ResetHandState
void ResetHandState(
EControllerHand Hand
)
Reset hand state to default.
function IsHandVisible
bool IsHandVisible(
EControllerHand Hand
) const
True if the hand is currently visible.
function SetHandVisibility
void SetHandVisibility(
EControllerHand Hand,
bool bIsVisible
)
Set the hand visibility.
function IsHandControlled
bool IsHandControlled(
EControllerHand Hand
) const
True if the hand is currently controlled by the user.
function IsAnyHandControlled
bool IsAnyHandControlled() const
True if any hand is currently controlled by the user.
function GetControlledHands
TArray< EControllerHand > GetControlledHands() const
Find all hands that are currently controlled.
function SetHandControlEnabled
bool SetHandControlEnabled(
EControllerHand Hand,
bool bEnabled
)
Enable control of a simulated hand by the user. Returns true if hand control was successfully changed.
function GetTargetHandTransform
void GetTargetHandTransform(
EControllerHand Hand,
FTransform & TargetTransform,
bool & bAnimate
) const
Get the current target transform for a hand. If bAnimate is true then the transform should be blended over time, otherwise the target transform should be applied immediately.
function AddHandInput
void AddHandInput(
EAxis::Type Axis,
float Value
)
Add hand movement or rotation, depending on hand input mode.
function AddHandMovementInput
void AddHandMovementInput(
EAxis::Type TranslationAxis,
float Value
)
Add hand movement input along a local axis to all controlled hands.
function AddHandRotationInput
void AddHandRotationInput(
EAxis::Type RotationAxis,
float Value
)
Add hand rotation input about a local axis to all controlled hands.
function SetDefaultHandLocation
void SetDefaultHandLocation(
EControllerHand Hand
)
Set the mesh for the given hand to the default location.
function SetDefaultHandRotation
void SetDefaultHandRotation(
EControllerHand Hand
)
Set the rotation for the given hand to the rest rotation.
function GetTargetPose
FName GetTargetPose(
EControllerHand Hand
) const
Get the current animation pose of a hand. If the hand is currently controlled by user input it will use the current target pose, otherwise the default pose is used.
function SetTargetPose
void SetTargetPose(
EControllerHand Hand,
FName PoseName
)
Set the target animation pose for a hand.
function ResetTargetPose
void ResetTargetPose(
EControllerHand Hand
)
Reset the default target animation pose for a hand.
function TogglePoseForControlledHands
void TogglePoseForControlledHands(
FName PoseName
)
Toggle the target pose for all currently controlled hands.
- If all hands use the target pose already, all hands will reset to the default pose.
- If any hand does NOT use the target pose already, all hands will use it.
function HasGripToWristTransform
bool HasGripToWristTransform(
EControllerHand Hand
) const
True if grip transform offset has been set.
function GetGripToWristTransform
FTransform GetGripToWristTransform(
EControllerHand Hand
) const
Return: Valid if the grip transform offset has been set.
Get the frozen grip transform offset from the wrist.
function SetGripToWristTransform
void SetGripToWristTransform(
EControllerHand Hand,
const FTransform & GripToWristTransform
)
Set the frozen grip transform offset from the wrist.
function ClearGripToWristTransform
void ClearGripToWristTransform(
EControllerHand Hand
)
Clear the frozen grip transform offset from the wrist.
Public Attributes Documentation
variable HandInputMode
EXRSimulationHandMode FXRSimulationState::HandInputMode
EXRSimulationHandMode HandInputMode = EXRSimulationHandMode::Movement;
If true, input will be interpreted as hand rotation instead of movement.
variable RelativeHeadPosition
FVector FXRSimulationState::RelativeHeadPosition
FVector RelativeHeadPosition = FVector::ZeroVector;
Head position relative to the character controller.
variable RelativeHeadOrientation
FQuat FXRSimulationState::RelativeHeadOrientation
FQuat RelativeHeadOrientation = FQuat::Identity;
Head orientation relative to the character controller.
Updated on 19 August 2021 at 17:42:52 Coordinated Universal Time