Example #1
0
        private void UpdateRatioList()
        {
            int           ratioIndex = GetRatioIndex(Screen.get_width(), Screen.get_height());
            int           num        = -1;
            List <string> list       = new List <string>();

            if (m_displayDropdown.value >= 0)
            {
                ResolutionData resolutionData = (m_fullScreenDropdown.value != 0) ? m_windowedResolutions : m_fullScreenResolutions[m_displayDropdown.value];
                for (int i = 0; i < resolutionData.ratioIndex.Count; i++)
                {
                    int num2 = resolutionData.ratioIndex[i];
                    list.Add(SupportedRatioNames[num2]);
                    if (ratioIndex == num2)
                    {
                        num = list.Count - 1;
                    }
                }
            }
            if (num == -1)
            {
                num = list.Count - 1;
            }
            m_ratioDropdown.ClearOptions();
            m_ratioDropdown.AddOptions(list);
            m_ratioDropdown.value = num;
            m_ratioDropdown.RefreshShownValue();
        }
Example #2
0
    /// <summary>
    /// Sets the window title and minimum pane size
    /// </summary>
    public void Awake()
    {
        base.title   = TITLE;
        this.minSize = new Vector2(700f, 500f);

        mocapLogo = Resources.Load("Cinema Mocap") as Texture2D;
        if (mocapLogo == null)
        {
            UnityEngine.Debug.LogWarning("Cinema Mocap image missing from Resources folder.");
        }
        radarLogo = Resources.Load("Cinema Radar") as Texture2D;
        if (radarLogo == null)
        {
            UnityEngine.Debug.LogWarning("Cinema Radar image missing from Resources folder.");
        }
        recordingImage = Resources.Load("Recording") as Texture2D;
        if (recordingImage == null)
        {
            UnityEngine.Debug.LogWarning("Recording Image missing from Resources folder.");
        }

        cinema_mocap_humanoid_prefab = Resources.Load("Player") as GameObject;
        if (cinema_mocap_humanoid_prefab == null)
        {
            UnityEngine.Debug.LogError("Cinema_Mocap_Humanoid.dae is missing from the Resources folder. This item is required for the system.");
        }
        rigData     = ColladaUtility.ReadRigData(SOURCE_FILE);
        inputMapper = new NUIInputToRigMapper(rigData);

        workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
    }
Example #3
0
        /// <summary>
        /// Initialize the Kinect1 Skeleton Viewer
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            string res_dir = "Cinema Suite/Cinema Mocap/";

            string showNodesName = EditorGUIUtility.isProSkin ? "CinemaMocap_ShowNodes" : "CinemaMocap_ShowNodes_Personal";

            nodesImage = EditorGUIUtility.Load(res_dir + showNodesName + ".png") as Texture2D;
            if (nodesImage == null)
            {
                UnityEngine.Debug.LogWarning(string.Format("{0}.png is missing from Resources folder.", showNodesName));
            }

            string showSkeletonName = EditorGUIUtility.isProSkin ? "CinemaMocap_ShowSkeleton" : "CinemaMocap_ShowSkeleton_Personal";

            bonesImage = EditorGUIUtility.Load(res_dir + showSkeletonName + ".png") as Texture2D;
            if (bonesImage == null)
            {
                UnityEngine.Debug.LogWarning(string.Format("{0}.png is missing from Resources folder.", showSkeletonName));
            }

            textureSize      = ResolutionData.FromZigResolution(TextureSize);
            texture          = new Texture2D(textureSize.Width, textureSize.Height);
            texture.wrapMode = TextureWrapMode.Clamp;

            outputPixels = new Color32[textureSize.Width * textureSize.Height];
        }
Example #4
0
    // Use this for initialization
    void Start()
    {
        kinect = devOrEmu.getKinect();
        //allocate space to store the data of storedFrames frames.
        frameQueue = new Queue(storedFrames);
        for (int ii = 0; ii < storedFrames; ii++)
        {
            frameData frame = new frameData();
            frame.depthImg     = new short[320 * 240];
            frame.players      = new bool[Kinect.Constants.NuiSkeletonCount];
            frame.segmentation = new bool[Kinect.Constants.NuiSkeletonCount, 320 * 240];
            frame.bounds       = new int[Kinect.Constants.NuiSkeletonCount, 4];
            frameQueue.Enqueue(frame);
        }



        if (target == null)
        {
            target = renderer;
        }
        textureSize       = ResolutionData.FromZigResolution(TextureSize);
        texture           = new Texture2D(textureSize.Width, textureSize.Height);
        texture.wrapMode  = TextureWrapMode.Clamp;
        depthHistogramMap = new float[MaxDepth];
        depthToColor      = new Color32[MaxDepth];
        outputPixels      = new Color32[textureSize.Width * textureSize.Height];


        if (null != target)
        {
            target.material.mainTexture = texture;
        }
    }
Example #5
0
        protected override void Seed(CTrackerContext context)
        {
            CouncilMemberData data      = new CouncilMemberData();
            OrdinanceData     ordData   = new OrdinanceData();
            ResolutionData    resData   = new ResolutionData();
            Ordinance         ordinance = new Ordinance();
            ApplicationUser   user      = new ApplicationUser();

            context.Ordinances.AddOrUpdate(
                ord => new { ord.OrdNumber },
                ordData.ordinanceScraper()
                );
            context.Resolutions.AddOrUpdate(
                res => new { res.ResNumber },
                resData.resolutionScraper()
                );
            context.Council_Members.AddOrUpdate(
                cm => new { cm.Name, cm.Office },
                data.seedDistrictedMembers()
                );
            context.Council_Members.AddOrUpdate(
                cm => new { cm.Name, cm.Office },
                data.seedViceMayor()
                );
            context.Council_Members.AddOrUpdate(
                cm => new { cm.Name, cm.Office },
                data.seedAtLargeMembers()
                );
        }
Example #6
0
 protected void OnDefaultResolutionButtonClicked()
 {
     if (m_fullScreenDropdown.value == 0)
     {
         ResolutionData resolutionData = m_fullScreenResolutions[m_displayDropdown.value];
         m_ratioDropdown.value      = resolutionData.defaultRatioDropDownIndex;
         m_resolutionDropdown.value = resolutionData.defaultResolutionDropDownIndex;
     }
 }
        public void AddResolution_ReturnsBadRequest()
        {
            ResolutionData customer = new ResolutionData();

            _resolutionController.ModelState.AddModelError("Name", "Required");

            var badResponse = _resolutionController.CreateResolution(customer);

            Assert.IsType <BadRequestObjectResult>(badResponse);
        }
Example #8
0
	// Use this for initialization
	void Start () {
        if (target == null) {
            target = GetComponent<Renderer>();
        }
        textureSize = ResolutionData.FromZigResolution(TextureSize);
        texture = new Texture2D(textureSize.Width, textureSize.Height);
        texture.wrapMode = TextureWrapMode.Clamp;
        GetComponent<Renderer>().material.mainTexture = texture;              
        outputPixels = new Color32[textureSize.Width * textureSize.Height];
        ZigInput.Instance.AddListener(gameObject);
	}
Example #9
0
        protected void UpdateDefaultResolutionButton()
        {
            if (m_fullScreenDropdown.value != 0)
            {
                m_defaultResolutionButton.set_interactable(false);
                return;
            }
            ResolutionData resolutionData = m_fullScreenResolutions[m_displayDropdown.value];

            m_defaultResolutionButton.set_interactable(m_ratioDropdown.value != resolutionData.defaultRatioDropDownIndex || m_resolutionDropdown.value != resolutionData.defaultResolutionDropDownIndex);
        }
Example #10
0
    // Use this for initialization
    void Start()
    {
        pauseScreen.SetActive(false);
        optionsScreen.SetActive(false);

        tempResData = new ResolutionData(3, Screen.fullScreen);

        ResolutionData resData = new ResolutionData(6, true);

        resData.applySettings();
        resolutionText.text = resData.displayResName;
    }
        public void AddResolution_ReturnsCreatedResponse()
        {
            ResolutionData resolution = new ResolutionData
            {
                Name        = "Test Resolution",
                Description = "This is a test resolution"
            };

            var createdResponse = _resolutionController.CreateResolution(resolution);

            Assert.IsType <CreatedResult>(createdResponse);
        }
Example #12
0
 // Use this for initialization
 void Start()
 {
     if (target == null)
     {
         target = GetComponent <Renderer>();
     }
     textureSize      = ResolutionData.FromZigResolution(TextureSize);
     texture          = new Texture2D(textureSize.Width, textureSize.Height);
     texture.wrapMode = TextureWrapMode.Clamp;
     GetComponent <Renderer>().material.mainTexture = texture;
     outputPixels = new Color32[textureSize.Width * textureSize.Height];
     ZigInput.Instance.AddListener(gameObject);
 }
Example #13
0
    // Applies resolution to the screen and adjusts camera view
    public void ApplyResolution(ResolutionData resolutionData)
    {
        resolution = resolutionData.resolution;

        // Set screen size without changing fullscreen mode
        Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);

        // Keep track of the currently applied resolution
        resolutionIndex = resolutionData.index;

        // If aspect ratio is less than 16:9 (eg: 4:3), then we'll have camera "track"
        // the player so the entire level still fits on the screen
        camAdjuster.NewResolution(resolution);
    }
        public void AddResolution_ReturnedResponseHasCreatedMessage()
        {
            ResolutionData resolution = new ResolutionData
            {
                Name        = "Test Resolution",
                Description = "This is a test resolution"
            };

            ActionResult <Resolution> actionResult  = _resolutionController.CreateResolution(resolution);
            CreatedResult             createdResult = actionResult.Result as CreatedResult;
            var result = createdResult.Value;

            Assert.Equal("Resolution Created", result);
        }
    void ChangeRes()
    {
        ResolutionData _res = menu.selectedItem.data as ResolutionData;

        Screen.SetResolution(_res.resolution.width, _res.resolution.height, Screen.fullScreen);
        App.shared.prefs.resolution = _res.resolution;
        foreach (UIButton butt in menu.items)
        {
            if (butt.data != null)
            {
                butt.SetText((butt.data as ResolutionData).resolution.PlainString());
            }
        }
        menu.selectedItem.SetText(_res.resolution.CheckedString());
    }
    public int MaxDepth = 10000; //DO NOT MODIFY IN RUNTIME!!
	// Use this for initialization
	void Start () {
        if (target == null) {
            target = renderer;
        }
        textureSize = ResolutionData.FromZigResolution(TextureSize);
        texture = new Texture2D(textureSize.Width, textureSize.Height);
        texture.wrapMode = TextureWrapMode.Clamp;
        depthHistogramMap = new float[MaxDepth];
        depthToColor = new Color32[MaxDepth];
        outputPixels = new Color32[textureSize.Width * textureSize.Height];
        ZigInput.Instance.AddListener(gameObject);

        if (null != target) {
            target.material.mainTexture = texture;
        }
	}
Example #17
0
        public ActionResult CreateResolution([FromBody] ResolutionData resolutionData)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (_dataContext.ResolutionExists(resolutionData.Resolution))
            {
                return(BadRequest("Resolution name already exists"));
            }

            var resolution = _dataContext.AddResolution(resolutionData.Resolution);

            var uri = Request != null?Request.GetDisplayUrl().ToString() + resolution.ResolutionID : "";

            return(Created(uri, "Resolution Created"));
        }
    void Start()
    {
        KinectOneInput input = ((KinectOneInput)KinectOneInput.Instance);
        _mapper = input.GetMapper();
        depthInfo = input.GetDepthSensor();
        textureSize = new ResolutionData(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height);
        texture = new Texture2D(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height,TextureFormat.RGBA32,false);
        texture.wrapMode = TextureWrapMode.Clamp;
        depthHistogramMap = new float[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        depthToColor = new Color32[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        outputPixels = new Color32[textureSize.Width * textureSize.Height];

        if (null != target)
        {
            target.material.mainTexture = texture;
        }
        m_engageuser = this.GetComponent<KinectOneEngageSingleUser>();
        CalImage2Screen(DepthImagePos.LeftMain);
    }
Example #19
0
    public int MaxDepth = 10000; //DO NOT MODIFY IN RUNTIME!!
    // Use this for initialization
    void Start()
    {
        if (target == null)
        {
            target = renderer;
        }
        textureSize       = ResolutionData.FromZigResolution(TextureSize);
        texture           = new Texture2D(textureSize.Width, textureSize.Height);
        texture.wrapMode  = TextureWrapMode.Clamp;
        depthHistogramMap = new float[MaxDepth];
        depthToColor      = new Color32[MaxDepth];
        outputPixels      = new Color32[textureSize.Width * textureSize.Height];
        ZigInput.Instance.AddListener(gameObject);

        if (null != target)
        {
            target.material.mainTexture = texture;
        }
    }
        public void AddResolution_ExistingResolutionReturnsBadRequest()
        {
            ResolutionData firstResolution = new ResolutionData
            {
                Name        = "Test Resolution",
                Description = "Test Resolution"
            };

            ResolutionData secondResolution = new ResolutionData
            {
                Name        = "Test Resolution",
                Description = "Test Resolution"
            };

            _resolutionController.CreateResolution(firstResolution);

            var badResponse = _resolutionController.CreateResolution(secondResolution);

            Assert.IsType <BadRequestObjectResult>(badResponse);
        }
    void Start()
    {
        KinectOneInput input = ((KinectOneInput)KinectOneInput.Instance);

        _mapper           = input.GetMapper();
        depthInfo         = input.GetDepthSensor();
        textureSize       = new ResolutionData(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height);
        texture           = new Texture2D(depthInfo.Sensor.DepthFrameSource.FrameDescription.Width, depthInfo.Sensor.DepthFrameSource.FrameDescription.Height, TextureFormat.RGBA32, false);
        texture.wrapMode  = TextureWrapMode.Clamp;
        depthHistogramMap = new float[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        depthToColor      = new Color32[depthInfo.Sensor.DepthFrameSource.DepthMaxReliableDistance];
        outputPixels      = new Color32[textureSize.Width * textureSize.Height];

        if (null != target)
        {
            target.material.mainTexture = texture;
        }
        m_engageuser = this.GetComponent <KinectOneEngageSingleUser>();
        CalImage2Screen(DepthImagePos.LeftMain);
    }
Example #22
0
 protected override void Seed(Council_Tracker.DAL.CTrackerContext context)
 {
     CouncilMemberData data      = new CouncilMemberData();
     OrdinanceData     ordData   = new OrdinanceData();
     ResolutionData    resData   = new ResolutionData();
     Ordinance         ordinance = new Ordinance();
     ApplicationUser   user      = new ApplicationUser();
     //context.Ordinances.AddOrUpdate(
     //    ord => new { ord.OrdNumber },
     //    ordData.ordinanceScraper()
     //    );
     //context.Resolutions.AddOrUpdate(
     //    res => new { res.ResNumber },
     //    resData.resolutionScraper()
     //    );
     //context.Council_Members.AddOrUpdate(
     //    cm => new { cm.Name, cm.Office },   //Reminder, this is checking that the name and office are unique
     //                                        //data.seedViceMayor()              // Was not allowing me to seed with muliple methods from the councilmemberdata...
     //                                        //data.seedAtLargeMembers()
     //    data.seedDistrictedMembers()
     //);
 }
Example #23
0
        public Settings(Settings other = null)
        {
            if (other != null)
            {
                qualityLevel   = other.qualityLevel;
                resolutionData = other.resolutionData;
                fullscreen     = other.fullscreen;
                goreDetail     = other.goreDetail;

                music = other.music;
                sfx   = other.sfx;

                fireMode     = other.fireMode;
                mouseAimMode = other.mouseAimMode;
                snapLook     = other.snapLook;
                vibration    = other.vibration;
                cursorLock   = other.cursorLock;

                difficulty = other.difficulty;
                tutorial   = other.tutorial;
            }
        }
Example #24
0
partial         void OnResolutionDataChanging(ResolutionData value);
Example #25
0
 private GameSettings()
 {
     _resolution = new ResolutionData(1280, 720, false);
 }
Example #26
0
 private GameSettings()
 {
     _resolution = new ResolutionData(1280, 720, false);
 }
Example #27
0
    /// <summary>
    /// Draw the Window's contents
    /// </summary>
    protected void OnGUI()
    {
        if (workingResolution == null)
        {
            workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
        }
        float aspectRatio    = workingResolution.Width / workingResolution.Height;
        float textureWidth   = (base.position.width - (UI_SPACING * 3)) / 2;
        float textureHeight  = textureWidth * aspectRatio;
        float newDesiredTilt = desiredTilt;

        if (isNUIOn && ZigEditorInput.Instance.ReaderInited)
        {
            if (viewerType == NUIViewerType.DepthViewer)
            {
                GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), depthViewer.Texture);
            }
            else if (viewerType == NUIViewerType.ImageViewer)
            {
                GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), imageViewer.Texture);
            }
            //else if (viewerType == NUIViewerType.DepthAndImageViewer)
            //{
            //    GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), mixedViewer.Texture);
            //}
            if (captureState == RecordingState.PreRecording)
            {
                int      timeLeft      = (int)(((delaySeconds * 1000) - stopwatch.ElapsedMilliseconds) / 1000) + 1;
                GUIStyle countdownFont = new GUIStyle(EditorStyles.label);
                countdownFont.fontSize         = (int)(textureHeight / 6);
                countdownFont.normal.textColor = Color.white;
                Vector2 size = countdownFont.CalcSize(new GUIContent(timeLeft.ToString()));
                GUI.Label(new Rect(textureWidth - (size.x), textureHeight - size.y, size.x, size.y), timeLeft.ToString(), countdownFont);
            }
            if (captureState == RecordingState.Recording)
            {
                GUI.DrawTexture(new Rect((textureWidth) - recordingImage.width, (UI_SPACING + textureHeight) - recordingImage.height, recordingImage.width, recordingImage.height), recordingImage);
            }
            GUI.DrawTexture(new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight), radarLogo);
            usersRadar.Render(ZigEditorInput.Instance, new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight));
        }
        else if (mocapLogo != null && workingResolution != null)
        {
            // Draw place holders
            GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), mocapLogo);
            GUI.DrawTexture(new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight), radarLogo);
        }

        float panelHeight = base.position.height - textureHeight - (UI_SPACING * 3);

        if (panelHeight > 5)
        {
            GUILayout.BeginArea(new Rect(UI_SPACING, textureHeight + (UI_SPACING * 2), textureWidth, panelHeight), string.Empty, "box");
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent(DEVICE_TRACKING));
                bool  toggleOn = false;
                Color temp     = GUI.color;
                if (isNUIOn)
                {
                    GUI.color = Color.green;
                    toggleOn  = GUILayout.Toggle(isNUIOn, ON, EditorStyles.miniButton);
                }
                else
                {
                    GUI.color = Color.red;
                    toggleOn  = GUILayout.Toggle(isNUIOn, OFF, EditorStyles.miniButton);
                }
                GUI.color = temp;
                EditorGUILayout.EndHorizontal();

                if (toggleOn && !isNUIOn)
                {
                    turnOnNUIDevice();
                }
                else if (!toggleOn && isNUIOn)
                {
                    turnOffNUIDevice();
                }

                viewerType = (NUIViewerType)EditorGUILayout.EnumPopup(new GUIContent(VIEWER), viewerType);

                List <GUIContent> resolutions = new List <GUIContent>();
                foreach (string name in Enum.GetNames(typeof(ZigResolution)))
                {
                    resolutions.Add(new GUIContent(name.Replace('_', ' ')));
                }
                kinectCaptureResolution = (ZigResolution)EditorGUILayout.Popup(new GUIContent(KINECT_RESOLUTION), (int)kinectCaptureResolution, resolutions.ToArray());

                SmoothingOptions newSmoothingOptions = (SmoothingOptions)EditorGUILayout.EnumPopup(new GUIContent(SMOOTHING_OPTIONS), smoothingOptions);
                if (newSmoothingOptions != smoothingOptions)
                {
                    smoothingOptions = newSmoothingOptions;
                    if (smoothingOptions == SmoothingOptions.None)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetNoSmoothing();
                    }
                    else if (smoothingOptions == SmoothingOptions.Light)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetLightSmoothing();
                    }
                    else if (smoothingOptions == SmoothingOptions.Moderate)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetModerateSmoothing();
                    }
                    else if (smoothingOptions == SmoothingOptions.Heavy)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.Smoothing          = 0.6f;
                        settings.KinectSDKSpecific.SmoothingParameters.Correction         = 0.4f;
                        settings.KinectSDKSpecific.SmoothingParameters.Prediction         = 0.6f;
                        settings.KinectSDKSpecific.SmoothingParameters.JitterRadius       = 0.15f;
                        settings.KinectSDKSpecific.SmoothingParameters.MaxDeviationRadius = 0.10f;
                        //settings.KinectSDKSpecific.SmoothingParameters.SetHeavySmoothing();
                    }
                    ZigEditorInput.Instance.SetSmoothingParameters((smoothingOptions != SmoothingOptions.None), settings.KinectSDKSpecific.SmoothingParameters);
                }
                viewNodes = EditorGUILayout.Toggle(JOINT_VIEW, viewNodes);

                EditorGUI.BeginDisabledGroup(!isNUIOn);
                newDesiredTilt = EditorGUILayout.IntSlider(new GUIContent(DEVICE_TILT), (int)desiredTilt, -27, 27);
                EditorGUI.EndDisabledGroup();

                workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
            }
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect((UI_SPACING * 2) + textureWidth, textureHeight + (UI_SPACING * 2), textureWidth, panelHeight), String.Empty, "box");
            {
                fileName = EditorGUILayout.TextField(new GUIContent("Filename"), fileName);

                /*
                 * isFilterFoldout = EditorGUILayout.Foldout(isFilterFoldout, new GUIContent("Filters"));
                 * if (isFilterFoldout)
                 * {
                 *  EditorGUI.indentLevel = 1;
                 *  EditorGUILayout.Toggle(new GUIContent("Smooth"), false);
                 *  EditorGUILayout.Toggle(new GUIContent("Mirror"), false);
                 *  EditorGUILayout.Toggle(new GUIContent("Correct Sensor Tilt"), false);
                 *  EditorGUILayout.Toggle(new GUIContent("Correct Sensor Offset"), false);
                 *  EditorGUI.indentLevel = 0;
                 * }
                 *
                 * GUILayout.Space(UI_SPACING);*/
                //recordingStart = (RecordingStart)EditorGUILayout.EnumPopup(new GUIContent("Start On"), recordingStart);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Model Preview"));
                if (GUILayout.Button("Generate"))
                {
                    createModelPreview();
                }
                EditorGUILayout.EndHorizontal();

                delaySelection = EditorGUILayout.Popup(new GUIContent("Start Delay"), delaySelection, delays);

                isAdvancedExposed = EditorGUILayout.Foldout(isAdvancedExposed, new GUIContent("Advanced"));
                if (isAdvancedExposed)
                {
                    transformationType = (TransformationType)EditorGUILayout.EnumPopup(new GUIContent("Transformation Type"), transformationType);
                }

                GUILayout.Space(UI_SPACING);
                EditorGUI.BeginDisabledGroup(!isNUIOn);
                if (GUILayout.Button(captureState == RecordingState.NotRecording ? new GUIContent("Record") : new GUIContent("Stop")))
                {
                    if (captureState == RecordingState.NotRecording)
                    {
                        BeginPreRecording();
                    }
                    else
                    {
                        StopRecording();
                    }
                }
                EditorGUI.EndDisabledGroup();
            }
            GUILayout.EndArea();
        }
        GUI.skin = null;

        if (newDesiredTilt != desiredTilt)
        {
            desiredTilt = newDesiredTilt;
            NuiWrapper.NuiCameraElevationSetAngle((long)desiredTilt);
        }
    }
Example #28
0
        private unsafe void UpdateResolutionData()
        {
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0053: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_0057: Unknown result type (might be due to invalid IL or missing references)
            //IL_005c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0095: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
            //IL_0110: Unknown result type (might be due to invalid IL or missing references)
            //IL_013c: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0200: Unknown result type (might be due to invalid IL or missing references)
            //IL_0253: Unknown result type (might be due to invalid IL or missing references)
            //IL_0287: Unknown result type (might be due to invalid IL or missing references)
            m_fullScreenResolutions.Clear();
            int displayCount = ScreenManager.GetDisplayCount();

            if (displayCount == 0)
            {
                Log.Error("No display detected", 157, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Option\\Configuration\\GraphicCategory.cs");
            }
            int num = default(int);

            if (!ScreenManager.TryGetCurrentDisplayIndex(ref num))
            {
                Log.Error("Cannot get current Display", 163, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\Option\\Configuration\\GraphicCategory.cs");
                return;
            }
            for (int i = 0; i < displayCount; i++)
            {
                DisplayInfo    displayInfo      = ScreenManager.GetDisplayInfo(i);
                Resolution     systemResolution = ((IntPtr)(void *)displayInfo).systemResolution;
                int            ratioIndex       = GetRatioIndex(systemResolution.get_width(), systemResolution.get_height());
                ResolutionData resolutionData   = default(ResolutionData);
                resolutionData.ratioIndex         = new List <int>();
                resolutionData.resolutionsByRatio = new List <List <Resolution> >();
                resolutionData.defaultResolution  = systemResolution;
                resolutionData.defaultRatioIndex  = ratioIndex;
                int num2 = ((IntPtr)(void *)displayInfo).resolutions.Length;
                for (int j = 0; j < num2; j++)
                {
                    Resolution item        = ((IntPtr)(void *)displayInfo).resolutions[j];
                    int        ratioIndex2 = GetRatioIndex(item.get_width(), item.get_height());
                    if (ratioIndex2 >= 0)
                    {
                        if (!resolutionData.ratioIndex.Contains(ratioIndex2))
                        {
                            resolutionData.ratioIndex.Add(ratioIndex2);
                            resolutionData.resolutionsByRatio.Add(new List <Resolution>
                            {
                                item
                            });
                        }
                        else
                        {
                            int index = resolutionData.ratioIndex.IndexOf(ratioIndex2);
                            resolutionData.resolutionsByRatio[index].Add(item);
                        }
                        if (systemResolution.get_width() == item.get_width() && systemResolution.get_height() == item.get_height())
                        {
                            int index2 = resolutionData.defaultRatioDropDownIndex = resolutionData.ratioIndex.IndexOf(ratioIndex2);
                            resolutionData.defaultResolutionDropDownIndex = resolutionData.resolutionsByRatio[index2].Count - 1;
                        }
                    }
                }
                m_fullScreenResolutions.Add(resolutionData);
            }
            m_windowedResolutions                    = default(ResolutionData);
            m_windowedResolutions.ratioIndex         = new List <int>();
            m_windowedResolutions.resolutionsByRatio = new List <List <Resolution> >();
            int windowedResolutionCount = ScreenManager.GetWindowedResolutionCount();

            for (int k = 0; k < windowedResolutionCount; k++)
            {
                Resolution windowedResolution = ScreenManager.GetWindowedResolution(k);
                int        ratioIndex3        = GetRatioIndex(windowedResolution.get_width(), windowedResolution.get_height());
                if (ratioIndex3 >= 0)
                {
                    if (!m_windowedResolutions.ratioIndex.Contains(ratioIndex3))
                    {
                        m_windowedResolutions.ratioIndex.Add(ratioIndex3);
                        m_windowedResolutions.resolutionsByRatio.Add(new List <Resolution>
                        {
                            windowedResolution
                        });
                    }
                    else
                    {
                        int index3 = m_windowedResolutions.ratioIndex.IndexOf(ratioIndex3);
                        m_windowedResolutions.resolutionsByRatio[index3].Add(windowedResolution);
                    }
                }
            }
        }
Example #29
0
    /// <summary>
    /// Draw the Window's contents
    /// </summary>
	protected void OnGUI()
    {
        if (workingResolution == null)
        {
            workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
        }
        float aspectRatio = workingResolution.Width / workingResolution.Height;
        float textureWidth = (base.position.width - (UI_SPACING * 3)) / 2;
        float textureHeight = textureWidth * aspectRatio;
        float newDesiredTilt = desiredTilt;

        if (isNUIOn && ZigEditorInput.Instance.ReaderInited)
        {
            if (viewerType == NUIViewerType.DepthViewer)
            {
                GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), depthViewer.Texture);
            }
            else if (viewerType == NUIViewerType.ImageViewer)
            {
                GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), imageViewer.Texture);
            }
            //else if (viewerType == NUIViewerType.DepthAndImageViewer)
            //{
            //    GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), mixedViewer.Texture);
            //}
            if (captureState == RecordingState.PreRecording)
            {
                int timeLeft = (int)(((delaySeconds * 1000) - stopwatch.ElapsedMilliseconds)/1000) + 1;
                GUIStyle countdownFont = new GUIStyle(EditorStyles.label);
                countdownFont.fontSize = (int)(textureHeight/6);
                countdownFont.normal.textColor = Color.white;
                Vector2 size = countdownFont.CalcSize(new GUIContent(timeLeft.ToString()));
                GUI.Label(new Rect(textureWidth - (size.x), textureHeight - size.y, size.x, size.y), timeLeft.ToString(), countdownFont);
            }
            if (captureState == RecordingState.Recording)
            {
                GUI.DrawTexture(new Rect((textureWidth) - recordingImage.width, (UI_SPACING + textureHeight) - recordingImage.height, recordingImage.width, recordingImage.height), recordingImage);
            }
            GUI.DrawTexture(new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight), radarLogo);
            usersRadar.Render(ZigEditorInput.Instance, new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight));
        }
        else if (mocapLogo != null && workingResolution != null)
        {
            // Draw place holders
            GUI.DrawTexture(new Rect(UI_SPACING, UI_SPACING, textureWidth, textureHeight), mocapLogo);
            GUI.DrawTexture(new Rect((UI_SPACING * 2) + textureWidth, UI_SPACING, textureWidth, textureHeight), radarLogo);
        }

        float panelHeight = base.position.height - textureHeight - (UI_SPACING * 3);
        if (panelHeight > 5)
        {
            GUILayout.BeginArea(new Rect(UI_SPACING, textureHeight + (UI_SPACING * 2), textureWidth, panelHeight), string.Empty, "box");
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent(DEVICE_TRACKING));
                bool toggleOn = false;
                Color temp = GUI.color;
                if (isNUIOn)
                {
                    GUI.color = Color.green;
                    toggleOn = GUILayout.Toggle(isNUIOn, ON, EditorStyles.miniButton);
                }
                else
                {
                    GUI.color = Color.red;
                    toggleOn = GUILayout.Toggle(isNUIOn, OFF, EditorStyles.miniButton);
                }
                GUI.color = temp;
                EditorGUILayout.EndHorizontal();

                if (toggleOn && !isNUIOn)
                {
                    turnOnNUIDevice();
                }
                else if (!toggleOn && isNUIOn)
                {
                    turnOffNUIDevice();
                }
                
                viewerType = (NUIViewerType)EditorGUILayout.EnumPopup(new GUIContent(VIEWER), viewerType);
                
                List<GUIContent> resolutions = new List<GUIContent>();
                foreach(string name in Enum.GetNames(typeof(ZigResolution)))
                {
                    resolutions.Add(new GUIContent(name.Replace('_',' ')));
                }
                kinectCaptureResolution = (ZigResolution)EditorGUILayout.Popup(new GUIContent(KINECT_RESOLUTION), (int)kinectCaptureResolution, resolutions.ToArray());
                
                SmoothingOptions newSmoothingOptions = (SmoothingOptions)EditorGUILayout.EnumPopup(new GUIContent(SMOOTHING_OPTIONS), smoothingOptions);
                if (newSmoothingOptions != smoothingOptions)
                {
                    smoothingOptions = newSmoothingOptions;
                    if (smoothingOptions == SmoothingOptions.None)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetNoSmoothing();
                    }
                    else if(smoothingOptions == SmoothingOptions.Light)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetLightSmoothing();
                    }
                    else if (smoothingOptions == SmoothingOptions.Moderate)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.SetModerateSmoothing();
                    }
                    else if (smoothingOptions == SmoothingOptions.Heavy)
                    {
                        settings.KinectSDKSpecific.SmoothingParameters.Smoothing = 0.6f;
                        settings.KinectSDKSpecific.SmoothingParameters.Correction = 0.4f;
                        settings.KinectSDKSpecific.SmoothingParameters.Prediction = 0.6f;
                        settings.KinectSDKSpecific.SmoothingParameters.JitterRadius = 0.15f;
                        settings.KinectSDKSpecific.SmoothingParameters.MaxDeviationRadius = 0.10f;
                        //settings.KinectSDKSpecific.SmoothingParameters.SetHeavySmoothing();
                    }
                    ZigEditorInput.Instance.SetSmoothingParameters((smoothingOptions != SmoothingOptions.None), settings.KinectSDKSpecific.SmoothingParameters);
                }
                viewNodes = EditorGUILayout.Toggle(JOINT_VIEW, viewNodes);
                
                EditorGUI.BeginDisabledGroup(!isNUIOn);
                newDesiredTilt = EditorGUILayout.IntSlider(new GUIContent(DEVICE_TILT), (int)desiredTilt, -27, 27);
                EditorGUI.EndDisabledGroup();

                workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
            }
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect((UI_SPACING * 2) + textureWidth, textureHeight + (UI_SPACING * 2), textureWidth, panelHeight), String.Empty, "box");
            {
                fileName = EditorGUILayout.TextField(new GUIContent("Filename"), fileName);

                /*
                isFilterFoldout = EditorGUILayout.Foldout(isFilterFoldout, new GUIContent("Filters"));
                if (isFilterFoldout)
                {
                    EditorGUI.indentLevel = 1;
                    EditorGUILayout.Toggle(new GUIContent("Smooth"), false);
                    EditorGUILayout.Toggle(new GUIContent("Mirror"), false);
                    EditorGUILayout.Toggle(new GUIContent("Correct Sensor Tilt"), false);
                    EditorGUILayout.Toggle(new GUIContent("Correct Sensor Offset"), false);
                    EditorGUI.indentLevel = 0;
                }

                GUILayout.Space(UI_SPACING);*/
                //recordingStart = (RecordingStart)EditorGUILayout.EnumPopup(new GUIContent("Start On"), recordingStart);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Model Preview"));
                if (GUILayout.Button("Generate"))
                {
                    createModelPreview();
                }
                EditorGUILayout.EndHorizontal();

                delaySelection = EditorGUILayout.Popup(new GUIContent("Start Delay"), delaySelection, delays);

                isAdvancedExposed = EditorGUILayout.Foldout(isAdvancedExposed, new GUIContent("Advanced"));
                if (isAdvancedExposed)
                {
                    transformationType = (TransformationType)EditorGUILayout.EnumPopup(new GUIContent("Transformation Type"), transformationType);
                }

                GUILayout.Space(UI_SPACING);
                EditorGUI.BeginDisabledGroup(!isNUIOn);
                if (GUILayout.Button(captureState == RecordingState.NotRecording ? new GUIContent("Record") : new GUIContent("Stop")))
                {
                    if (captureState == RecordingState.NotRecording)
                    {
                        BeginPreRecording();
                    }
                    else
                    {
                        StopRecording();
                    }
                }
                EditorGUI.EndDisabledGroup();
            }
            GUILayout.EndArea();
        }
        GUI.skin = null;

        if (newDesiredTilt != desiredTilt)
        {
            desiredTilt = newDesiredTilt;
            NuiWrapper.NuiCameraElevationSetAngle((long)desiredTilt);
        }
    }
Example #30
0
    /// <summary>
    /// Sets the window title and minimum pane size
    /// </summary>
    public void Awake()
    {
        base.title = TITLE;
        this.minSize = new Vector2(700f, 500f);

        mocapLogo = Resources.Load("Cinema Mocap") as Texture2D;
        if (mocapLogo == null)
        {
            UnityEngine.Debug.LogWarning("Cinema Mocap image missing from Resources folder.");
        }
        radarLogo = Resources.Load("Cinema Radar") as Texture2D;
        if (radarLogo == null)
        {
            UnityEngine.Debug.LogWarning("Cinema Radar image missing from Resources folder.");
        }
        recordingImage = Resources.Load("Recording") as Texture2D;
        if (recordingImage == null)
        {
            UnityEngine.Debug.LogWarning("Recording Image missing from Resources folder.");
        }

        cinema_mocap_humanoid_prefab = Resources.Load("Player") as GameObject;
        if (cinema_mocap_humanoid_prefab == null)
        {
            UnityEngine.Debug.LogError("Cinema_Mocap_Humanoid.dae is missing from the Resources folder. This item is required for the system.");
        }
        rigData = ColladaUtility.ReadRigData(SOURCE_FILE);
        inputMapper = new NUIInputToRigMapper(rigData);
        
        workingResolution = ResolutionData.FromZigResolution(kinectCaptureResolution);
	}
Example #31
0
        private void Resolve(string id, string name, NuGet.Frameworks.NuGetFramework framework = null, VersionRange overrideRange = null)
        {
            id = id.ToLower();
            ResolutionData data;

            if (resolutionData.ContainsKey(id))
            {
                data = resolutionData[id];
                if (overrideRange != null)
                {
                    if (data.ExternalVersionRange == null)
                    {
                        data.ExternalVersionRange = overrideRange;
                    }
                    else
                    {
                        throw new Exception("Can't set more than one external version range.");
                    }
                }
            }
            else
            {
                data = new ResolutionData();
                data.ExternalVersionRange = overrideRange;
                data.Name          = name;
                resolutionData[id] = data;
            }

            var allVersions = FindAllVersionRangesFor(id);

            if (data.ExternalVersionRange != null)
            {
                allVersions.Add(data.ExternalVersionRange);
            }
            var combo = VersionRange.CommonSubSet(allVersions);
            var best  = nuget.FindBestPackage(id, combo);

            if (best == null)
            {
                Console.WriteLine($"Unable to find package for '{id}' with range '{combo.ToString()}'. Likely a conflict exists in packages.config or the nuget metadata service configured incorrectly.");
                if (data.CurrentVersion == null)
                {
                    data.CurrentVersion = combo.MinVersion;
                }
                return;
            }

            if (data.CurrentVersion == best.Identity.Version)
            {
                return;
            }

            data.CurrentVersion = best.Identity.Version;
            data.Dependencies.Clear();

            var packages = nuget.DependenciesForPackage(best.Identity, framework);

            foreach (PackageDependency dependency in packages)
            {
                if (!data.Dependencies.ContainsKey(dependency.Id.ToLower()))
                {
                    data.Dependencies.Add(dependency.Id.ToLower(), dependency.VersionRange);
                    Resolve(dependency.Id.ToLower(), dependency.Id, framework);
                }
            }
        }
Example #32
0
 public void onApplyButtonPressed()
 {
     currentResData = tempResData;
     currentResData.applySettings();
     print(tempResData.displayResName);
 }
    // Use this for initialization
    void Start()
    {
        kinect = devOrEmu.getKinect();
        //allocate space to store the data of storedFrames frames.
        frameQueue = new Queue(storedFrames);
        for(int ii = 0; ii < storedFrames; ii++){
            frameData frame = new frameData();
            frame.depthImg = new short[320 * 240];
            frame.players = new bool[Kinect.Constants.NuiSkeletonCount];
            frame.segmentation = new bool[Kinect.Constants.NuiSkeletonCount,320*240];
            frame.bounds = new int[Kinect.Constants.NuiSkeletonCount,4];
            frameQueue.Enqueue(frame);
        }

        if (target == null) {
            target = renderer;
        }
        textureSize = ResolutionData.FromZigResolution(TextureSize);
        texture = new Texture2D(textureSize.Width, textureSize.Height);
        texture.wrapMode = TextureWrapMode.Clamp;
        depthHistogramMap = new float[MaxDepth];
        depthToColor = new Color32[MaxDepth];
        outputPixels = new Color32[textureSize.Width * textureSize.Height];

        if (null != target) {
            target.material.mainTexture = texture;
        }
    }