Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Inverse Hand Position
Browse files Browse the repository at this point in the history
  • Loading branch information
ReiiYuki committed Jul 10, 2017
1 parent 198d6c3 commit 38937bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Assets/Example/Scenes/Hand Control Example.unity
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f12be339cb6d39346b02224594b6c0f9, type: 3}
m_Name:
m_EditorClassIdentifier:
sign: 1
9 changes: 5 additions & 4 deletions Assets/IRToolkit/Scripts/HandPositionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ enum State

HandManager handManager;
State leftHandState, rightHandState;
public int sign = 1;

// Update is called once per frame
void Update () {
// Update is called once per frame
void Update () {
UpdateHandPosition();
}

Expand All @@ -36,12 +37,12 @@ void UpdateHandPosition()
{
if (hand.BodySide == BodySideType.BODY_SIDE_LEFT)
{
Boardcast("OnLeftHandChange", new Vector3(hand.MassCenterWorld.x, hand.MassCenterWorld.y, hand.MassCenterWorld.z));
Boardcast("OnLeftHandChange", new Vector3(hand.MassCenterWorld.x* sign, hand.MassCenterWorld.y , hand.MassCenterWorld.z ));
isLeftAppear = State.Appear;
}
else if (hand.BodySide == BodySideType.BODY_SIDE_RIGHT)
{
Boardcast("OnRightHandChange", new Vector3(hand.MassCenterWorld.x, hand.MassCenterWorld.y, hand.MassCenterWorld.z));
Boardcast("OnRightHandChange", new Vector3(hand.MassCenterWorld.x * sign, hand.MassCenterWorld.y , hand.MassCenterWorld.z ));
isRightAppear = State.Appear;
}
}
Expand Down

0 comments on commit 38937bd

Please sign in to comment.