Пример #1
0
    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;
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     tempVector = new Vector3(0, 0, 0);
     lineTransform = transform.GetChild(0); // assuming only child
     meshlinesGenerator = FindObjectOfType<MeshLinesGenerator>();
 }
Пример #4
0
 void Start()
 {
     meshlinesGenerator = FindObjectOfType<MeshLinesGenerator>();
 }
Пример #5
0
 void Start()
 {
     meshlinesGenerator = FindObjectOfType <MeshLinesGenerator>();
 }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     tempVector         = new Vector3(0, 0, 0);
     lineTransform      = transform.GetChild(0);    // assuming only child
     meshlinesGenerator = FindObjectOfType <MeshLinesGenerator>();
 }