Skip to content

Commit

Permalink
Fix Graphics Toggle & minor changes
Browse files Browse the repository at this point in the history
Fixed the refreshing of the graphics toggle and deleted some commented code.
  • Loading branch information
NiccoloGranieri committed Nov 28, 2017
1 parent 4a2f800 commit 716d287
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 131 deletions.
66 changes: 0 additions & 66 deletions LeapToOSC/Assets/OSC/oscControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,72 +125,6 @@ void Update()
}
}
}
/*
if (leftHand.gameObject.activeSelf == true)
{
Chirality handedness = leftHand.GetComponent<CapsuleHand>().Handedness;
Vector3 palmPosition = leftHand.GetComponent<CapsuleHand>().getPalmPosition();
Vector3 wristPosition = leftHand.GetComponent<CapsuleHand>().getWristPosition();
List<Vector3> fingerPositions = leftHand.GetComponent<CapsuleHand>().getFingerPosition();
for (int i = 0; i <= 19; i += 4 )
{
String thisFinger = fingerName[i / 4];
for (int j = 0; j <= 3; j++)
{
String thisJoint = jointName[j];
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/x", fingerPositions[i + j].x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/y", fingerPositions[i + j].y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/z", fingerPositions[i + j].z);
}
}
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/x", palmPosition.x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/y", palmPosition.y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/z", palmPosition.z);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/x", wristPosition.x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/y", wristPosition.y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/z", wristPosition.z);
}
if (rightHand.gameObject.activeSelf == true)
{
Chirality handedness = rightHand.GetComponent<CapsuleHand>().Handedness;
Vector3 palmPosition = rightHand.GetComponent<CapsuleHand>().getPalmPosition();
Vector3 wristPosition = rightHand.GetComponent<CapsuleHand>().getWristPosition();
List<Vector3> fingerPositions = rightHand.GetComponent<CapsuleHand>().getFingerPosition();
for (int i = 0; i <= 19; i += 4)
{
String thisFinger = fingerName[i / 4];
for (int j = 0; j <= 3; j++)
{
String thisJoint = jointName[j];
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/x", fingerPositions[i + j].x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/y", fingerPositions[i + j].y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + thisFinger + thisJoint + "/z", fingerPositions[i + j].z);
}
}
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/x", palmPosition.x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/y", palmPosition.y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + palmStr + "/z", palmPosition.z);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/x", wristPosition.x);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/y", wristPosition.y);
OSCHandler.Instance.SendMessageToClient("myClient", "/" + handedness + wristStr + "/z", wristPosition.z);
}
*/
}
}
}
11 changes: 4 additions & 7 deletions LeapToOSC/Assets/Scenes/LeapMotion VR OSC.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -327,7 +327,7 @@ MonoBehaviour:
m_GameObject: {fileID: 266907291}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 505ff16e85dc28c47bde395d1a497b34, type: 3}
m_Script: {fileID: 11500000, guid: 6daca3c840821e8499f2aa5e7a631316, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &266907295
Expand Down Expand Up @@ -433,9 +433,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 93df19dc575658944af2f21b9d8d5658, type: 3}
m_Name:
m_EditorClassIdentifier:
hands: {fileID: 0}
leftHand: {fileID: 0}
rightHand: {fileID: 0}
--- !u!1 &482824354
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -459,7 +456,7 @@ RectTransform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 482824354}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -137.5, y: 161, z: 0}
m_LocalPosition: {x: -84, y: 138, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1307296606}
Expand Down Expand Up @@ -693,7 +690,7 @@ RectTransform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1400922037}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 222.5, y: 174, z: 0}
m_LocalPosition: {x: 169, y: 151, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 482824355}
Expand Down
28 changes: 17 additions & 11 deletions LeapToOSC/Assets/UI/backgroundChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@
using System.Collections.Generic;
using UnityEngine;

public class backgroundChange : MonoBehaviour {
public class backgroundChange : MonoBehaviour
{

private Camera cam;


// Use this for initialization
void Start () {
// Use this for initialization
void Start()
{

cam = GetComponent<Camera>();

}

// Update is called once per frame
void Update () {

}

// Update is called once per frame
void Update()
{

if (changeState.Toggle)
{
cam.clearFlags = CameraClearFlags.SolidColor;
} else
cam.cullingMask = -1;
}
else
{
cam.clearFlags = CameraClearFlags.Nothing;
cam.cullingMask = 0;

}

}
}
}
33 changes: 0 additions & 33 deletions LeapToOSC/Assets/UI/backgroundChangeVR.cs

This file was deleted.

13 changes: 0 additions & 13 deletions LeapToOSC/Assets/UI/backgroundChangeVR.cs.meta

This file was deleted.

8 changes: 7 additions & 1 deletion LeapToOSC/ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 0
path: Assets/Scenes/LeapMotion Desktop OSC.unity
guid: ddce5a73513939c4fb26a4ed551ff537
- enabled: 1
path: Assets/Scenes/LeapMotion VR OSC.unity
guid: d586a7c9acfb5554d90f8960c387c2be

0 comments on commit 716d287

Please sign in to comment.