Humanoid Control for Unity v4
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Passer.Humanoid.HeadTarget Class Reference

Description

Humanoid Control options for head-related things

%Sensors

Depending on the selected Inputs in HumanoidControl, a number of controllers are available for the Head Target. These can be individually enabled or disabled to suit your needs. For example you can disable head tracking using Kinect while still have body tracking on other parts of the body.

See the list of supported devices to get information on the head target of each device.

Sub Targets (Pro)

Sub targets are used in combination with facial tracking. Depending on the tracking device, additional facial target can be tracked and used. When the microphone has been enabled, the Audio Energy will show the received volume of sound.

Configuration (Pro)

Configuration is used in combination with facial tracking.

Expressions (Pro)

In Humanoid Control Pro, facial expressions can be defined and set. For more information see Facial Expressions.

Focus Object (Pro)

This is the object the humanoid is looking at. With eye tracking, this is determined from the detected gaze direction, without eye tracking a raycast from the eyes is used in the forward direction of the head.

Settings

Events

Buttons

Inheritance diagram for Passer.Humanoid.HeadTarget:
Passer.Humanoid.HumanoidTarget Passer.Target

Public Types

enum  InteractionType { None , Gazing }
 

Public Member Functions

override void InitSensors ()
 
override void StartSensors ()
 
void TurnTo (GameObject obj)
 
void TurnTo (GameObject obj, float confidence)
 
void LookTo (Vector3 position)
 
void TurnTo (Vector3 position, float confidence)
 
void SetLookDirection (Vector3 direction, float confidence)
 
override Transform GetDefaultTarget (HumanoidControl humanoid)
 
void RetrieveBones ()
 
override void InitAvatar ()
 
override void NewComponent (HumanoidControl _humanoid)
 
override void InitComponent ()
 
override void StartTarget ()
 
override void MatchTargetsToAvatar ()
 
override void InitializeTrackingConfidence ()
 Sets the tracking confidence before all tracking information is updated More...
 
override void UpdateTarget ()
 Update all head sensors More...
 
override void UpdateMovements (HumanoidControl humanoid)
 Updates the avatar bones based on the current target rig More...
 
override void CopyTargetToRig ()
 Copy the head target to the target rig More...
 
override void CopyRigToTarget ()
 Copy the target rig head bone to the head target More...
 
void UpdateSensorsFromTarget ()
 Update the sensor locations based on the head target
 
void RotationX (float angle)
 Sets the rotation of the head around the X axis
 
void RotationY (float angle)
 Sets the rotation of the head around the Y axis
 
Vector3 GetEyePosition ()
 Gets the eye position in world coordinates
 
Vector3 GetNeckEyeDelta ()
 Gets the local eye position relative to the neck bone
 
Vector3 GetHeadEyeDelta ()
 Gets the local eye position realtive to the head bone
 
Vector3 GetNeckHeadDelta ()
 Gets the local head position relative to the neck bone
 
void DisableVR ()
 
void EnableVR ()
 
void OnDrawGizmos ()
 
void OnDrawGizmosSelected ()
 
virtual void DrawTensions ()
 
virtual void StopSensors ()
 

Static Public Member Functions

static HeadTarget CreateTarget (HumanoidTarget oldTarget)
 
static HeadTarget SetTarget (HumanoidControl humanoid, Transform targetTransform)
 
static void GetDefaultNeck (Animator rig, ref Transform boneTransform)
 
static void GetDefaultHead (Animator rig, ref Transform boneTransform)
 
static void ClearBones (HeadTarget headTarget)
 
static bool IsInitialized (HumanoidControl humanoid)
 Is the head target initialized?
 
static void DetermineTarget (HumanoidControl humanoid)
 Checks whether the humanoid has an HeadTargetand adds one if none has been found More...
 
static Quaternion GetRotationAround (Vector3 axis, Quaternion rotation)
 
static Quaternion Normalize (Quaternion q)
 
static void GetSwingTwist (Vector3 axis, Quaternion rotation, out Quaternion swing, out Quaternion twist)
 
static SkinnedMeshRenderer[] FindAvatarMeshes (HumanoidControl humanoid)
 
static string[] DistillAvatarMeshNames (SkinnedMeshRenderer[] meshes)
 
static int FindMeshWithBlendshapes (SkinnedMeshRenderer[] renderers)
 
static int FindBlendshapemesh (SkinnedMeshRenderer[] renderers, SkinnedMeshRenderer renderer)
 
static string[] GetBlendshapes (SkinnedMeshRenderer renderer)
 
static void FindBlendshapeWith (string[] blendshapes, string namepart1, string namepart2, ref int blendshape)
 
static Vector ToVector (Vector3 vector3)
 
static Vector3 ToVector3 (Vector position)
 
static Rotation ToRotation (Quaternion quaternion)
 
static Quaternion ToQuaternion (Rotation orientation)
 
static void SetRotation (Transform transform, Rotation orientation)
 
static void DrawTarget (Confidence confidence, Transform target, Vector3 direction, float length)
 
static void DrawTargetBone (TargetedBone bone, Vector3 direction)
 
static void DrawTargetBone (TargetTransform target, Vector3 direction)
 
static void DrawAvatarBone (TargetedBone bone, Vector3 direction)
 
static void DrawAvatarBone (BoneTransform bone, Vector3 direction)
 
static void GetDefaultBone (Animator rig, ref Transform boneTransform, Bone boneId, params string[] boneNames)
 
static void GetDefaultBone (Animator rig, ref Transform boneTransform, HumanBodyBones boneID, params string[] boneNames)
 
static void GetDefaultBone (Animator rig, ref Transform boneTransform, params string[] boneNames)
 
static void GetDefaultTargetBone (Animator rig, ref Transform boneTransform, Bone boneID, params string[] boneNames)
 
static List< Collider > SetColliderToTrigger (GameObject obj)
 
static List< Collider > SetColliderToTrigger (Rigidbody rb)
 
static void UnsetColliderToTrigger (List< Collider > colliders)
 
static void UnsetColliderToTrigger (List< Collider > colliders, Collider collider)
 

Public Attributes

bool tracking
 Is the Head Target updated using an active tracking device
 
Passer.Tracking.UnityXRHmd unity
 
HeadAnimator headAnimator = new HeadAnimator()
 Controls the head when no tracking is active
 
UnityXRHead unityXR = new UnityXRHead()
 
ViveTrackerHead viveTracker = new ViveTrackerHead()
 
WindowsMRHead mixedReality = new WindowsMRHead()
 
WaveVRHead waveVR = new WaveVRHead()
 
Kinect1Head kinect1 = new Kinect1Head()
 
Kinect2Head kinect2 = new Kinect2Head()
 
Kinect4Head kinect4 = new Kinect4Head()
 
AstraHead astra = new AstraHead()
 
IntelRealsenseHead realsense = new IntelRealsenseHead()
 
OptitrackHead optitrack = new OptitrackHead()
 
AntilatencyHead antilatency = new AntilatencyHead()
 
CustomHead custom = new CustomHead()
 
MicrophoneHead microphone = new MicrophoneHead()
 
Kinect2Face kinectFace
 
TobiiHead tobiiHead = new TobiiHead()
 
ArKitHead arkit = new ArKitHead()
 
Tracking.Pupil.Head pupil = new Tracking.Pupil.Head()
 
DlibHead dlib = new DlibHead()
 
HeadSensor[] sensors
 
TargetedHeadBone head = null
 
TargetedNeckBone neck = null
 
FaceTarget face = null
 
float audioEnergy
 
Vector3 lookDirection = Vector3.forward
 
Vector3 localLookDirection = Vector3.forward
 
Vector3 neck2eyes
 
Vector3 head2eyes
 
bool collisionFader = false
 Adds a screen fader which blacks out the camera when the head enters objects.
 
bool isInsideCollider = false
 
bool virtual3d = false
 
Transform screenTransform
 
BoolEventHandlers trackingEvent
 Use to call functions based on the tracking status of the headset. More...
 
FloatEventHandlers audioEvent
 Use to call functions based on the audio level measured with the microphone. More...
 
GameObjectEventHandlers focusEvent
 Use to call functions based on the object in focus More...
 
BoolEventHandlers blinkEvent
 Use to call functions based on eye blinking More...
 
BoolEventHandlers insideColliderEvent
 Use to call functions based on the state of the head being inside colliders. More...
 
SkinnedMeshRenderer smRenderer
 
Rigidbody headRigidbody
 
HeadMovements headMovements = new HeadMovements()
 
HumanoidControl humanoid
 

Static Public Attributes

const float maxNeckAngle = 80
 
const float maxHeadAngle = 50
 
static readonly float neckTurnRatio = 0.65F
 
static readonly Vector3 minHeadAngles = new Vector3(0, 0, 0)
 
static readonly Vector3 maxHeadAngles = new Vector3(0, 0, 0)
 
static readonly Vector3 minNeckAngles = new Vector3(-55, -70, -35)
 
static readonly Vector3 maxNeckAngles = new Vector3(80, 70, 35)
 
static readonly Vector minNeckAngles2 = new Vector(-55, -70, 0)
 
static readonly Vector maxNeckAngles2 = new Vector(80, 70, 0)
 

Protected Member Functions

override void UpdateSensors ()
 
virtual void UpdateEvents ()
 
override void DrawTargetRig (HumanoidControl humanoid)
 Draw the target rig More...
 
override void DrawAvatarRig (HumanoidControl humanoid)
 Draw the avatar rig More...
 
virtual void DrawTensionGizmo (TargetedBone targetedBone)
 

Protected Attributes

bool _showRealObjects = true
 

Properties

override Passer.Sensor animator [get]
 
override TargetedBone main [get]
 
virtual bool showRealObjects [getset]
 show the target meshes
 

Member Function Documentation

◆ InitSensors()

override void Passer.Humanoid.HeadTarget.InitSensors ( )
virtual

Implements Passer.Target.

◆ StartSensors()

override void Passer.Humanoid.HeadTarget.StartSensors ( )
virtual

Reimplemented from Passer.Target.

◆ UpdateSensors()

override void Passer.Humanoid.HeadTarget.UpdateSensors ( )
protectedvirtual

Reimplemented from Passer.Target.

◆ GetDefaultTarget()

override Transform Passer.Humanoid.HeadTarget.GetDefaultTarget ( HumanoidControl  humanoid)
virtual

◆ InitAvatar()

override void Passer.Humanoid.HeadTarget.InitAvatar ( )
virtual

◆ NewComponent()

override void Passer.Humanoid.HeadTarget.NewComponent ( HumanoidControl  _humanoid)
virtual

Reimplemented from Passer.Humanoid.HumanoidTarget.

◆ InitComponent()

override void Passer.Humanoid.HeadTarget.InitComponent ( )
virtual

Reimplemented from Passer.Target.

◆ StartTarget()

override void Passer.Humanoid.HeadTarget.StartTarget ( )
virtual

Implements Passer.Target.

◆ DetermineTarget()

static void Passer.Humanoid.HeadTarget.DetermineTarget ( HumanoidControl  humanoid)
static

Checks whether the humanoid has an HeadTargetand adds one if none has been found

Parameters
humanoidThe humanoid to check

◆ MatchTargetsToAvatar()

override void Passer.Humanoid.HeadTarget.MatchTargetsToAvatar ( )
virtual

◆ InitializeTrackingConfidence()

override void Passer.Humanoid.HeadTarget.InitializeTrackingConfidence ( )
virtual

Sets the tracking confidence before all tracking information is updated

Implements Passer.Target.

◆ UpdateTarget()

override void Passer.Humanoid.HeadTarget.UpdateTarget ( )
virtual

Update all head sensors

Implements Passer.Target.

◆ UpdateMovements()

override void Passer.Humanoid.HeadTarget.UpdateMovements ( HumanoidControl  humanoid)
virtual

Updates the avatar bones based on the current target rig

Implements Passer.Humanoid.HumanoidTarget.

◆ CopyTargetToRig()

override void Passer.Humanoid.HeadTarget.CopyTargetToRig ( )
virtual

Copy the head target to the target rig

Implements Passer.Humanoid.HumanoidTarget.

◆ CopyRigToTarget()

override void Passer.Humanoid.HeadTarget.CopyRigToTarget ( )
virtual

Copy the target rig head bone to the head target

Implements Passer.Humanoid.HumanoidTarget.

◆ DrawTargetRig()

override void Passer.Humanoid.HeadTarget.DrawTargetRig ( HumanoidControl  humanoid)
protectedvirtual

Draw the target rig

Reimplemented from Passer.Humanoid.HumanoidTarget.

◆ DrawAvatarRig()

override void Passer.Humanoid.HeadTarget.DrawAvatarRig ( HumanoidControl  humanoid)
protectedvirtual

Draw the avatar rig

Reimplemented from Passer.Humanoid.HumanoidTarget.

Member Data Documentation

◆ trackingEvent

BoolEventHandlers Passer.Humanoid.HeadTarget.trackingEvent
Initial value:
= new BoolEventHandlers() {
id = 1,
label = "Tracking Event",
tooltip =
"Call functions using the HMD tracking status\n" +
"Parameter: HMD tracking",
eventTypeLabels = new string[] {
"Never",
"On Tracking Start",
"On Tracking Stop",
"While Tracking",
"While not Tracking",
"On Tracking Changes",
"Always",
},
fromEventLabel = "tracking",
}

Use to call functions based on the tracking status of the headset.

◆ audioEvent

FloatEventHandlers Passer.Humanoid.HeadTarget.audioEvent
Initial value:
= new FloatEventHandlers() {
id = 2,
label = "Audio Event",
tooltip =
"Call functions based on the microphone audio level\n" +
"Parameter: the audio level",
eventTypeLabels = new string[] {
"Never",
"On Loud Start",
"On Silence Start",
"While Noisy",
"While Silent",
"On Level Changes",
"Always",
},
fromEventLabel = "audioEnergy",
}

Use to call functions based on the audio level measured with the microphone.

◆ focusEvent

GameObjectEventHandlers Passer.Humanoid.HeadTarget.focusEvent
Initial value:
= new GameObjectEventHandlers() {
id = 3,
label = "Focus Event",
tooltip =
"Call functions using the focus\n" +
"Parameter: the focus object",
eventTypeLabels = new string[] {
"Never",
"On Focus Start",
"On Focus End",
"While Focusing",
"While Nothing in Focus",
"On Focus Changes",
"Always",
},
fromEventLabel = "Focus Object",
}

Use to call functions based on the object in focus

◆ blinkEvent

BoolEventHandlers Passer.Humanoid.HeadTarget.blinkEvent
Initial value:
= new BoolEventHandlers() {
id = 4,
label = "Blink Event",
tooltip =
"Call functions using blinking\n" +
"Parameter: the blinking state",
eventTypeLabels = new string[] {
"Never",
"On Blink Starts",
"On Blink Ends",
"While Eyes Closed",
"While Eyes Open",
"On Blink Starts or Ends",
"Always",
},
fromEventLabel = "Eyes Closed",
}

Use to call functions based on eye blinking

◆ insideColliderEvent

BoolEventHandlers Passer.Humanoid.HeadTarget.insideColliderEvent
Initial value:
= new BoolEventHandlers() {
id = 5,
label = "In Collider Event",
tooltip =
"Call functions using the head being inside Colliders\n" +
"Parameter: isInsideCollider state",
eventTypeLabels = new string[] {
"Never",
"When Head Enters Collider",
"When Head Exits Collider",
"While Head is inside Collider",
"While Head outside Collider",
"When Enters/Exists Collider",
"Always",
},
fromEventLabel = "Inside Collider",
}

Use to call functions based on the state of the head being inside colliders.


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