Google cardBoard Android API (九):FieldOfView

18 篇文章 0 订阅
18 篇文章 0 订阅
public class  FieldOfView

Encapsulates a field of view composed of 4 half angles (left, right, bottom, top) as would be passed to glFrustum.

Public Constructors

FieldOfView(float left, float right, float bottom, float top)

Public Methods

staticFieldOfView
void
copy(FieldOfView other)
boolean
equals(Object other)
float
float
float
float
getTop()
void
setAngles(float left, float right, float bottom, float top)
void
setBottom(float bottom)
void
setLeft(float left)
void
setRight(float right)
void
setTop(float top)
void
toPerspectiveMatrix(float near, float far, float[] perspective, int offset)
String

Inherited Methods

Public Constructors

public FieldOfView ()

public FieldOfView (float left, float right, float bottom, float top)

Creates a new field of view object with the provided params.

Parameters
left The left field of view half-angle in degrees.
right The right field of view half-angle in degrees.
bottom The bottom field of view half-angle in degrees.
top The top field of view half-angle in degrees.
public FieldOfView (FieldOfView other)

Constructs a new field of view object copying the contents from another.

Parameters
other The other FieldOfView to copy from.

Public Methods

public static FieldOfView cardboardV1FieldOfView ()

Returns parameters for Cardboard V1.0.0

public void copy (FieldOfView other)

Copies the contents of another FieldOfView into this one.

Parameters
other The FieldOfView object to copy from.
public boolean equals (Object other)

Compares this instance with the specified object and indicates if they are equal.

Parameters
other The object to compare this instance with.
Returns
  • true if the objects are equal, false otherwise.
public float getBottom ()

Returns the bottom field of view half-angle in degrees.

Returns
  • The bottom field of view half-angle in degrees.
public float getLeft ()

Returns the left field of view half-angle in degrees.

Returns
  • The left field of view half-angle in degrees.
public float getRight ()

Returns the right field of view half-angle in degrees.

Returns
  • The right field of view half-angle in degrees.
public float getTop ()

Returns the top field of view half-angle in degrees.

Returns
  • The top field of view half-angle in degrees.
public void setAngles (float left, float right, float bottom, float top)

Sets the four half-angles of the field of view.

Parameters
left The left field of view half-angle in degrees.
right The right field of view half-angle in degrees.
bottom The bottom field of view half-angle in degrees.
top The top field of view half-angle in degrees.
public void setBottom (float bottom)

Sets the bottom field of view half-angle in degrees.

Parameters
bottom The bottom field of view half-angle in degrees.
public void setLeft (float left)

Sets the left field of view half-angle in degrees.

Parameters
left The left field of view half-angle in degrees.
public void setRight (float right)

Sets the right field of view half-angle in degrees.

Parameters
right The right field of view half-angle in degrees.
public void setTop (float top)

Sets the top field of view half-angle in degrees.

Parameters
top The top field of view half-angle in degrees.
public void toPerspectiveMatrix (float near, float far, float[] perspective, int offset)

Generates a perspective projection matrix from this object.

Parameters
near The near plane.
far The far plane.
perspective The perspective matrix to fill.
offset The offset into the perspective array to write the matrix to.
Throws
IllegalArgumentException If there is not enough space to write the result.
public String toString ()

Returns a string containing a concise, human-readable description of this object.

Returns
  • A printable representation of this object.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值