|
19 | 19 | /// </copyright> |
20 | 20 |
|
21 | 21 | using System; |
| 22 | +using System.Text; |
22 | 23 | using UnityEngine; |
23 | 24 | using SimpleJSON; |
24 | 25 |
|
@@ -96,28 +97,29 @@ public DeviceDescriptor GetDeviceDescription() |
96 | 97 | int rotate180 = parsedJsonDisplayParams["hmd"]["eyes"][0]["rotate_180"].AsInt; |
97 | 98 |
|
98 | 99 | //print |
99 | | - string parsedJson = "FIELD OF VIEW:\n"; |
100 | | - parsedJson += "monocular_horizontal = " + monocularHorizontal + "\n"; |
101 | | - parsedJson += "monocular_vertical = " + monocularVertical + "\n"; |
102 | | - parsedJson += "overlap_percent = " + overlapPercent + "\n"; |
103 | | - parsedJson += "pitch_tilt = " + pitchTilt + "\n"; |
104 | | - parsedJson += "\nRESOLUTION\n"; |
105 | | - parsedJson += "width = " + width + "\n"; |
106 | | - parsedJson += "height = " + width + "\n"; |
107 | | - parsedJson += "video_inputs = " + videoInputs + "\n"; |
108 | | - parsedJson += "display_mode = " + displayMode + "\n"; |
109 | | - parsedJson += "\nDISTORTION\n"; |
110 | | - parsedJson += "k1_red = " + k1Red + "\n"; |
111 | | - parsedJson += "k1_green = " + k1Green + "\n"; |
112 | | - parsedJson += "k1_blue = " + k1Blue + "\n"; |
113 | | - parsedJson += "\nRENDERING\n"; |
114 | | - parsedJson += "left_roll = " + leftRoll + "\n"; |
115 | | - parsedJson += "right_roll = " + rightRoll + "\n"; |
116 | | - parsedJson += "\nEYES\n"; |
117 | | - parsedJson += "center_proj_x = " + centerProjX + "\n"; |
118 | | - parsedJson += "center_proj_y = " + centerProjY + "\n"; |
119 | | - parsedJson += "rotate_180 = " + rotate180 + "\n"; |
120 | | - Debug.Log("Parsed " + JsonDescriptorFile.name + ".json:\n" + parsedJson); |
| 100 | + StringBuilder jsonPrinter = new StringBuilder(64); |
| 101 | + jsonPrinter.Append("FIELD OF VIEW:\n") |
| 102 | + .Append("monocular_horizontal = ").AppendLine( monocularHorizontal.ToString() ) |
| 103 | + .Append("monocular_vertical = ").AppendLine( monocularVertical.ToString() ) |
| 104 | + .Append("overlap_percent = ").AppendLine( overlapPercent.ToString() ) |
| 105 | + .Append("pitch_tilt = ").AppendLine( pitchTilt.ToString() ) |
| 106 | + .Append("\nRESOLUTION\n") |
| 107 | + .Append("width = ").AppendLine( width.ToString() ) |
| 108 | + .Append("height = ").AppendLine( height.ToString() ) |
| 109 | + .Append("video_inputs = ").AppendLine( videoInputs.ToString() ) |
| 110 | + .Append("display_mode = ").AppendLine( displayMode ) |
| 111 | + .Append("\nDISTORTION\n") |
| 112 | + .Append("k1_red = ").AppendLine( k1Red.ToString() ) |
| 113 | + .Append("k1_green = ").AppendLine( k1Green.ToString() ) |
| 114 | + .Append("k1_blue = ").AppendLine( k1Blue.ToString() ) |
| 115 | + .Append("\nRENDERING\n") |
| 116 | + .Append("left_roll = ").AppendLine( leftRoll.ToString() ) |
| 117 | + .Append("right_roll = ").AppendLine( rightRoll.ToString() ) |
| 118 | + .Append("\nEYES\n") |
| 119 | + .Append("center_proj_x = ").AppendLine( centerProjX.ToString() ) |
| 120 | + .Append("center_proj_y = ").AppendLine( centerProjY.ToString() ) |
| 121 | + .Append("rotate_180 = ").AppendLine( rotate180.ToString() ); |
| 122 | + Debug.Log("Parsed " + JsonDescriptorFile.name + ".json:\n" + jsonPrinter.ToString()); |
121 | 123 |
|
122 | 124 | //create a device descriptor object and store the parsed json |
123 | 125 | DeviceDescriptor deviceDescriptor = new DeviceDescriptor(); |
|
0 commit comments