C# Class TangoARScreen, project-tango-poc

Inheritance: MonoBehaviour, ITangoLifecycle, IExperimentalTangoVideoOverlay
Afficher le fichier Open project: stetro/project-tango-poc Class Usage Examples

Méthodes publiques

Свойство Type Description
m_enableOcclusion bool
m_screenMaterial Material

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat Vector2

OnExperimentalTangoImageAvailable() public méthode

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.
Résultat void

OnTangoPermissions() public méthode

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

OnTangoServiceConnected() public méthode

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

OnTangoServiceDisconnected() public méthode

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

Start() public méthode

Initialize the AR Screen.
public Start ( ) : void
Résultat void

ViewportPointToCameraImagePoint() public méthode

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.
Résultat 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
Résultat bool

m_screenMaterial public_oe property

Set this to the AR Screen material.
public Material m_screenMaterial
Résultat Material