示例#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();
        }
示例#2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        ARCameraConfig config = (ARCameraConfig)target;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("SimSlamViewPort", new GUILayoutOption[] { GUILayout.Width(200), GUILayout.Height(100) }))
        {
            config.ToSlamViewPort();
        }

        GUILayout.BeginVertical();

        if (GUILayout.Button("H Tag", new GUILayoutOption[] { GUILayout.Width(100), GUILayout.Height(50) }))
        {
            CreateStandModel.alertMaskPointsDisection(false);
        }

        if (GUILayout.Button("V Tag", new GUILayoutOption[] { GUILayout.Width(100), GUILayout.Height(50) }))
        {
            CreateStandModel.alertMaskPointsDisection(true);
        }


        GUILayout.EndVertical();

        GUILayout.EndHorizontal();
    }
        public ARCameraConfig GetCameraConfig()
        {
            IntPtr cameraConfigHandle = m_ndkSession.CameraConfigAdapter.Create();

            NDKAPI.HwArSession_getCameraConfig(m_ndkSession.SessionHandle, cameraConfigHandle);
            ARCameraConfig cameraConfig = new ARCameraConfig(cameraConfigHandle, m_ndkSession);

            return(cameraConfig);
        }