C# 클래스 Tango.TangoApplication

Main entry point for the Tango Service. This component handles nearly all communication with the underlying TangoService. You must have one of these in your scene for Tango to work. Customization of the Tango connection can be done in the Unity editor or by programatically setting the member flags. This sends out events to Components that derive from the ITangoPose, ITangoDepth, etc. interfaces and register themselves via Register. This also sends out events to callbacks passed in through RegisterOnTangoConnect, RegisterOnTangoDisconnect, and RegisterPermissionsCallback. Note: To connect to the Tango Service, you should call InitApplication after properly registering everything.
상속: UnityEngine.MonoBehaviour
파일 보기 프로젝트 열기: stetro/project-tango-poc 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
m_3drGenerateColor bool
m_3drGenerateNormal bool
m_3drGenerateTexCoord bool
m_3drResolutionMeters float
m_3drSpaceClearing bool
m_3drUseAreaDescriptionPose bool
m_allowOutOfDateTangoAPI bool
m_autoConnectToService bool
m_enable3DReconstruction bool
m_enableADFLoading bool
m_enableAreaLearning bool
m_enableDepth bool
m_enableMotionTracking bool
m_enableVideoOverlay bool
m_motionTrackingAutoReset bool
m_videoOverlayUseByteBufferMethod bool

Private Properties

프로퍼티 타입 설명
Awake void
OnDestroy void
SendCloudEvent void
Update void
_CheckTangoVersion void
_FlipBitAndCheckPermissions void
_InitializeMotionTracking void
_PermissionWasDenied void
_RegisterOnAreaDescriptionEvent void
_RegisterOnExperimentalTangoVideoOverlay void
_RegisterOnTangoCloudEvent void
_RegisterOnTangoConnect void
_RegisterOnTangoDepthEvent void
_RegisterOnTangoDisconnect void
_RegisterOnTangoEvent void
_RegisterOnTangoEventMultithreaded void
_RegisterOnTangoPoseEvent void
_RegisterOnTangoVideoOverlay void
_RegisterPermissionsCallback void
_RequestNextPermission void
_ResetPermissionsFlags void
_ResumeTangoServices void
_SendPermissionEvent void
_SetDepthCallbacks void
_SetEventCallbacks void
_SetMotionTrackingCallbacks void
_SetVideoOverlayCallbacks void
_SuspendTangoServices void
_TangoConnect void
_TangoDisconnect void
_UnregisterOnAreaDescriptionEvent void
_UnregisterOnExperimentalTangoVideoOverlay void
_UnregisterOnTangoCloudEvent void
_UnregisterOnTangoConnect void
_UnregisterOnTangoDepthEvent void
_UnregisterOnTangoDisconnect void
_UnregisterOnTangoEvent void
_UnregisterOnTangoEventMultithreaded void
_UnregisterOnTangoPoseEvent void
_UnregisterOnTangoVideoOverlay void
_UnregisterPermissionsCallback void
_androidOnActivityResult void
_androidOnPause void
_androidOnResume void
_androidOnScreenOrientationChanged void

공개 메소드들

메소드 설명
GetTangoServiceVersion ( ) : string

Get the Tango service version name.

GetVideoOverlayTextureYUV ( ) : YUVTexture

Get the video overlay texture.

HasRequestedPermissions ( ) : bool

Check if all requested permissions have been granted.

Register ( object tangoObject ) : void

Register to get Tango callbacks. The object should derive from one of ITangoDepth, ITangoEvent, ITangoPos, ITangoVideoOverlay, or ITangoExperimentalTangoVideoOverlay. You will get callback during Update until you unregister.

RequestPermissions ( ) : void

Manual initialization step 1: Call this to request Tango permissions. To know the result of the permissions request, implement the interface ITangoLifecycle and register yourself before calling this. Once all permissions have been granted, you can call TangoApplication.Startup, optionally passing in the AreaDescription to load. You can get the list of AreaDescriptions once the appropriate permission is granted.

Set3DReconstructionEnabled ( bool enabled ) : void

Enable or disable the 3D reconstruction.

SetDepthCameraRate ( TangoEnums rate ) : void

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.

SetDepthCameraRate ( int rate ) : void

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.

Shutdown ( ) : void

Disconnect from the Tango service. This is called automatically when the TangoApplication goes away. You only need to call this to disconnect from the Tango service before the TangoApplication goes away.

Startup ( AreaDescription areaDescription ) : void

Manual initalization step 2: Call this to connect to the Tango service. After connecting to the Tango service, you will get updates for Motion Tracking, Depth Sensing, and Area Learning. If you have a specific Area Description you want to localize too, pass that Area Description in here.

Tango3DRClear ( ) : void

Clear the 3D reconstruction data. The reconstruction will start fresh.

Tango3DRExtractMeshSegment ( Tango3DReconstruction gridIndex, Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status

Extract a single grid cell's mesh.

Tango3DRExtractWholeMesh ( Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status

Extract a single mesh for the entire 3D reconstruction state.

Unregister ( System tangoObject ) : void

Unregister from Tango callbacks. See TangoApplication.Register for more details.

비공개 메소드들

메소드 설명
Awake ( ) : void

Awake this instance.

OnDestroy ( ) : void

Unity callback when this object is destroyed.

SendCloudEvent ( string message ) : void

Propagates an event from the java plugin connected to the Cloud Service through UnitySendMessage().

Update ( ) : void

Disperse any events related to Tango functionality.

_CheckTangoVersion ( ) : void

Validate the TangoService version is supported.

_FlipBitAndCheckPermissions ( PermissionsTypes permission ) : void

Flip a permission bit and check to see if all permissions were accepted.

_InitializeMotionTracking ( string uuid ) : void

Initialize motion tracking.

_PermissionWasDenied ( ) : void

A Tango permission was denied.

_RegisterOnAreaDescriptionEvent ( OnAreaDescriptionImportEventHandler import, OnAreaDescriptionExportEventHandler export ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnExperimentalTangoVideoOverlay ( OnExperimentalTangoImageAvailableEventHandler handler ) : void

Experimental API only, subject to change. Register to get Tango video overlay callbacks.

_RegisterOnTangoCloudEvent ( OnTangoCloudEventAvailableEventHandler handler ) : void

Register to get Tango cloud event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoConnect ( OnTangoConnectEventHandler handler ) : void

Register to get an event callback when connected to the Tango service. The passed event will get called once connected to the Tango service. Registering after already connected will cause the event to not fire until disconnected and then connecting again.

_RegisterOnTangoDepthEvent ( OnTangoDepthAvailableEventHandler handler ) : void

Register to get Tango depth callbacks. See TangoApplication.Register for more details.

_RegisterOnTangoDisconnect ( OnTangoDisconnectEventHandler handler ) : void

Register to get an event callback when disconnected from the Tango service. The passed event will get called when disconnected from the Tango service.

_RegisterOnTangoEvent ( OnTangoEventAvailableEventHandler handler ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoEventMultithreaded ( OnTangoEventAvailableEventHandler handler ) : void

Register to get Tango event callbacks. See TangoApplication.Register for details.

_RegisterOnTangoPoseEvent ( OnTangoPoseAvailableEventHandler handler ) : void

Register to get Tango pose callbacks. See TangoApplication.Register for more details.

_RegisterOnTangoVideoOverlay ( OnTangoImageAvailableEventHandler handler ) : void

Register to get Tango video overlay callbacks. See TangoApplication.Register for details.

_RegisterPermissionsCallback ( PermissionsEvent permissionsEventHandler ) : void

Register to get an event callback when all permissions are granted. The passed event will get called once all Tango permissions have been granted. Registering after all permissions have already been granted will cause the event to never fire.

_RequestNextPermission ( ) : void

Request next permission.

_ResetPermissionsFlags ( ) : void

Reset permissions flags.

_ResumeTangoServices ( ) : void

Helper method that will resume the tango services on App Resume. Locks the config again and connects the service.

_SendPermissionEvent ( bool permissions ) : void

Sends the permission event.

_SetDepthCallbacks ( ) : void

Set callbacks for all DepthListener objects.

_SetEventCallbacks ( ) : void

Set callbacks for all TangoEventListener objects.

_SetMotionTrackingCallbacks ( TangoCoordinateFramePair framePairs ) : void

Set callbacks on all PoseListener objects.

_SetVideoOverlayCallbacks ( ) : void

Set callbacks for all VideoOverlayListener objects.

_SuspendTangoServices ( ) : void

Helper method that will suspend the tango services on App Suspend. Unlocks the tango config and disconnects the service.

_TangoConnect ( ) : void

Connect to the Tango Service.

_TangoDisconnect ( ) : void

Disconnect from the Tango Service.

_UnregisterOnAreaDescriptionEvent ( OnAreaDescriptionImportEventHandler import, OnAreaDescriptionExportEventHandler export ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnExperimentalTangoVideoOverlay ( OnExperimentalTangoImageAvailableEventHandler handler ) : void

Experimental API only, subject to change. Unregister from the Tango video overlay callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoCloudEvent ( OnTangoCloudEventAvailableEventHandler handler ) : void

Unregister from the Tango cloud event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoConnect ( OnTangoConnectEventHandler handler ) : void

Unregister from the callback when connected to the Tango service. See TangoApplication.RegisterOnTangoConnect for more details.

_UnregisterOnTangoDepthEvent ( OnTangoDepthAvailableEventHandler handler ) : void

Unregister from the Tango depth callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoDisconnect ( OnTangoDisconnectEventHandler handler ) : void

Unregister from the callback when disconnected from the Tango service. See TangoApplication.RegisterOnTangoDisconnect for more details.

_UnregisterOnTangoEvent ( OnTangoEventAvailableEventHandler handler ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoEventMultithreaded ( OnTangoEventAvailableEventHandler handler ) : void

Unregister from the Tango event callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoPoseEvent ( OnTangoPoseAvailableEventHandler handler ) : void

Unregister from the Tango pose callbacks. See TangoApplication.Register for more details.

_UnregisterOnTangoVideoOverlay ( OnTangoImageAvailableEventHandler handler ) : void

Unregister from the Tango video overlay callbacks. See TangoApplication.Register for more details.

_UnregisterPermissionsCallback ( PermissionsEvent permissionsEventHandler ) : void

Unregister from the permission callbacks. See TangoApplication.RegisterPermissionsCallback for more details.

_androidOnActivityResult ( int requestCode, int resultCode, AndroidJavaObject data ) : void

EventHandler for Android's on activity result.

_androidOnPause ( ) : void

Android on pause.

_androidOnResume ( ) : void

Android on resume.

_androidOnScreenOrientationChanged ( AndroidScreenRotation newOrientation ) : void

Delegate for the Android screen orientation changed.

메소드 상세

GetTangoServiceVersion() 공개 정적인 메소드

Get the Tango service version name.
public static GetTangoServiceVersion ( ) : string
리턴 string

GetVideoOverlayTextureYUV() 공개 메소드

Get the video overlay texture.
public GetVideoOverlayTextureYUV ( ) : YUVTexture
리턴 YUVTexture

HasRequestedPermissions() 공개 메소드

Check if all requested permissions have been granted.
public HasRequestedPermissions ( ) : bool
리턴 bool

Register() 공개 메소드

Register to get Tango callbacks. The object should derive from one of ITangoDepth, ITangoEvent, ITangoPos, ITangoVideoOverlay, or ITangoExperimentalTangoVideoOverlay. You will get callback during Update until you unregister.
public Register ( object tangoObject ) : void
tangoObject object Object to get Tango callbacks from.
리턴 void

RequestPermissions() 공개 메소드

Manual initialization step 1: Call this to request Tango permissions. To know the result of the permissions request, implement the interface ITangoLifecycle and register yourself before calling this. Once all permissions have been granted, you can call TangoApplication.Startup, optionally passing in the AreaDescription to load. You can get the list of AreaDescriptions once the appropriate permission is granted.
public RequestPermissions ( ) : void
리턴 void

Set3DReconstructionEnabled() 공개 메소드

Enable or disable the 3D reconstruction.
public Set3DReconstructionEnabled ( bool enabled ) : void
enabled bool If set to true enabled.
리턴 void

SetDepthCameraRate() 공개 메소드

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.
public SetDepthCameraRate ( TangoEnums rate ) : void
rate TangoEnums A special rate to set the depth camera to.
리턴 void

SetDepthCameraRate() 공개 메소드

Set the framerate of the depth camera. Disabling or reducing the framerate of the depth camera when it is running can save a significant amount of battery.
public SetDepthCameraRate ( int rate ) : void
rate int The rate in frames per second, for the depth camera to run at.
리턴 void

Shutdown() 공개 메소드

Disconnect from the Tango service. This is called automatically when the TangoApplication goes away. You only need to call this to disconnect from the Tango service before the TangoApplication goes away.
public Shutdown ( ) : void
리턴 void

Startup() 공개 메소드

Manual initalization step 2: Call this to connect to the Tango service. After connecting to the Tango service, you will get updates for Motion Tracking, Depth Sensing, and Area Learning. If you have a specific Area Description you want to localize too, pass that Area Description in here.
public Startup ( AreaDescription areaDescription ) : void
areaDescription AreaDescription If not null, the Area Description to localize to.
리턴 void

Tango3DRClear() 공개 메소드

Clear the 3D reconstruction data. The reconstruction will start fresh.
public Tango3DRClear ( ) : void
리턴 void

Tango3DRExtractMeshSegment() 공개 메소드

Extract a single grid cell's mesh.
public Tango3DRExtractMeshSegment ( Tango3DReconstruction gridIndex, Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status
gridIndex Tango3DReconstruction Grid index to extract.
vertices Vector3 Filled out with extracted vertices.
normals Vector3 Filled out with extracted normals.
colors UnityEngine.Color32 Filled out with extracted colors.
triangles int Filled out with extracted triangle indices.
numVertices int Filled out with the number of valid vertices.
numTriangles int Filled out with the number of valid triangles.
리턴 Tango3DReconstruction.Status

Tango3DRExtractWholeMesh() 공개 메소드

Extract a single mesh for the entire 3D reconstruction state.
public Tango3DRExtractWholeMesh ( Vector3 vertices, Vector3 normals, Color32 colors, int triangles, int &numVertices, int &numTriangles ) : Tango3DReconstruction.Status
vertices Vector3 Filled out with extracted vertices.
normals Vector3 Filled out with extracted normals.
colors UnityEngine.Color32 Filled out with extracted colors.
triangles int Filled out with extracted triangle indices.
numVertices int Filled out with the number of valid vertices.
numTriangles int Filled out with the number of valid triangles.
리턴 Tango3DReconstruction.Status

Unregister() 공개 메소드

Unregister from Tango callbacks. See TangoApplication.Register for more details.
public Unregister ( System tangoObject ) : void
tangoObject System Object to stop getting Tango callbacks from.
리턴 void

프로퍼티 상세

m_3drGenerateColor 공개적으로 프로퍼티

public bool m_3drGenerateColor
리턴 bool

m_3drGenerateNormal 공개적으로 프로퍼티

public bool m_3drGenerateNormal
리턴 bool

m_3drGenerateTexCoord 공개적으로 프로퍼티

public bool m_3drGenerateTexCoord
리턴 bool

m_3drResolutionMeters 공개적으로 프로퍼티

public float m_3drResolutionMeters
리턴 float

m_3drSpaceClearing 공개적으로 프로퍼티

public bool m_3drSpaceClearing
리턴 bool

m_3drUseAreaDescriptionPose 공개적으로 프로퍼티

public bool m_3drUseAreaDescriptionPose
리턴 bool

m_allowOutOfDateTangoAPI 공개적으로 프로퍼티

public bool m_allowOutOfDateTangoAPI
리턴 bool

m_autoConnectToService 공개적으로 프로퍼티

public bool m_autoConnectToService
리턴 bool

m_enable3DReconstruction 공개적으로 프로퍼티

public bool m_enable3DReconstruction
리턴 bool

m_enableADFLoading 공개적으로 프로퍼티

public bool m_enableADFLoading
리턴 bool

m_enableAreaLearning 공개적으로 프로퍼티

public bool m_enableAreaLearning
리턴 bool

m_enableDepth 공개적으로 프로퍼티

public bool m_enableDepth
리턴 bool

m_enableMotionTracking 공개적으로 프로퍼티

public bool m_enableMotionTracking
리턴 bool

m_enableVideoOverlay 공개적으로 프로퍼티

public bool m_enableVideoOverlay
리턴 bool

m_motionTrackingAutoReset 공개적으로 프로퍼티

public bool m_motionTrackingAutoReset
리턴 bool

m_videoOverlayUseByteBufferMethod 공개적으로 프로퍼티

public bool m_videoOverlayUseByteBufferMethod
리턴 bool