void Start() { //audioDirector = GameObject.FindGameObjectWithTag("AudioDirector").GetComponent<AudioDirectorScript>(); bciDataDirector = FindObjectOfType <BCIDataDirector>(); lmcController = new Controller(); if (lmcController == null) { Debug.LogWarning("Cannot connect to controller. Make sure you have Leap Motion v2.0+ installed"); } fingertipsPosArray = new Vector3[5]; debugPosObjects = new GameObject[fingertipsPosArray.Length]; for (int i = 0; i < debugPosObjects.Length; i++) { debugPosObjects[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere); debugPosObjects[i].name = "Debug finger: " + i.ToString(); debugPosObjects[i].transform.parent = transform; debugPosObjects[i].renderer.enabled = false; } meshlinesGenerator = GetComponent <MeshLinesGenerator>(); fingerJointsArrayStitchesPosArray = new Vector3[jointsPerFinger][]; for (int i = 0; i < fingerJointsArrayStitchesPosArray.Length; i++) { fingerJointsArrayStitchesPosArray[i] = new Vector3[meshlinesGenerator.verticesFrequencyDepthCount]; } // internal array to store just joint positions fingersArrayJointsPositionsPosArray = new Vector3[5][]; // 5 because there are 5 fingers for (int i = 0; i < fingersArrayJointsPositionsPosArray.Length; i++) { fingersArrayJointsPositionsPosArray[i] = new Vector3[jointsPerFinger]; } bonesQuaternionsCacheArray = new Quaternion[25]; // 5 bones/joints (counting fingertip) for all 5 fingers bonesWidthsCacheArray = new float[25]; rotGO = new GameObject(); rotGO.name = "LMC bone rot GO"; rotTransform = rotGO.transform; rotTransform.parent = transform.parent; }
void Start() { //audioDirector = GameObject.FindGameObjectWithTag("AudioDirector").GetComponent<AudioDirectorScript>(); bciDataDirector = FindObjectOfType<BCIDataDirector>(); lmcController = new Controller(); if (lmcController == null) Debug.LogWarning("Cannot connect to controller. Make sure you have Leap Motion v2.0+ installed"); fingertipsPosArray = new Vector3[5]; debugPosObjects = new GameObject[fingertipsPosArray.Length]; for (int i = 0; i < debugPosObjects.Length; i++) { debugPosObjects[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere); debugPosObjects[i].name = "Debug finger: " + i.ToString(); debugPosObjects[i].transform.parent = transform; debugPosObjects[i].renderer.enabled = false; } meshlinesGenerator = GetComponent<MeshLinesGenerator>(); fingerJointsArrayStitchesPosArray = new Vector3[jointsPerFinger][]; for (int i = 0; i < fingerJointsArrayStitchesPosArray.Length; i++) { fingerJointsArrayStitchesPosArray[i] = new Vector3[meshlinesGenerator.verticesFrequencyDepthCount]; } // internal array to store just joint positions fingersArrayJointsPositionsPosArray = new Vector3[5][]; // 5 because there are 5 fingers for (int i = 0; i < fingersArrayJointsPositionsPosArray.Length; i++) { fingersArrayJointsPositionsPosArray[i] = new Vector3[jointsPerFinger]; } bonesQuaternionsCacheArray = new Quaternion[25]; // 5 bones/joints (counting fingertip) for all 5 fingers bonesWidthsCacheArray = new float[25]; rotGO = new GameObject(); rotGO.name = "LMC bone rot GO"; rotTransform = rotGO.transform; rotTransform.parent = transform.parent; }
// Use this for initialization void Start() { tempVector = new Vector3(0, 0, 0); lineTransform = transform.GetChild(0); // assuming only child meshlinesGenerator = FindObjectOfType<MeshLinesGenerator>(); }
void Start() { meshlinesGenerator = FindObjectOfType<MeshLinesGenerator>(); }
void Start() { meshlinesGenerator = FindObjectOfType <MeshLinesGenerator>(); }
// Use this for initialization void Start() { tempVector = new Vector3(0, 0, 0); lineTransform = transform.GetChild(0); // assuming only child meshlinesGenerator = FindObjectOfType <MeshLinesGenerator>(); }