public classHeadTransform

Describes the head transform independently of any eye parameters.

Public Constructors

HeadTransform()

Public Methods

void getEulerAngles(float[] eulerAngles, int offset)
void getForwardVector(float[] forward, int offset)
void getHeadView(float[] headView, int offset)
void getQuaternion(float[] quaternion, int offset)
void getRightVector(float[] right, int offset)
void getTranslation(float[] translation, int offset)
void getUpVector(float[] up, int offset)

Inherited Methods

From class java.lang.Object

Public Constructors

publicHeadTransform()

Public Methods

public voidgetEulerAngles(float[] eulerAngles, int offset)

Provides the Euler angles representation of the head rotation.

Use of Euler angles is discouraged as they might be subject to Gimbal lock situations. Use quaternions or rotation matrices instead whenever possible.

The provided values represent the viewport rotation as pitch, yaw and roll angles where the matrix R = Rz(roll) * Rx(pitch) * Ry(yaw) represents the full rotation. This rotation matrix order ensures both yaw and roll are in the full [-pi, pi] interval.

The angles are provided in radians, in this order and within the following intervals:

  • Pitch (X axis): [-pi/2, pi/2]
  • Yaw (Y axis): [-pi, pi]
  • Roll (Z axis): [-pi, pi]

The X-Y-Z axes are the basis of a right-handed OpenGL-style coordinate system. During Gimbal lock this method enforces yaw to 0 and provides a valid roll angle.

Parameters
eulerAngles Array where the 3 angles will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetForwardVector(float[] forward, int offset)

Provides the direction the head is looking towards as a 3x1 unit vector.

Note that in OpenGL the forward vector points into the -Z direction. Make sure to invert it if ever used to compute the basis of a right-handed system.

Parameters
forward Array where the forward vector will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetHeadView(float[] headView, int offset)

A matrix representing the transform from the camera to the head.

Head origin is defined as the center point between the two eyes.

Parameters
headView Array where the 4x4 column-major transformation matrix will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetQuaternion(float[] quaternion, int offset)

Provides the quaternion representing the head rotation.

Parameters
quaternion Array where the quaternion (x, y, z, w) will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetRightVector(float[] right, int offset)

Provides the rightwards direction of the head as a 3x1 unit vector.

Parameters
right Array where the right vector will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetTranslation(float[] translation, int offset)

Provides the relative translation of the head as a 3x1 vector.

Parameters
translation Array where the translation vector will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

public voidgetUpVector(float[] up, int offset)

Provides the upwards direction of the head as a 3x1 unit vector.

Parameters
up Array where the up vector will be written to.
offset Offset in the array where data should be written.
Throws
IllegalArgumentException If there is not enough space to write the result.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android 常见分辨率(mdpi、hdpi 、xhdpi、
  2. android View 绘制流程 和 事件传递
  3. 教你如何开关Android的APN网络
  4. 系统角度解读Android(安卓)P新特性
  5. Android TensorFlow 智能语音识别
  6. Android不用OnScrollListener采用Gesture
  7. Android中Market的Loading效果实现方法
  8. Android(安卓)ViewDragHelper及移动处理
  9. Android应用程序目录定义及使用方法
  10. android连接sql2008