GvrMathHelpers
Helper functions to perform common math operations for Gvr.
Summary
| Public static functions | |
|---|---|
| ConvertFloatArrayToMatrix(float[] floatArray) | Matrix4x4Converts a float array of length 16 into a column-major 4x4 matrix.  | 
| EaseOutCubic(float min, float max, float value) | floatA cubic easing function (https://easings.net/#easeOutCubic).  | 
| GetIntersectionPosition(Camera cam, RaycastResult raycastResult) | Vector3Gets the intersection position of the camera and the raycast result.  | 
| GvrMatrixToUnitySpace(Matrix4x4 gvrMatrix, out Vector3 position, out Quaternion orientation) | voidConverts matrix from Google VR convention to Unity convention.  | 
| NormalizedCartesianToSpherical(Vector3 cartCoords) | Vector2Normalizes a 3D Cartesian direction to a 2D spherical direction.  | 
Public static functions
ConvertFloatArrayToMatrix
Matrix4x4 ConvertFloatArrayToMatrix( float[] floatArray )
Converts a float array of length 16 into a column-major 4x4 matrix.
| Details | |||
|---|---|---|---|
| Parameters | 
 | ||
| Returns | A column-major 4x4 matrix. | 
EaseOutCubic
float EaseOutCubic( float min, float max, float value )
A cubic easing function (https://easings.net/#easeOutCubic).
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters | 
 | ||||||
| Returns | The output of the easing function between (min) and (max). | 
GetIntersectionPosition
Vector3 GetIntersectionPosition( Camera cam, RaycastResult raycastResult )
Gets the intersection position of the camera and the raycast result.
| Details | |||||
|---|---|---|---|---|---|
| Parameters | 
 | ||||
| Returns | The position of the intersection. | 
GvrMatrixToUnitySpace
void GvrMatrixToUnitySpace( Matrix4x4 gvrMatrix, out Vector3 position, out Quaternion orientation )
Converts matrix from Google VR convention to Unity convention.
Google VR is row-major, RHS coordinates, and Unity is column-major, LHS.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters | 
 | 
NormalizedCartesianToSpherical
Vector2 NormalizedCartesianToSpherical( Vector3 cartCoords )
Normalizes a 3D Cartesian direction to a 2D spherical direction.
| Details | |||
|---|---|---|---|
| Parameters | 
 | ||
| Returns | The spherical coordinates. |