Google cardBoard Android(安卓)API (七):Eye
Describes the stereoscopic rendering details of an eye.
Nested Classes
classEye.Type | Defines the constants identifying the current eye type. |
Public Constructors
Eye(int type) |
Public Methods
float[] | getEyeView() |
FieldOfView | getFov() |
float[] | getPerspective(float zNear, float zFar) |
boolean | getProjectionChanged() |
int | getType() |
Viewport | getViewport() |
void | setProjectionChanged() |
Inherited Methods
▸ From class java.lang.ObjectPublic Constructors
publicEye(int type)
Creates a new set of eye parameters.
Parameters
type | One of theEye.Type constants describing the eye this object refers to. Behavior is undefined if an invalid eye constant is provided. |
---|
Public Methods
public float[]getEyeView()
Returns a matrix that transforms from the camera to the current eye.
This matrix should premultiply the camera matrix.
Assumes a scale of 1 world unit = 1 meter when applying the interpupillary distance. If this not your case, make sure to callandroid.opengl.Matrix.scaleM
on this matrix to correct it.
The transformation includes head tracking rotation, position shift and interpupillary distance shift. Use this if you just want to get an eye view from your normal view.
Returns
- A 4x4 column-major representing the transformation from the camera to this eye.
publicFieldOfViewgetFov()
Returns the field of view for this eye.
Use thegetFov().toPerspectiveMatrix
method to generate the appropriate perspective projection matrix to use.
Returns
- The field of view for this eye.
public float[]getPerspective(float zNear, float zFar)
Convenience method that returns the perspective projection matrix for this eye.
CallsgetFov().toPerspectiveMatrix
to generate the perspective matrix to use.
Parameters
zNear | Near Z plane to use in the projection. |
---|---|
zFar | Far Z plane to use in the projection. |
Returns
- A 4x4 column-major matrix representing the perspective projection for this eye.
public booleangetProjectionChanged()
Whether the projection matrix is stale and should be recomputed.
Returns
- true if projection matrix is stale, false otherwise
public intgetType()
Returns the eye type this object refers to.
Returns
- The current eye as one of the
Eye.Type
constants.
publicViewportgetViewport()
Returns the viewport for this eye.
Returns
- Viewport to use when rendering this eye.
public voidsetProjectionChanged()
Forces to clean up any cached projection matrices.
Called by the framework when projection parameters change between frames. Should be called if the eye's field of view object returned bygetFov()
is changed.
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer