Skip to content

Commit 2929392

Browse files
added fidget spinner folder.
1 parent 0985856 commit 2929392

File tree

838 files changed

+31620
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

838 files changed

+31620
-305
lines changed

Assembly-CSharp.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@
174174
<Compile Include="Assets\LeapMotionCoreAssets-develop\Assets\OVR\Scripts\Util\OVRSceneSampleController.cs" />
175175
<Compile Include="Assets\LeapMotionCoreAssets-develop\Assets\OVR\Scripts\Util\OVRScreenFade.cs" />
176176
<Compile Include="Assets\LeapMotionCoreAssets-develop\Assets\OVR\Scripts\Util\OVRTrackerBounds.cs" />
177+
<Compile Include="Assets\SetOffset.cs" />
178+
<Compile Include="Assets\fidgetSTUFF\HandControlMobile.cs" />
177179
<None Include="Assets\LeapMotionCoreAssets-develop\Assets\Plugins\donotdelete.txt" />
178180
<None Include="Assets\LeapMotionCoreAssets-develop\Assets\LeapMotion\Materials\Sources\Shaders\Toony-Basic.shader" />
179181
<None Include="Assets\LeapMotionCoreAssets-develop\Assets\LeapMotion\Resources\LeapCG.cginc" />

Assets/HandControl.cs

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class HandControl : MonoBehaviour {
1010

1111
private static int localPort;
1212

13-
//private string IP = "10.0.0.37"; //cell
14-
private string IP = "127.0.0.1"; //home
13+
private string IP = "10.0.0.37"; //cell
14+
//private string IP = "127.0.0.1"; //home
1515

1616
private int port = 1999;
1717

@@ -20,15 +20,41 @@ public class HandControl : MonoBehaviour {
2020

2121
private string strMessage;
2222

23+
public static Vector3 offSetLeft = Vector3.zero;
24+
public static Vector3 offSetRight = Vector3.zero;
25+
2326
// Use this for initialization
2427
void Start () {
2528

29+
Application.runInBackground = true;
30+
2631
remoteEndPoint = new IPEndPoint(IPAddress.Parse(IP), port);
2732
client = new UdpClient();
2833

34+
//load saved offset data
35+
if (PlayerPrefs.HasKey ("offsetLeftX")) {
36+
offSetLeft = new Vector3(PlayerPrefs.GetFloat("offsetLeftX"),PlayerPrefs.GetFloat("offsetLeftY"),PlayerPrefs.GetFloat("offsetLeftZ"));
37+
}
38+
if (PlayerPrefs.HasKey ("offsetRightX")) {
39+
offSetRight = new Vector3(PlayerPrefs.GetFloat("offsetRightX"),PlayerPrefs.GetFloat("offsetRightY"),PlayerPrefs.GetFloat("offsetRightZ"));
40+
}
41+
2942
StartCoroutine (SendData ());
3043
}
3144

45+
void OnApplicationQuit()
46+
{
47+
//save offset x
48+
PlayerPrefs.SetFloat ("offsetLeftX", offSetLeft.x);
49+
PlayerPrefs.SetFloat ("offsetLeftY", offSetLeft.y);
50+
PlayerPrefs.SetFloat ("offsetLeftZ", offSetLeft.z);
51+
52+
//save offset y
53+
PlayerPrefs.SetFloat ("offsetRightX", offSetRight.x);
54+
PlayerPrefs.SetFloat ("offsetRightY", offSetRight.y);
55+
PlayerPrefs.SetFloat ("offsetRightZ", offSetRight.z);
56+
}
57+
3258
IEnumerator SendData(){
3359

3460
while (true) {
@@ -39,12 +65,16 @@ IEnumerator SendData(){
3965

4066
if (transform.Find ("Left(Clone)") != null) {
4167
Transform leftHand = transform.Find ("Left(Clone)").transform.GetChild(1);
68+
69+
Vector3 leftHandPosition = leftHand.position + offSetLeft;
4270
//add comma so we can split by string when we recieve
43-
strMessage += "l," + leftHand.position.ToString() + "," + leftHand.rotation.ToString() + ",";
71+
strMessage += "l," + leftHandPosition.ToString() + "," + leftHand.rotation.ToString() + ",";
4472
}
4573
if (transform.Find ("Right(Clone)") != null) {
4674
Transform rightHand = transform.Find ("Right(Clone)").transform.GetChild(1);
47-
strMessage += "r," + rightHand.position.ToString() + "," + rightHand.rotation.ToString() + ",";
75+
76+
Vector3 rightHandPosition = rightHand.position + offSetRight;
77+
strMessage += "r," + rightHandPosition.ToString() + "," + rightHand.rotation.ToString() + ",";
4878
}
4979

5080
} else {

Assets/Materials.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4.91 KB
Binary file not shown.

Assets/Materials/group_14093196Mat.mat.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4.91 KB
Binary file not shown.

Assets/Materials/group_2829873Mat.mat.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4.91 KB
Binary file not shown.

Assets/Materials/group_6383466Mat.mat.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SetOffset.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class SetOffset : MonoBehaviour {
6+
7+
public void IncrementLeftX(){
8+
HandControl.offSetLeft.x += .1f;
9+
}
10+
11+
public void DecrementLeftX(){
12+
HandControl.offSetLeft.x -= .1f;
13+
}
14+
public void IncrementLeftY(){
15+
HandControl.offSetLeft.y += .1f;
16+
}
17+
18+
public void DecrementLeftY(){
19+
HandControl.offSetLeft.y -= .1f;
20+
}
21+
public void IncrementLeftZ(){
22+
HandControl.offSetLeft.z += .1f;
23+
}
24+
25+
public void DecrementLeftZ(){
26+
HandControl.offSetLeft.z -= .1f;
27+
}
28+
public void IncrementRightX(){
29+
HandControl.offSetRight.x += .1f;
30+
}
31+
32+
public void DecrementRightX(){
33+
HandControl.offSetRight.x -= .1f;
34+
}
35+
public void IncrementRightY(){
36+
HandControl.offSetRight.y += .1f;
37+
}
38+
39+
public void DecrementRightY(){
40+
HandControl.offSetRight.y -= .1f;
41+
}
42+
public void IncrementRightZ(){
43+
HandControl.offSetRight.z += .1f;
44+
}
45+
46+
public void DecrementRightZ(){
47+
HandControl.offSetRight.z -= .1f;
48+
}
49+
}

0 commit comments

Comments
 (0)