ManoMotion Unity SDK 2.0
SDK documentation
Loading...
Searching...
No Matches
ManoMotion.ManoUtils Class Reference

Tools that can be used to get information adapted to the screen size.

Inheritance diagram for ManoMotion.ManoUtils:

Public Member Functions

Vector3 CalculateNewPositionWithDepth (Vector3 point, float depth)
 Calculates the new position in relation to the main camera, for the skleleton joints with clamped depth of -1 and 1.
 
Vector3 CalculateScreenPosition (Vector3 point)
 Calculates the screen position of a normalized position. Used for bounding box.
 
void OrientMeshRenderer (MeshRenderer meshRenderer)
 Properly orients a MeshRenderer in order to be displayed properly.
 
void ShouldBackgroundCoverScreen (bool shouldCoverScreen)
 Update value that decides how the camera image is displayed. If true it will cover the entire screen, if false the entire image will be visible.
 
void SetOrientation (SupportedOrientation orientation)
 Set the orientation. Used when locking the screen in certain scenes.
 

Static Public Member Functions

static Vector3 GetCenter (params Vector3[] points)
 

Public Attributes

bool updateOrientation = true
 

Static Public Attributes

static Action OnOrientationChanged
 

Protected Member Functions

void Awake ()
 

Package Functions

void AdjustBorders (MeshRenderer meshRenderer, Session session, int padding=0)
 Adjust the transform in the received mesh renderer to fit the screen without stretching.
 
float CalculateRatio (Session session)
 Calculates the current ratio depending on the device orientation.
 
float CalculateSize (MeshRenderer meshRenderer, Session session, float ratio)
 Gets the size for the AdjustBorders method.
 
void AdjustMeshScale (MeshRenderer meshRenderer, Session session, float ratio, float size)
 Adjust the scale of the mesh render.
 
void CalculateCorrectionPoint (MeshRenderer meshRenderer, Session session, float ratio, float size)
 Calculate a correction point depending on the orientation.
 

Properties

static ManoUtils Instance [get]
 
SupportedOrientation Orientation [get]
 
float Zoom [get]
 

Private Member Functions

void Start ()
 
void Update ()
 
void CheckForScreenOrientationChange ()
 Checks for changes on the orientation of the device.
 

Private Attributes

SupportedOrientation currentOrientation
 
Camera cam
 
Vector3 correctionRatio = Vector3.one
 
bool shouldBackgroundCoverScreen = true
 
float zoomValue = 1f
 

Static Private Attributes

static ManoUtils instance
 

Member Function Documentation

◆ AdjustBorders()

void ManoMotion.ManoUtils.AdjustBorders ( MeshRenderer meshRenderer,
Session session,
int padding = 0 )
inlinepackage

◆ AdjustMeshScale()

void ManoMotion.ManoUtils.AdjustMeshScale ( MeshRenderer meshRenderer,
Session session,
float ratio,
float size )
inlinepackage

◆ Awake()

void ManoMotion.ManoUtils.Awake ( )
inlineprotected

◆ CalculateCorrectionPoint()

void ManoMotion.ManoUtils.CalculateCorrectionPoint ( MeshRenderer meshRenderer,
Session session,
float ratio,
float size )
inlinepackage

◆ CalculateNewPositionWithDepth()

Vector3 ManoMotion.ManoUtils.CalculateNewPositionWithDepth ( Vector3 point,
float depth )
inline

◆ CalculateRatio()

float ManoMotion.ManoUtils.CalculateRatio ( Session session)
inlinepackage

◆ CalculateScreenPosition()

Vector3 ManoMotion.ManoUtils.CalculateScreenPosition ( Vector3 point)
inline

◆ CalculateSize()

float ManoMotion.ManoUtils.CalculateSize ( MeshRenderer meshRenderer,
Session session,
float ratio )
inlinepackage

◆ CheckForScreenOrientationChange()

void ManoMotion.ManoUtils.CheckForScreenOrientationChange ( )
inlineprivate

◆ GetCenter()

static Vector3 ManoMotion.ManoUtils.GetCenter ( params Vector3[] points)
inlinestatic

◆ OrientMeshRenderer()

void ManoMotion.ManoUtils.OrientMeshRenderer ( MeshRenderer meshRenderer)
inline
Parameters
meshRendererMesh renderer.

◆ SetOrientation()

void ManoMotion.ManoUtils.SetOrientation ( SupportedOrientation orientation)
inline

◆ ShouldBackgroundCoverScreen()

void ManoMotion.ManoUtils.ShouldBackgroundCoverScreen ( bool shouldCoverScreen)
inline

◆ Start()

void ManoMotion.ManoUtils.Start ( )
inlineprivate

◆ Update()

void ManoMotion.ManoUtils.Update ( )
inlineprivate

Member Data Documentation

◆ cam

Camera ManoMotion.ManoUtils.cam
private

◆ correctionRatio

Vector3 ManoMotion.ManoUtils.correctionRatio = Vector3.one
private

◆ currentOrientation

SupportedOrientation ManoMotion.ManoUtils.currentOrientation
private

◆ instance

ManoUtils ManoMotion.ManoUtils.instance
staticprivate

◆ OnOrientationChanged

Action ManoMotion.ManoUtils.OnOrientationChanged
static

◆ shouldBackgroundCoverScreen

bool ManoMotion.ManoUtils.shouldBackgroundCoverScreen = true
private

◆ updateOrientation

bool ManoMotion.ManoUtils.updateOrientation = true

◆ zoomValue

float ManoMotion.ManoUtils.zoomValue = 1f
private

Property Documentation

◆ Instance

ManoUtils ManoMotion.ManoUtils.Instance
staticget

◆ Orientation

SupportedOrientation ManoMotion.ManoUtils.Orientation
get

◆ Zoom

float ManoMotion.ManoUtils.Zoom
getprivate