C# Class TangoARScreen, project-tango-poc

Inheritance: MonoBehaviour, ITangoLifecycle, IExperimentalTangoVideoOverlay
ファイルを表示 Open project: stetro/project-tango-poc Class Usage Examples

Public Properties

Property Type Description
m_enableOcclusion bool
m_screenMaterial Material

Public Methods

Method Description
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.

Private Methods

Method Description
_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.

Method Details

CameraImagePointToViewportPoint() public method

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.
return Vector2

OnExperimentalTangoImageAvailable() public method

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.
return void

OnTangoPermissions() public method

This is called when the permission granting process is finished.
public OnTangoPermissions ( bool permissionsGranted ) : void
permissionsGranted bool true if permissions were granted, otherwise false.
return void

OnTangoServiceConnected() public method

This is called when succesfully connected to the Tango service.
public OnTangoServiceConnected ( ) : void
return void

OnTangoServiceDisconnected() public method

This is called when disconnected from the Tango service.
public OnTangoServiceDisconnected ( ) : void
return void

Start() public method

Initialize the AR Screen.
public Start ( ) : void
return void

ViewportPointToCameraImagePoint() public method

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.
return Vector2

Property Details

m_enableOcclusion public_oe property

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
return bool

m_screenMaterial public_oe property

Set this to the AR Screen material.
public Material m_screenMaterial
return Material