Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #32 from googlesamples/release-xiaotong
Browse files Browse the repository at this point in the history
release-xiaotong
  • Loading branch information
chaosemer committed Oct 2, 2015
2 parents 9dd96f3 + e8175a8 commit 2433aa2
Show file tree
Hide file tree
Showing 36 changed files with 671 additions and 523 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
android:versionName="0" >

<uses-sdk
android:minSdkVersion="19"
android:minSdkVersion="17"
android:targetSdkVersion="19" />

</manifest>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
int color gray_dark 0x7f040000
int color tango_blue 0x7f040001
int color tango_green 0x7f040002
int color tango_yellow 0x7f040003
int color text_exception_action_required 0x7f040004
int color text_exception_description 0x7f040005
int color tango_blue 0x7f040004
int color tango_green 0x7f040003
int color tango_yellow 0x7f040005
int color text_exception_action_required 0x7f040002
int color text_exception_description 0x7f040001
int dimen connection_progress_bar_sub_margin 0x7f050000
int dimen exception_component_height 0x7f050001
int dimen exception_status_component_size 0x7f050002
int dimen hold_steady_bubble_level_max_y 0x7f050003
int dimen hold_steady_frame_transform_pivot_y 0x7f050004
int dimen hold_steady_bubble_level_max_y 0x7f050004
int dimen hold_steady_frame_transform_pivot_y 0x7f050003
int dimen hold_steady_trace_size 0x7f050005
int drawable exception_container_shadow 0x7f020000
int drawable hold_steady_bubble_level_err 0x7f020001
Expand All @@ -28,14 +28,15 @@ int id bubble_level_err 0x7f080006
int id bubble_level_group 0x7f080005
int id bubble_level_ok 0x7f080007
int id component_hold_steady 0x7f08000c
int id connection_layout 0x7f08000f
int id exception_container 0x7f08000e
int id connection_layout 0x7f080010
int id connection_layout_title 0x7f08000d
int id exception_container 0x7f08000f
int id exception_description 0x7f08000a
int id exception_icon 0x7f080008
int id exception_status 0x7f08000b
int id exception_title 0x7f080009
int id frame 0x7f080004
int id splash_logo 0x7f08000d
int id splash_logo 0x7f08000e
int id trace_left_1 0x7f080002
int id trace_left_2 0x7f080000
int id trace_right_1 0x7f080003
Expand All @@ -45,37 +46,43 @@ int layout exception_component 0x7f030001
int layout layout_connection 0x7f030002
int layout layout_splash 0x7f030003
int layout layout_tango_ux 0x7f030004
int string action_required 0x7f060000
int string connection_layout_message 0x7f060001
int string device_not_responding_description 0x7f060002
int string device_not_responding_title 0x7f060003
int string lying_on_surface_description 0x7f060004
int string lying_on_surface_title 0x7f060005
int string motion_track_description 0x7f060006
int string motion_track_title 0x7f060007
int string moving_too_fast_description 0x7f060008
int string moving_too_fast_title 0x7f060009
int string not_enough_light_description 0x7f06000a
int string not_enough_light_title 0x7f06000b
int string project_tango 0x7f06000c
int string run_time_mismatch_description 0x7f06000d
int string run_time_mismatch_title 0x7f06000e
int string service_updated_description 0x7f06000f
int string service_updated_title 0x7f060010
int string space_not_recognized_description 0x7f060011
int string space_not_recognized_title 0x7f060012
int string too_much_light_description 0x7f060013
int string too_much_light_title 0x7f060014
int string unable_to_detect_surface_description 0x7f060015
int string unable_to_detect_surface_title 0x7f060016
int style ConnectionLayoutSubtext 0x7f070000
int style ConnectionLayoutText 0x7f070001
int style DownloadProgressText 0x7f070002
int style ExceptionActionRequired 0x7f070003
int style ExceptionDescription 0x7f070004
int string action_required 0x7f060017
int string connection_layout_message_still 0x7f060018
int string connection_layout_message_tight 0x7f060019
int string device_not_responding_description 0x7f06000c
int string device_not_responding_title 0x7f06000b
int string hold_posture_description 0x7f060016
int string hold_posture_down 0x7f06001c
int string hold_posture_forward 0x7f06001a
int string hold_posture_title 0x7f060015
int string hold_posture_up 0x7f06001b
int string lying_on_surface_description 0x7f060010
int string lying_on_surface_title 0x7f06000f
int string motion_track_description 0x7f060012
int string motion_track_title 0x7f060011
int string moving_too_fast_description 0x7f060002
int string moving_too_fast_title 0x7f060001
int string not_enough_light_description 0x7f060008
int string not_enough_light_title 0x7f060007
int string project_tango 0x7f060000
int string run_time_mismatch_description 0x7f060014
int string run_time_mismatch_title 0x7f060013
int string service_updated_description 0x7f06000e
int string service_updated_title 0x7f06000d
int string space_not_recognized_description 0x7f060006
int string space_not_recognized_title 0x7f060005
int string too_much_light_description 0x7f06000a
int string too_much_light_title 0x7f060009
int string unable_to_detect_surface_description 0x7f060004
int string unable_to_detect_surface_title 0x7f060003
int style ConnectionLayoutSubtext 0x7f070003
int style ConnectionLayoutText 0x7f070002
int style DownloadProgressText 0x7f070004
int style ExceptionActionRequired 0x7f070007
int style ExceptionDescription 0x7f070006
int style ExceptionTitle 0x7f070005
int style Text20GrayDarkLight 0x7f070006
int style Text40GrayDarkThin 0x7f070007
int style TextListContentItem 0x7f070008
int style TextListTitle 0x7f070009
int style TextListTitleItem 0x7f07000a
int style Text20GrayDarkLight 0x7f070001
int style Text40GrayDarkThin 0x7f070000
int style TextListContentItem 0x7f07000a
int style TextListTitle 0x7f070008
int style TextListTitleItem 0x7f070009
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-21
target=android-19
android.library=true
android.library.reference.1=../tango-java-lib
android.library.reference.1=../tango_java_lib
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@

<TextView
style="@style/ConnectionLayoutText"
android:id="@+id/connection_layout_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/connection_layout_message"
android:text="@string/connection_layout_message_tight"
android:textAllCaps="true" />

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dimen name="exception_status_component_size">30dp</dimen>

<dimen name="hold_steady_frame_transform_pivot_y">110dp</dimen>
<dimen name="hold_steady_bubble_level_max_y">-30dp</dimen>
<dimen name="hold_steady_bubble_level_max_y">30dp</dimen>
<dimen name="hold_steady_trace_size">112dp</dimen>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,45 @@
<string name="moving_too_fast_title">Too fast.</string>
<string name="moving_too_fast_description">Slow down and hold device steady.</string>

<string name="unable_to_detect_surface_title">Few depth points.</string>
<string name="unable_to_detect_surface_description">Keep objects to be scanned in the range of 0.5 &#8211; 4 meters.</string>
<string name="unable_to_detect_surface_title">Nothing detected.</string>
<string name="unable_to_detect_surface_description">Keep the device at least an arm’s length from objects.</string>

<string name="space_not_recognized_title">Space not recognized.</string>
<string name="space_not_recognized_description">Avoid pointing at environments with few features.</string>
<string name="not_enough_light_title">Not enough light.</string>
<string name="not_enough_light_description">Make sure nothing is blocking camera or light.</string>
<string name="space_not_recognized_description">Point the device somewhere else.</string>

<string name="not_enough_light_title">Too dark.</string>
<string name="not_enough_light_description">Use the device in well-lit areas.</string>

<string name="too_much_light_title">Too much light.</string>
<string name="too_much_light_title">Too bright.</string>
<string name="too_much_light_description">Avoid pointing at bright lights.</string>

<string name="device_not_responding_title">Tango Service Crash.</string>
<string name="device_not_responding_description">Exit the application or reboot your device.</string>
<string name="device_not_responding_title">System unavailable.</string>
<string name="device_not_responding_description">Restart the app or reboot the device.</string>

<string name="service_updated_title">Library Mismatch.</string>
<string name="service_updated_description">Update your Tango Service to the latest version.</string>
<string name="service_updated_title">Incompatible version.</string>
<string name="service_updated_description">Update to the latest Project Tango Core.</string>

<string name="lying_on_surface_title">Lying on surface.</string>
<string name="lying_on_surface_title">Camera blocked.</string>
<string name="lying_on_surface_description">Pick up the device to continue.</string>

<string name="motion_track_title">Motion Tracking lost.</string>
<string name="motion_track_description">Hold steady and wait for system to recover.</string>
<string name="motion_track_title">Tracking lost.</string>
<string name="motion_track_description">Hold steady to let the system recover.</string>

<string name="run_time_mismatch_title">Runtime Mismatch.</string>
<string name="run_time_mismatch_description">Go to system setting and use ART as runtime.</string>
<string name="run_time_mismatch_title">Incorrect configuration.</string>
<string name="run_time_mismatch_description">Go to Settings > Developer options and select “Use ART”.</string>

<string name="hold_posture_title">Incorrect tilt.</string>
<string name="hold_posture_description">Point the device %s.</string>

<string name="action_required">Action required</string>

<!-- Connection Layout -->
<string name="connection_layout_message">Hold steady</string>
<string name="connection_layout_message_still">Hold still</string>
<string name="connection_layout_message_tight">Hold tight</string>

<!-- Hold postures -->
<string name="hold_posture_forward">forward</string>
<string name="hold_posture_up">up</string>
<string name="hold_posture_down">down</string>

</resources>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Camera:
width: 1
height: 1
near clip plane: .0500000007
far clip plane: 100
far clip plane: 4
field of view: 37.7999992
orthographic: 0
orthographic size: 5
Expand Down Expand Up @@ -240,6 +240,10 @@ Prefab:
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11493252, guid: 5f59b9945461344cebfcccf17cdc53f9, type: 2}
propertyPath: m_enableOcclusion
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 5f59b9945461344cebfcccf17cdc53f9, type: 2}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -297,7 +301,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1065599727}
m_LocalRotation: {x: -.707106829, y: 0, z: 0, w: .707106709}
m_LocalPosition: {x: 0, y: 0, z: 15.1000004}
m_LocalPosition: {x: 0, y: 0, z: 3.99000001}
m_LocalScale: {x: 1.60000002, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 535930854}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ private void OnGUI()
Color oldColor = GUI.color;
GUI.color = Color.black;

GUI.Label(new Rect(Common.UI_LABEL_START_X,
Common.UI_FPS_LABEL_START_Y,
Common.UI_LABEL_SIZE_X,
Common.UI_LABEL_SIZE_Y), Common.UI_FONT_SIZE + m_FPSText + "</size>");
GUI.Label(new Rect(AreaLearningGUIController.UI_LABEL_START_X,
AreaLearningGUIController.UI_FPS_LABEL_START_Y,
AreaLearningGUIController.UI_LABEL_SIZE_X,
AreaLearningGUIController.UI_LABEL_SIZE_Y), AreaLearningGUIController.UI_FONT_SIZE + m_FPSText + "</size>");

GUI.color = oldColor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ private void OnGUI()
{
if (m_tangoApplication.m_enableAreaLearning)
{
if (GUI.Button(new Rect(Common.UI_BUTTON_GAP_X,
Screen.height - (Common.UI_BUTTON_SIZE_Y + Common.UI_LABEL_GAP_Y),
Common.UI_BUTTON_SIZE_X,
Common.UI_BUTTON_SIZE_Y), "<size=20>Save ADF</size>"))
if (GUI.Button(new Rect(AreaLearningGUIController.UI_BUTTON_GAP_X,
Screen.height - (AreaLearningGUIController.UI_BUTTON_SIZE_Y + AreaLearningGUIController.UI_LABEL_GAP_Y),
AreaLearningGUIController.UI_BUTTON_SIZE_X,
AreaLearningGUIController.UI_BUTTON_SIZE_Y), "<size=20>Save ADF</size>"))
{
m_keyboardState = KeyboardState.OPEN;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class SceneSwitcher : MonoBehaviour
{
private const int SCENE_BUTTON_SIZE_X = 250;
private const int SCENE_BUTTON_SIZE_Y = 65;
private const int SCENE_BUTTON_GAP_X = 5;
private const int SCENE_BUTTON_GAP_Y = 3;

/// <summary>
/// The names of all the scenes this can switch between.
Expand All @@ -46,8 +48,8 @@ private void OnGUI()
{
for (int it = 0; it < m_sceneNames.Length; ++it)
{
Rect buttonRect = new Rect(Screen.width - Common.UI_BUTTON_GAP_X - SCENE_BUTTON_SIZE_X,
Common.UI_LABEL_GAP_Y + ((Common.UI_LABEL_GAP_Y + SCENE_BUTTON_SIZE_Y) * it),
Rect buttonRect = new Rect(Screen.width - SCENE_BUTTON_GAP_X - SCENE_BUTTON_SIZE_X,
SCENE_BUTTON_GAP_Y + ((SCENE_BUTTON_GAP_Y + SCENE_BUTTON_SIZE_Y) * it),
SCENE_BUTTON_SIZE_X,
SCENE_BUTTON_SIZE_Y);
if (GUI.Button(buttonRect, "<size=20>" + m_sceneNames[it] + "</size>"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ private void _SetCameraIntrinsics()
}

/// <summary>
/// Create a projection matrix from window size, camera intrinsics, and clip settings.
/// Compute a projection matrix from window size, camera intrinsics, and clip settings.
/// </summary>
/// <returns>Projection matrix.</returns>
/// <param name="width">The width of the camera image.</param>
/// <param name="height">The height of the camera image.</param>
/// <param name="fx">The x-axis focal length of the camera.</param>
Expand All @@ -342,42 +343,44 @@ private void _SetCameraIntrinsics()
private Matrix4x4 ProjectionMatrixForCameraIntrinsics(float width, float height,
float fx, float fy,
float cx, float cy,
float near, float far) {
float near, float far)
{
float xscale = near / fx;
float yscale = near / fy;

float xoffset = (cx - (width / 2.0f)) * xscale;
float xoffset = (cx - (width / 2.0f)) * xscale;

// OpenGL coordinates has y pointing downwards so we negate this term.
float yoffset = -(cy - (height / 2.0f)) * yscale;

return Frustum(xscale * -width / 2.0f - xoffset,
xscale * width / 2.0f - xoffset,
yscale * -height / 2.0f - yoffset,
yscale * height / 2.0f - yoffset,
near, far);
return Frustum((xscale * -width / 2.0f) - xoffset,
(xscale * +width / 2.0f) - xoffset,
(yscale * -height / 2.0f) - yoffset,
(yscale * +height / 2.0f) - yoffset,
near, far);
}

/// <summary>
/// This is function compute the projection matrix based on frustum size.
/// Compute a projection matrix for a frustum.
///
/// This function's implementation is same as glFrustum.
/// </summary>
/// <returns>Projection matrix.</returns>
/// <param name="left">Specify the coordinates for the left vertical clipping planes.</param>
/// <param name="right">Specify the coordinates for the right vertical clipping planes.</param>
/// <param name="bottom">Specify the coordinates for the bottom horizontal clipping planes.</param>
/// <param name="top">Specify the coordinates for the top horizontal clipping planes.</param>
/// <param name="zNear">Specify the distances to the near depth clipping planes. Both distances must be positive.</param>
/// <param name="zFar">Specify the distances to the far depth clipping planes. Both distances must be positive.</param>
private Matrix4x4 Frustum(float left,
float right,
float bottom,
float top,
float zNear,
float zFar) {
/// <param name="zFar">Specify the distances to the far depth clipping planes. Both distances must be positive.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "*",
Justification = "Matrix visibility is more important.")]
private Matrix4x4 Frustum(float left, float right, float bottom, float top, float zNear, float zFar)
{
Matrix4x4 m = new Matrix4x4();
m.SetRow(0, new Vector4(2.0f * zNear / (right - left), 0.0f, (right + left) / (right - left) , 0.0f));
m.SetRow(1, new Vector4(0.0f, 2.0f * zNear/ (top - bottom), (top + bottom) / (top - bottom) , 0.0f));
m.SetRow(2, new Vector4(0.0f, 0.0f, -(zFar + zNear) / (zFar - zNear), -(2 * zFar * zNear) / (zFar - zNear)));
m.SetRow(3, new Vector4(0.0f, 0.0f, -1.0f, 0.0f));
m.SetRow(0, new Vector4(2.0f * zNear / (right - left), 0.0f, (right + left) / (right - left) , 0.0f));
m.SetRow(1, new Vector4(0.0f, 2.0f * zNear / (top - bottom), (top + bottom) / (top - bottom) , 0.0f));
m.SetRow(2, new Vector4(0.0f, 0.0f, -(zFar + zNear) / (zFar - zNear), -(2 * zFar * zNear) / (zFar - zNear)));
m.SetRow(3, new Vector4(0.0f, 0.0f, -1.0f, 0.0f));
return m;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
// Setting the z write off to make sure our video overlay is always rendered at back.
ZWrite Off

Tags { "Queue" = "Geometry" }
ZTest Off
Tags { "Queue" = "Background" }
Pass
{
GLSLPROGRAM
Expand Down
Loading

0 comments on commit 2433aa2

Please sign in to comment.