Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Passer.Humanoid.ViveTrackerArm Class Reference

Description

Vive Tracker used on the leg of a Humanoid

Unity Inspector

Vive Trackers can be placed on different bones on the arm. This makes it possible to combine a SteamVR controller with a Vive Tracker on the arm to improve the Inverse Kinematics solution. The bone on which the tracker in mounted should be set using the Bone parameter. It is not possible to have both a UnityXR controller and a Vive Tracker on the hand.

Inheritance diagram for Passer.Humanoid.ViveTrackerArm:
Passer.Humanoid.CustomArm

Public Types

enum  ID {
  Head , LeftHand , RightHand , Hips ,
  LeftFoot , RightFoot , Tracker1 , Tracker2 ,
  Tracker3 , Tracker4 , Count
}
 

Public Member Functions

override void CheckSensor (HandTarget handTarget)
 
override void SetSensor2Target ()
 
override void UpdateSensorTransformFromTarget (Transform _)
 
override void Start (HumanoidControl _humanoid, Transform targetTransform)
 Prepares the arm for tracking with the tracked controller and/or skeleton.
 
override void Update ()
 Updates the arm target based on the status of the tracked controller and/or skeleton.
 

Static Public Member Functions

static Rotation CalculateUpperArmOrientation (Vector upperArmPosition, float upperArmLength, Vector forearmUp, float forearmLength, Vector handPosition, bool isLeft)
 
static Rotation CalculateArmOrientation (Vector joint1Position, Vector joint1Up, Vector joint2Position, bool isLeft)
 
static Rotation CalculateBoneRotation (Vector bonePosition, Vector parentBonePosition, Vector upDirection)
 

Public Attributes

ArmBones attachedBone = ArmBones.Hand
 The bone on the arm controlled by the sensor.
 
bool isLeft
 
TargetData shoulder
 
TargetData upperArm
 
TargetData forearm
 
TargetData hand
 
Finger thumb
 
Finger indexFinger
 
Finger middleFinger
 
Finger ringFinger
 
Finger littleFinger
 
Finger[] fingers
 
DeviceView device
 The device to which the sensor belongs.
 
Tracker.Status status = Tracker.Status.Unavailable
 Status of the sensor.
 

Protected Member Functions

HumanoidTarget.TargetedBone GetTargetBone ()
 
override void CreateSensorTransform ()
 
void UpdateControllerInput ()
 Updates the Controller Input for this side.
 
virtual void UpdateControllerInput (ControllerSide controllerSide)
 Updates one side of the ControllerInput from the values of the tracked ControllerComponent.
 
override void UpdateHandFromSkeleton ()
 This function uses the tracked HandSkeleton to update the pose of the hand.
 
virtual void UpdateHand ()
 
void UpdateSensor ()
 

Protected Attributes

ControllerComponent controllerComponent
 The tracker controller to use for this arm.
 
Controller controllerInput
 The controller input for this humanoid.
 
Vector _localSensorPosition
 
Rotation _localSensorRotation
 
Vector _sensorPosition
 
Rotation _sensorRotation
 
float _positionConfidence
 Tracking confidence.
 
float _rotationConfidence
 
Vector _sensor2TargetPosition = Vector.zero
 The position of the tracker relative to the origin of the object it is tracking.
 
Rotation _sensor2TargetRotation = Rotation.identity
 

Properties

override string name [get]
 
override HumanoidTracker tracker [get]
 
ViveTrackerComponent viveTracker [get]
 
Vector localSensorPosition [get]
 
Rotation localSensorRotation [get]
 
Vector sensorPosition [get]
 
Rotation sensorRotation [get]
 
float positionConfidence [get]
 
float rotationConfidence [get]
 
Vector sensor2TargetPosition [get, set]
 
Rotation sensor2TargetRotation [get, set]
 

Member Function Documentation

◆ Start()

override void Passer.Humanoid.CustomArm.Start ( HumanoidControl  _humanoid,
Transform  targetTransform 
)
inherited

Prepares the arm for tracking with the tracked controller and/or skeleton.

Parameters
_humanoidThe humanoid for which this arm is tracked
targetTransformThe transform of the hand target

This will find and initialize the controllerInput for the given humanoid. It will initialize the sensor2TargetPosition and sensor2TargetRotation values. It will determine whether the sensor should be shown and rendered. It will start the tracking for the controller and/or hand skeleton.

◆ Update()

override void Passer.Humanoid.CustomArm.Update ( )
virtualinherited

Updates the arm target based on the status of the tracked controller and/or skeleton.

Reimplemented from Passer.Humanoid.Tracking.Sensor.

◆ UpdateControllerInput()

virtual void Passer.Humanoid.CustomArm.UpdateControllerInput ( ControllerSide  controllerSide)
protectedvirtualinherited

Updates one side of the ControllerInput from the values of the tracked ControllerComponent.

Parameters
controllerSideThe controller side to update

This function does nothing when the controller is not available or not tracking.

◆ UpdateHandFromSkeleton()

override void Passer.Humanoid.CustomArm.UpdateHandFromSkeleton ( )
protectedinherited

This function uses the tracked HandSkeleton to update the pose of the hand.

This function does nothing when the hand skeleton is not available or not tracking.


The documentation for this class was generated from the following file: