Пример #1
0
        public void Initialize(ARBody body)
        {
            m_body             = body;
            m_skeletonMaterial = new Material(Shader.Find("Diffuse"));
            m_cameraConfig     = ARSession.GetCameraConfig();

            for (int i = 0; i < m_maxSkeletonCnt; i++)
            {
                m_skeletonPointObject[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                m_skeletonPointObject[i].transform.localScale = new Vector3(0.08f, 0.08f, 0.08f);
                m_skeletonPointObject[i].SetActive(false);
            }

            for (int i = 0; i < m_maxSkeletonConnectionCnt; i++)
            {
                m_lines[i] = new GameObject("Lines");
                m_lines[i].transform.localScale    = new Vector3(1f, 1f, 1f);
                m_lines[i].transform.position      = new Vector3(0f, 0f, 0f);
                m_lines[i].transform.localPosition = new Vector3(0, 0, 0);
                m_lines[i].SetActive(false);

                m_skeletonConnectionRenderer[i] = m_lines[i].AddComponent <LineRenderer>();
                m_skeletonConnectionRenderer[i].positionCount = 2;
                m_skeletonConnectionRenderer[i].startWidth    = 0.03f;
                m_skeletonConnectionRenderer[i].endWidth      = 0.03f;
            }
            m_skeletonCamera = Camera.main;
            Update();
        }