November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

gvr::BufferViewport

#include <gvr.h>

Convenience C++ wrapper for the opaque gvr_buffer_viewport type.

Summary

The constructor allocates memory, so when used in tight loops, instances should be reused.

Inheritance

Inherits from: gvr::WrapperBase< gvr_buffer_viewport, gvr_buffer_viewport_destroy >

Public functions

GetExternalSurfaceId() const
int32_t
GetOpacity() const
float
For more information, see gvr_buffer_viewport_get_opacity().
GetReprojection() const
For more information, see gvr_buffer_viewport_get_reprojection().
GetSourceBufferIndex() const
int32_t
GetSourceFov() const
For more information, see gvr_buffer_viewport_get_source_fov().
GetSourceUv() const
For more information, see gvr_buffer_viewport_get_source_uv().
GetTargetEye() const
Eye
For more information, see gvr_buffer_viewport_get_target_eye().
GetTransform() const
For more information, see gvr_buffer_viewport_get_transform().
SetExternalSurfaceId(const int32_t external_surface_id)
void
SetOpacity(float opacity)
void
For more information, see gvr_buffer_viewport_set_opacity().
SetReprojection(gvr_reprojection reprojection)
void
For more information, see gvr_buffer_viewport_set_reprojection().
SetSourceBufferIndex(int32_t buffer_index)
void
SetSourceFov(const Rectf & fov)
void
For more information, see gvr_buffer_viewport_set_source_fov().
SetSourceLayer(int32_t layer_index)
void
For more information, see gvr_buffer_viewport_set_source_layer().
SetSourceUv(const Rectf & uv)
void
For more information, see gvr_buffer_viewport_set_source_uv().
SetTargetEye(Eye eye)
void
For more information, see gvr_buffer_viewport_set_target_eye().
SetTransform(const Mat4f & transform)
void
For more information, see gvr_buffer_viewport_set_transform().
operator!=(const BufferViewport & other) const
bool
operator==(const BufferViewport & other) const
bool
For more information, see gvr_buffer_viewport_equal().

Public functions

GetExternalSurfaceId

int32_t GetExternalSurfaceId() const 

GetOpacity

float GetOpacity() const 

For more information, see gvr_buffer_viewport_get_opacity().

GetReprojection

gvr_reprojection GetReprojection() const 

For more information, see gvr_buffer_viewport_get_reprojection().

GetSourceBufferIndex

int32_t GetSourceBufferIndex() const 

GetSourceFov

Rectf GetSourceFov() const 

For more information, see gvr_buffer_viewport_get_source_fov().

GetSourceUv

Rectf GetSourceUv() const 

For more information, see gvr_buffer_viewport_get_source_uv().

GetTargetEye

Eye GetTargetEye() const 

For more information, see gvr_buffer_viewport_get_target_eye().

GetTransform

Mat4f GetTransform() const 

For more information, see gvr_buffer_viewport_get_transform().

SetExternalSurfaceId

void SetExternalSurfaceId(
  const int32_t external_surface_id
)

SetOpacity

void SetOpacity(
  float opacity
)

For more information, see gvr_buffer_viewport_set_opacity().

SetReprojection

void SetReprojection(
  gvr_reprojection reprojection
)

For more information, see gvr_buffer_viewport_set_reprojection().

SetSourceBufferIndex

void SetSourceBufferIndex(
  int32_t buffer_index
)

SetSourceFov

void SetSourceFov(
  const Rectf & fov
)

For more information, see gvr_buffer_viewport_set_source_fov().

SetSourceLayer

void SetSourceLayer(
  int32_t layer_index
)

For more information, see gvr_buffer_viewport_set_source_layer().

SetSourceUv

void SetSourceUv(
  const Rectf & uv
)

For more information, see gvr_buffer_viewport_set_source_uv().

SetTargetEye

void SetTargetEye(
  Eye eye
)

For more information, see gvr_buffer_viewport_set_target_eye().

SetTransform

void SetTransform(
  const Mat4f & transform
)

For more information, see gvr_buffer_viewport_set_transform().

operator!=

bool operator!=(
  const BufferViewport & other
) const 

operator==

bool operator==(
  const BufferViewport & other
) const 

For more information, see gvr_buffer_viewport_equal().