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.CustomArm Class Reference

Description

A custom sensor used on the arm of a humanoid.

This tracking option supports a custom developed ControllerComponent or HandSkeleton for the hand and/or arm.

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

Public Types

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

Public Member Functions

override void SetSensor2Target ()
 Updates the arm targets based on the current sensor position and rotation.
 
override void UpdateSensorTransformFromTarget (Transform _)
 Updates the sensor position and rotation based on the current position of the arm targets.
 
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

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]
 The name of this sensor.
 
override HumanoidTracker tracker [get]
 THe tracker for this sensor.
 
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

◆ UpdateSensorTransformFromTarget()

override void Passer.Humanoid.CustomArm.UpdateSensorTransformFromTarget ( Transform  _)

Updates the sensor position and rotation based on the current position of the arm targets.

Parameters
_Not used

◆ Start()

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

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 ( )
virtual

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)
protectedvirtual

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 ( )
protected

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: