예제 #1
0
        private void DrawStylusRegion()
        {
            VoxelCore core = (VoxelCore)this.target;

            isStylusSectionExpanded = this.DrawSectionHeader("Stylus", stylusIconTexture, isStylusSectionExpanded);
            if (isStylusSectionExpanded)
            {
                EditorGUILayout.PropertyField(this.stylusGameObjectProperty, new GUIContent("Stylus"));
                this.stylusLengthProperty.floatValue = EditorGUILayout.FloatField("Length", this.stylusLengthProperty.floatValue);
                this.stylusWidthProperty.floatValue  = EditorGUILayout.FloatField("Width", this.stylusWidthProperty.floatValue);
                EditorGUILayout.Space();

                if (core != null)
                {
                    this.DrawPoseInfo("Stylus Pose:", core.pose.Position, core.pose.Rotation.eulerAngles);
                }
                else
                {
                    EditorGUILayout.LabelField("Tracker-Space Pose: Unknown");
                }

                this.DrawToggle("Enable Mouse Auto-Hide", this.enableMouseAutoHideProperty);
                EditorGUILayout.Slider(this.mouseAutoHideDelayProperty, 0.0f, 60.0f, new GUIContent("Mouse Auto-Hide Delay"));
                EditorGUILayout.Space();
            }
        }
예제 #2
0
        private void DrawGlassesRegion()
        {
            VoxelCore core = (VoxelCore)this.target;

            isGlassesSectionExpanded = this.DrawSectionHeader("Glasses", glassesIconTexture, isGlassesSectionExpanded);
            if (isGlassesSectionExpanded)
            {
                // Display pose information (readonly).
                if (core != null)
                {
                    this.DrawPoseInfo("Glass Pose:", core.sceneCamera.position, core.sceneCamera.rotation.eulerAngles);
                }
                else
                {
                    EditorGUILayout.LabelField("Tracker-Space Pose: Unknown");
                }
            }
        }
예제 #3
0
        private void DrawStereoRigRegion()
        {
            VoxelCore core = (VoxelCore)this.target;

            isStereoRigSectionExpanded = this.DrawSectionHeader("Stereo Rig", cameraIconTexture, isStereoRigSectionExpanded);
            if (isStereoRigSectionExpanded)
            {
                EditorGUILayout.HelpBox(
                    "CenterObject指相机关注中心点;SceneCamera指当前使用的相机;ViewSize指相机视野大小 ",
                    MessageType.Info);
                EditorGUILayout.PropertyField(this.centerObject, new GUIContent("Center Object"));
                EditorGUILayout.PropertyField(this.sceneCamera, new GUIContent("Scene Camera"));
                EditorGUILayout.PropertyField(this.WireDraw, new GUIContent("WireDraw"));
                EditorGUILayout.Slider(this.ipdProperty, 0.03f, 10f, new GUIContent("View Size"));
                this.DrawToggle("Head Tracking", this.isHeadTrackingEnabled);
                EditorGUILayout.Space();
            }
        }
예제 #4
0
        //////////////////////////////////////////////////////////////////////
        // Unity Monobehaviour Callbacks
        //////////////////////////////////////////////////////////////////////
        public void Awake()
        {
            if (sceneCamera == null)
            {
                Debug.LogError("没有设置当前使用相机!");
                return;
            }

            leftCamera  = transform.GetComponentInChildren <StereoCamera>().leftCamera;
            rightCamera = transform.GetComponentInChildren <StereoCamera>().rightCamera;

            STYLUS_BEAM_LENGTH = stylusLength * viewSize;
            STYLUS_BEAM_WIDTH  = stylusWidth * viewSize;

            Instance = this;

            //Default Screen mode
            Matrix.SetScreenMode(currentScreenMode);
        }