Skip to content

Commit

Permalink
ArmIK usage
Browse files Browse the repository at this point in the history
Elbows tracking
Tracking without VR controllers
  • Loading branch information
SDraw committed Oct 17, 2022
1 parent 3b33dc0 commit 7fcfb04
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 122 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Merged set of MelonLoader mods for ChilloutVR.
| Desktop Head Tracking | ml_dht | 1.0.6 | Yes | Working |
| Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working |
| Four Point Tracking | ml_fpt | 1.0.8 | Yes | Working |
| Leap Motion Extension | ml_lme | 1.2.2 | On review | Working |
| Leap Motion Extension | ml_lme | 1.2.3 | On review | Working |
| Server Connection Info | ml_sci | 1.0.2 | Yes | Working |
10 changes: 10 additions & 0 deletions ml_lme/GestureMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class GesturesData
public bool[] m_handsPresenses = null;
public Vector3[] m_handsPositons = null;
public Quaternion[] m_handsRotations = null;
public Vector3[] m_elbowPositions = null;
public float[] m_leftFingersBends = null;
public float[] m_leftFingersSpreads = null;
public float[] m_rightFingersBends = null;
Expand All @@ -32,6 +33,7 @@ public GesturesData()
m_handsPresenses = new bool[ms_handsCount];
m_handsPositons = new Vector3[ms_handsCount];
m_handsRotations = new Quaternion[ms_handsCount];
m_elbowPositions = new Vector3[ms_handsCount];
m_leftFingersBends = new float[ms_fingersCount];
m_leftFingersSpreads = new float[ms_fingersCount];
m_rightFingersBends = new float[ms_fingersCount];
Expand Down Expand Up @@ -61,6 +63,7 @@ public static void GetGestures(Leap.Frame p_frame, ref GesturesData p_data)
p_data.m_handsPresenses[l_sideID] = true;
FillHandPosition(l_hand, ref p_data.m_handsPositons[l_sideID]);
FillHandRotation(l_hand, ref p_data.m_handsRotations[l_sideID]);
FillElbowPosition(l_hand, ref p_data.m_elbowPositions[l_sideID]);
switch(l_sideID)
{
case 0:
Expand Down Expand Up @@ -96,6 +99,13 @@ static void FillHandRotation(Leap.Hand p_hand, ref Quaternion p_rot)
p_rot.w = p_hand.Rotation.w;
}

static void FillElbowPosition(Leap.Hand p_hand, ref Vector3 p_pos)
{
p_pos.x = p_hand.Arm.ElbowPosition.x;
p_pos.y = p_hand.Arm.ElbowPosition.y;
p_pos.z = p_hand.Arm.ElbowPosition.z;
}

static void FillFingerBends(Leap.Hand p_hand, ref float[] p_bends)
{
foreach(Leap.Finger l_finger in p_hand.Fingers)
Expand Down
66 changes: 0 additions & 66 deletions ml_lme/LeapIK.cs

This file was deleted.

Loading

0 comments on commit 7fcfb04

Please sign in to comment.