Humanoid Control for Unity  v3
Passer.Humanoid.HeadTarget Class Reference

Humanoid Control options for head-related stuff More...

Inherits Passer.Humanoid.HumanoidTarget.

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 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 More...
 
void RotationX (float angle)
 Sets the rotation of the head around the X axis More...
 
void RotationY (float angle)
 Sets the rotation of the head around the Y axis More...
 
Vector3 GetEyePosition ()
 Gets the eye position in world coordinates More...
 
Vector3 GetNeckEyeDelta ()
 Gets the local eye position relative to the neck bone More...
 
Vector3 GetHeadEyeDelta ()
 Gets the local eye position realtive to the head bone More...
 
Vector3 GetNeckHeadDelta ()
 Gets the local head position relative to the neck bone More...
 
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? More...
 
static void DetermineTarget (HumanoidControl humanoid)
 Checks whether the humanoid has an HeadTargetand adds one if none has been found More...
 
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 More...
 
Passer.Tracking.UnityXRHmd unity
 
UnityVRHead unity = new UnityVRHead()
 
HeadAnimator headAnimator = new HeadAnimator()
 
OpenVRHead openVR = new OpenVRHead()
 
ViveTrackerHead viveTracker = new ViveTrackerHead()
 
OculusHead oculus = new OculusHead()
 
WindowsMRHead mixedReality = new WindowsMRHead()
 
WaveVRHead waveVR = new WaveVRHead()
 
VrtkHead vrtk = new VrtkHead()
 
PerceptionNeuronHead neuron = new PerceptionNeuronHead()
 
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()
 
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
 
bool isInsideCollider = false
 
bool virtual3d = false
 
Transform screenTransform
 
BoolEventHandlers trackingEvent
 
FloatEventHandlers audioEvent
 
GameObjectEventHandlers focusEvent
 
BoolEventHandlers blinkEvent
 
BoolEventHandlers insideColliderEvent
 
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 [get, set]
 show the target meshes More...
 

Detailed Description

Humanoid Control options for head-related stuff

More information on the Humanoid Control Head Target Component click

Member Function Documentation

◆ IsInitialized()

static bool Passer.Humanoid.HeadTarget.IsInitialized ( HumanoidControl  humanoid)
static

Is the head target initialized?

◆ 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

◆ UpdateTarget()

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

Update all head sensors

Implements Passer.Target.

◆ UpdateMovements()

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

Updates the avatar bones based on the current target rig

◆ CopyTargetToRig()

override void Passer.Humanoid.HeadTarget.CopyTargetToRig ( )

Copy the head target to the target rig

◆ CopyRigToTarget()

override void Passer.Humanoid.HeadTarget.CopyRigToTarget ( )

Copy the target rig head bone to the head target

◆ UpdateSensorsFromTarget()

void Passer.Humanoid.HeadTarget.UpdateSensorsFromTarget ( )

Update the sensor locations based on the head target

◆ DrawTargetRig()

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

Draw the target rig

◆ DrawAvatarRig()

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

Draw the avatar rig

◆ RotationX()

void Passer.Humanoid.HeadTarget.RotationX ( float  angle)

Sets the rotation of the head around the X axis

◆ RotationY()

void Passer.Humanoid.HeadTarget.RotationY ( float  angle)

Sets the rotation of the head around the Y axis

◆ GetEyePosition()

Vector3 Passer.Humanoid.HeadTarget.GetEyePosition ( )

Gets the eye position in world coordinates

◆ GetNeckEyeDelta()

Vector3 Passer.Humanoid.HeadTarget.GetNeckEyeDelta ( )

Gets the local eye position relative to the neck bone

◆ GetHeadEyeDelta()

Vector3 Passer.Humanoid.HeadTarget.GetHeadEyeDelta ( )

Gets the local eye position realtive to the head bone

◆ GetNeckHeadDelta()

Vector3 Passer.Humanoid.HeadTarget.GetNeckHeadDelta ( )

Gets the local head position relative to the neck bone

Member Data Documentation

◆ tracking

bool Passer.Humanoid.HeadTarget.tracking

Is the Head Target updated using an active tracking device

◆ 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",
}

◆ 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",
}

◆ 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",
}

◆ 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",
}

◆ 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",
}

Property Documentation

◆ showRealObjects

virtual bool Passer.Target.showRealObjects
getsetinherited

show the target meshes


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