Google cardBoard Android API (九):FieldOfView

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()
FieldOfView(float left, float right, float bottom, float top)
FieldOfView( FieldOfView other)

Public Methods

staticFieldOfView
cardboardV1FieldOfView()
void
copy(FieldOfView other)
boolean
equals(Object other)
float
getBottom()
float
getLeft()
float
getRight()
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
toString()

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.

你可能感兴趣的:(Google cardBoard Android API (九):FieldOfView)