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
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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