C# Класс TangoARScreen, project-tango-poc

Наследование: MonoBehaviour, ITangoLifecycle, IExperimentalTangoVideoOverlay
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
m_enableOcclusion bool
m_screenMaterial Material

Открытые методы

Метод Описание
CameraImagePointToViewportPoint ( Vector2 pos ) : Vector2

Converts a color camera position into its corresponding normalized Unity viewport position. image.

OnExperimentalTangoImageAvailable ( TangoEnums cameraId ) : void

This will be called when a new frame is available from the camera. The first scan-line of the color image is reserved for metadata instead of image pixels.

OnTangoPermissions ( bool permissionsGranted ) : void

This is called when the permission granting process is finished.

OnTangoServiceConnected ( ) : void

This is called when succesfully connected to the Tango service.

OnTangoServiceDisconnected ( ) : void

This is called when disconnected from the Tango service.

Start ( ) : void

Initialize the AR Screen.

ViewportPointToCameraImagePoint ( Vector2 pos ) : Vector2

Converts a normalized Unity viewport position into its corresponding normalized position on the color camera image.

Приватные методы

Метод Описание
_CameraUpdateForIntrinsics ( Camera cam, TangoCameraIntrinsics intrinsics, float uOffset, float vOffset ) : void

Update a camera so its perspective lines up with the color camera's perspective.

_Frustum ( float left, float right, float bottom, float top, float zNear, float zFar ) : Matrix4x4
_MeshUpdateForIntrinsics ( Mesh mesh, float uOffset, float vOffset ) : void

Update a mesh so it can be used for the Video Overlay image plane. The image plane is drawn without any projection or view matrix transforms, so it must line up exactly with normalized screen space. The texture coordinates of the mesh are adjusted so it properly clips the image plane.

Описание методов

CameraImagePointToViewportPoint() публичный Метод

Converts a color camera position into its corresponding normalized Unity viewport position. image.
public CameraImagePointToViewportPoint ( Vector2 pos ) : Vector2
pos Vector2 Normalized position for the 3D viewport.
Результат Vector2

OnExperimentalTangoImageAvailable() публичный Метод

This will be called when a new frame is available from the camera. The first scan-line of the color image is reserved for metadata instead of image pixels.
public OnExperimentalTangoImageAvailable ( TangoEnums cameraId ) : void
cameraId TangoEnums Camera identifier.
Результат void

OnTangoPermissions() публичный Метод

This is called when the permission granting process is finished.
public OnTangoPermissions ( bool permissionsGranted ) : void
permissionsGranted bool true if permissions were granted, otherwise false.
Результат void

OnTangoServiceConnected() публичный Метод

This is called when succesfully connected to the Tango service.
public OnTangoServiceConnected ( ) : void
Результат void

OnTangoServiceDisconnected() публичный Метод

This is called when disconnected from the Tango service.
public OnTangoServiceDisconnected ( ) : void
Результат void

Start() публичный Метод

Initialize the AR Screen.
public Start ( ) : void
Результат void

ViewportPointToCameraImagePoint() публичный Метод

Converts a normalized Unity viewport position into its corresponding normalized position on the color camera image.
public ViewportPointToCameraImagePoint ( Vector2 pos ) : Vector2
pos Vector2 Normalized position for the 3D viewport.
Результат Vector2

Описание свойств

m_enableOcclusion публичное свойство

If set, m_updatePointsMesh in PointCloud also gets set. Then PointCloud material's renderqueue is set to background-1 so that PointCloud data gets written to Z buffer for Depth test with virtual objects in scene. Note 1: This is a very rudimentary way of doing occlusion and limited by the capabilities of depth camera. Note 2: To enable occlusion TangoPointCloud prefab must be present in the scene as well.
public bool m_enableOcclusion
Результат bool

m_screenMaterial публичное свойство

Set this to the AR Screen material.
public Material m_screenMaterial
Результат Material