Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Commit

Permalink
GVR Android SDK v1.120.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cyisrael committed Dec 14, 2017
1 parent 6aef4ab commit 3bd22d7
Show file tree
Hide file tree
Showing 72 changed files with 8,095 additions and 6,136 deletions.
10,948 changes: 4,956 additions & 5,992 deletions NOTICE

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Google VR SDK
=====================
Copyright (c) 2017 Google Inc. All rights reserved.
# Google VR SDK for Android

[https://developers.google.com/vr/android/get-started](https://developers.google.com/vr/android/get-started)
Enables Daydream and Cardboard app development on Android.

Copyright (c) 2016 Google Inc. All rights reserved.

For updates, known issues, and upgrade instructions, see the
[release-notes](//github.com/googlevr/gvr-android-sdk/releases).

For first time users, see the
[Get Started with Google VR on Android](//developers.google.com/vr/android/get-started)
guide.

Please note, we do not accept pull requests.
Binary file modified apks/controller_emulator.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ task clean(type: Delete) {
// The dependencies for NDK builds live inside the .aar files so they need to
// be extracted before NDK targets can build.
task extractAudioSo(type: Copy) {
from zipTree("${project.rootDir}/libraries/sdk-audio-1.101.0.aar")
from zipTree("${project.rootDir}/libraries/sdk-audio-1.120.0.aar")
into "${project.rootDir}/libraries/"
include "jni/**/libgvr_audio.so"
}

task extractGvrSo(type: Copy) {
from zipTree("${project.rootDir}/libraries/sdk-base-1.101.0.aar")
from zipTree("${project.rootDir}/libraries/sdk-base-1.120.0.aar")
into "${project.rootDir}/libraries/"
include "jni/**/libgvr.so"
}
Expand Down
21 changes: 18 additions & 3 deletions libraries/headers/vr/gvr/capi/include/gvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern "C" {
/// gvr_clock_time_point next_vsync = AppGetNextVsyncTime();
///
/// const gvr_mat4f head_view =
/// gvr_get_head_space_from_start_space_rotation(gvr, next_vsync);
/// gvr_get_head_space_from_start_space_transform(gvr, next_vsync);
/// const gvr_mat4f left_eye_view = MatrixMultiply(
/// gvr_get_eye_from_head_matrix(gvr, GVR_LEFT_EYE), head_view);
/// const gvr::Mat4f right_eye_view = MatrixMultiply(
Expand Down Expand Up @@ -499,7 +499,12 @@ int32_t gvr_buffer_viewport_get_external_surface_id(
const gvr_buffer_viewport* viewport);

/// Sets the ID of the externally-managed Surface texture from which this
/// viewport reads. The ID is issued by GvrLayout.
/// viewport reads. The ID is issued by GvrLayout. If this viewport does not
/// read from an external surface, this should be set to
/// GVR_EXTERNAL_SURFACE_ID_NONE, which is also the default value. If it does
/// read from an external surface, set this to the ID obtained from GvrLayout
/// and set the source buffer index to the special value
/// GVR_BUFFER_INDEX_EXTERNAL_SURFACE.
///
/// @param viewport The buffer viewport.
/// @param external_surface_id The ID of the surface to read from.
Expand Down Expand Up @@ -821,6 +826,11 @@ void gvr_bind_default_framebuffer(gvr_context* gvr);
/// @return The current monotonic system time.
gvr_clock_time_point gvr_get_time_point_now();

/// @deprecated Calls to this method can be safely replaced by calls to
/// gvr_get_head_space_from_start_space_transform. The new API reflects that
/// the call *can* return a full 6DoF transform when supported by both the
/// host platform and the client application.
///
/// Gets the rotation from start space to head space. The head space is a
/// space where the head is at the origin and faces the -Z direction.
///
Expand All @@ -836,6 +846,11 @@ gvr_mat4f gvr_get_head_space_from_start_space_rotation(
/// Gets the position and rotation from start space to head space. The head
/// space is a space where the head is at the origin and faces the -Z direction.
///
/// For platforms that support 6DoF head tracking, the app may also be required
/// to declare support for 6DoF in order to receive a fully formed 6DoF pose,
/// e.g., on Android, this requires declaration of support for at least version
/// 1 of the "android.hardware.vr.headtracking" feature in the manifest.
///
/// @param gvr Pointer to the gvr instance from which to get the pose.
/// @param time The time at which to get the head pose. The time should be in
/// the future. If the time is not in the future, it will be clamped to now.
Expand Down Expand Up @@ -1032,7 +1047,7 @@ class UserPrefs : public WrapperBase<const gvr_user_prefs> {
}
};

/// Convenience C++ wrapper for gvr_user_prefs.
/// Convenience C++ wrapper for gvr_properties.
class Properties : public WrapperBase<const gvr_properties> {
public:
using WrapperBase::WrapperBase;
Expand Down
9 changes: 7 additions & 2 deletions libraries/headers/vr/gvr/capi/include/gvr_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern "C" {
/// gvr_controller_state* state = gvr_controller_state_create();
///
/// // Resume:
/// gvr_controller_resume(api);
/// gvr_controller_resume(context);
///
/// Usage:
///
Expand Down Expand Up @@ -241,7 +241,12 @@ void gvr_controller_state_update(gvr_controller_context* api,
/// handedness and gaze behavior can be changed as needed in a sequence of
/// frames. This needs to be called before gvr_controller_state_update() to
/// apply arm model. GVR_CONTROLLER_ENABLE_ARM_MODEL flag needs to be enabled
/// to apply arm model.
/// to apply arm model. The controller position computed with arm model is
/// relative to the head origin. If using the opt-in neck model, the effective
/// eye position after using vr_apply_neck_model() is shifted forward from the
/// head origin by the neck-to-eye distance (8cm) when the head is in
/// neutral position, and a matching forward offset should be applied to the
/// controller position to compensate.
///
/// When multiple controllers are configured, this arm model will be applied to
/// the controller at the given controller_index, if one exists.
Expand Down
69 changes: 52 additions & 17 deletions libraries/headers/vr/gvr/capi/include/gvr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,16 @@ typedef struct gvr_frame_ gvr_frame;
/// Generic flag type.
typedef uint32_t gvr_flags;

/// Generic 64-bit flag type.
typedef uint64_t gvr_flags64;

/// Opaque handle to a collection of properties.
typedef struct gvr_properties_ gvr_properties;

/// Represents a Daydream Controller API object, used to invoke the
/// Daydream Controller API.
typedef struct gvr_controller_context_ gvr_controller_context;

/// A generic container for various pure value types.
typedef struct gvr_value {
int32_t value_type; // gvr_value_type
Expand All @@ -211,6 +218,7 @@ typedef struct gvr_value {
int32_t i;
int64_t i64;
gvr_flags fl;
gvr_flags64 fl64;
gvr_sizei si;
gvr_recti ri;
gvr_rectf rf;
Expand All @@ -231,8 +239,8 @@ typedef struct gvr_value {
/// The type of a recentering associated with a GVR_EVENT_RECENTER event.
typedef enum {
/// Recentering state received from the platform upon starting or resuming the
/// application. This event is usually preceded in the same frame by a
/// GVR_EVENT_HEAD_TRACKING_RESUMED event.
/// application. This event is usually precedes a
/// GVR_EVENT_HEAD_TRACKING_RESUMED event in the same frame.
GVR_RECENTER_EVENT_RESTART = 1,

/// A recenter event triggered by the controller (e.g. long-press on Home
Expand All @@ -251,6 +259,10 @@ typedef enum {
typedef struct gvr_recenter_event_data {
int32_t recenter_type; // gvr_recenter_event_type
gvr_flags recenter_event_flags;

/// The new transform that maps from "sensor" space to the recentered "start"
/// space. This transform can also be retrieved by querying for the
/// GVR_PROPERTY_RECENTER_TRANSFORM property.
gvr_mat4f start_space_from_tracking_space_transform;
} gvr_recenter_event_data;

Expand Down Expand Up @@ -480,20 +492,37 @@ typedef enum {
// Virtual stereo speakers at -30 degrees and +30 degrees.
GVR_AUDIO_SURROUND_FORMAT_SURROUND_STEREO = 2,

// 5.1 surround sound according to the ITU-R BS 775 speaker configuration
// 5.1 surround sound according to the ITU-R BS.775-3 speaker configuration
// recommendation:
// - Front left (FL) at 30 degrees.
// - Front right (FR) at -30 degrees.
// - Front center (FC) at 0 degrees.
// - Left (L) at 30 degrees.
// - Right (R) at -30 degrees.
// - Center (C) at 0 degrees.
// - Low frequency effects (LFE) at front center at 0 degrees.
// - Left side (LS) at 110 degrees.
// - Right side (RS) at -110 degrees.
// - Left surround (LS) at 110 degrees.
// - Right surround (RS) at -110 degrees.
//
// The 5.1 channel input layout must matches AAC: FL, FR, FC, LFE, LS, RS.
// The 5.1 channel input layout must matches AAC: L, R, C, LFE, LS, RS.
// Note that this differs from the Vorbis/Opus 5.1 channel layout, which
// is: FL, FC, FR, LS, RS, LFE.
// is: L, C, R, LS, RS, LFE.
GVR_AUDIO_SURROUND_FORMAT_SURROUND_FIVE_DOT_ONE = 3,

// 7.1 surround sound according to the ITU-R BS.775-3 speaker configuration
// recommendation:
// - Left (FL) at 30 degrees.
// - Right (FR) at -30 degrees.
// - Center (C) at 0 degrees.
// - Low frequency effects (LFE) at front center at 0 degrees.
// - Left surround 1 (LS1) at 90 degrees.
// - Right surround 1 (RS1) at -90 degrees.
// - Left surround 2 (LS2) at 150 degrees.
// - Right surround 2 (LS2) at -150 degrees.
//
// The 7.1 channel input layout must matches AAC: L, R, C, LFE, LS1, RS1,
// LS2, RS2.
// Note that this differs from the Vorbis/Opus 7.1 channel layout, which
// is: L, C, R, LS1, RS1, LS2, RS2, LFE.
GVR_AUDIO_SURROUND_FORMAT_SURROUND_SEVEN_DOT_ONE = 10,

// First-order ambisonics (AmbiX format: 4 channels, ACN channel ordering,
// SN3D normalization).
GVR_AUDIO_SURROUND_FORMAT_FIRST_ORDER_AMBISONICS = 4,
Expand Down Expand Up @@ -524,6 +553,8 @@ typedef enum {
// (AmbiX format: 16 channels, ACN channel ordering, SN3D normalization).
// Channel 17 to 18 contain non-diegetic stereo.
GVR_AUDIO_SURROUND_FORMAT_THIRD_ORDER_AMBISONICS_WITH_NON_DIEGETIC_STEREO = 9,

// Note: Next available value is: 11
} gvr_audio_surround_format_type;

/// Valid color formats for swap chain buffers.
Expand Down Expand Up @@ -604,7 +635,9 @@ typedef enum {
/// The current transform that maps from "sensor" space to the recentered
/// "start" space. Apps can optionally undo or extend this transform to
/// perform custom recentering logic with the returned pose, but all poses
/// supplied during frame submission are assumed to be in start space.
/// supplied during frame submission are assumed to be in start space. This
/// transform matches the one reported in the most
/// recent gvr_recenter_event_data.
/// Type: gvr_mat4f
GVR_PROPERTY_RECENTER_TRANSFORM = 2,

Expand Down Expand Up @@ -632,14 +665,14 @@ typedef enum {
GVR_PROPERTY_TRACKING_STATUS = 6
} gvr_property_type;

// Safety region types exposed from the GVR_PROPERTY_SAFETY_REGION property.
/// Safety region types exposed from the GVR_PROPERTY_SAFETY_REGION property.
typedef enum {
GVR_SAFETY_REGION_NONE = 0,

// A safety region defined by a vertically-oriented cylinder, extending
// infinitely along the Y axis, and centered at the start space origin.
// Extents can be queried with the GVR_PROPERTY_SAFETY_CYLINDER_INNER_RADIUS
// and GVR_PROPERTY_SAFETY_CYLINDER_OUTER_RADIUS property keys.
/// A safety region defined by a vertically-oriented cylinder, extending
/// infinitely along the Y axis, and centered at the start space origin.
/// Extents can be queried with the GVR_PROPERTY_SAFETY_CYLINDER_INNER_RADIUS
/// and GVR_PROPERTY_SAFETY_CYLINDER_OUTER_RADIUS property keys.
GVR_SAFETY_REGION_CYLINDER = 1,
} gvr_safety_region_type;

Expand Down Expand Up @@ -679,7 +712,7 @@ typedef enum {

/// Notification that head tracking was resumed (or started for the first
/// time). Before this event is sent, head tracking will always return the
/// identity pose. This event is usually followed in the same frame by a
/// identity pose. This event is usually preceded in the same frame by a
/// GVR_EVENT_RECENTER of recenter_type GVR_RECENTER_EVENT_RESTART.
/// Event data type: none
GVR_EVENT_HEAD_TRACKING_RESUMED = 4,
Expand Down Expand Up @@ -917,6 +950,8 @@ const ArmModelBehavior kArmModelBehaviorFollowGaze =
static_cast<ArmModelBehavior>(GVR_ARM_MODEL_FOLLOW_GAZE);
const ArmModelBehavior kArmModelBehaviorSyncGaze =
static_cast<ArmModelBehavior>(GVR_ARM_MODEL_SYNC_GAZE);
const ArmModelBehavior kArmModelBehaviorIgnoreGaze =
static_cast<ArmModelBehavior>(GVR_ARM_MODEL_IGNORE_GAZE);

typedef gvr_error Error;
const Error kErrorNone = static_cast<Error>(GVR_ERROR_NONE);
Expand Down
41 changes: 41 additions & 0 deletions libraries/headers/vr/gvr/capi/include/gvr_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef VR_GVR_CAPI_INCLUDE_GVR_VERSION_H_
#define VR_GVR_CAPI_INCLUDE_GVR_VERSION_H_

#ifdef __cplusplus
extern "C" {
#endif

/// A string representation of the current GVR build version. This is of
/// the form "MAJOR.MINOR.PATCH". Note that this may differ from the runtime
/// GVR version as reported by gvr_get_version_string().
#define GVR_SDK_VERSION_STRING "1.120.0"

/// Semantic components for the current GVR build version. Note that these
/// values may differ from the runtime GVR version as reported by
/// gvr_get_version().
enum {
GVR_SDK_MAJOR_VERSION = 1,
GVR_SDK_MINOR_VERSION = 120,
GVR_SDK_PATCH_VERSION = 0,
};

#ifdef __cplusplus
} // extern "C"
#endif

#endif // VR_GVR_CAPI_INCLUDE_GVR_VERSION_H_
Binary file removed libraries/sdk-audio-1.101.0.aar
Binary file not shown.
Binary file added libraries/sdk-audio-1.120.0.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.vr</groupId>
<artifactId>sdk-audio</artifactId>
<version>1.101.0</version>
<version>1.120.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-Audio</name>
Expand All @@ -19,7 +19,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-base</artifactId>
<type>aar</type>
<version>1.101.0</version>
<version>1.120.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-base-1.101.0.aar
Binary file not shown.
Binary file added libraries/sdk-base-1.120.0.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.vr</groupId>
<artifactId>sdk-base</artifactId>
<version>1.101.0</version>
<version>1.120.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-Base</name>
Expand All @@ -19,7 +19,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-common</artifactId>
<type>aar</type>
<version>1.101.0</version>
<version>1.120.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-common-1.101.0.aar
Binary file not shown.
Binary file added libraries/sdk-common-1.120.0.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.vr</groupId>
<artifactId>sdk-common</artifactId>
<version>1.101.0</version>
<version>1.120.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-Common</name>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.vr</groupId>
<artifactId>sdk-commonwidget</artifactId>
<version>1.101.0</version>
<version>1.120.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-CommonWidget</name>
Expand All @@ -19,7 +19,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-common</artifactId>
<type>aar</type>
<version>1.101.0</version>
<version>1.120.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-controller-1.101.0.aar
Binary file not shown.
Binary file added libraries/sdk-controller-1.120.0.aar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.vr</groupId>
<artifactId>sdk-controller</artifactId>
<version>1.101.0</version>
<version>1.120.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-Controller</name>
Expand All @@ -19,7 +19,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-base</artifactId>
<type>aar</type>
<version>1.101.0</version>
<version>1.120.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-panowidget-1.101.0.aar
Binary file not shown.
Binary file added libraries/sdk-panowidget-1.120.0.aar
Binary file not shown.
Loading

0 comments on commit 3bd22d7

Please sign in to comment.