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.140.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cyisrael committed Apr 10, 2018
1 parent 233e7fe commit a8ec5b5
Show file tree
Hide file tree
Showing 49 changed files with 359 additions and 274 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
*.iml
.idea/

# Gradle configuration.
# Gradle build.
.externalNativeBuild/
.gradle/
build/
libraries/jni

# User configuration.
local.properties
Expand Down
Binary file modified apks/controller_emulator.apk
Binary file not shown.
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
buildscript {
// This configures the Gradle build system, but not the GVR components.
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.9.3'
classpath 'com.android.tools.build:gradle:3.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {

allprojects {
repositories {
google()
// For GVR components, the official source of the .aars is JCenter.
jcenter()
maven {
Expand All @@ -33,13 +35,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.130.0.aar")
from zipTree("${project.rootDir}/libraries/sdk-audio-1.140.0.aar")
into "${project.rootDir}/libraries/"
include "jni/**/libgvr_audio.so"
}

task extractGvrSo(type: Copy) {
from zipTree("${project.rootDir}/libraries/sdk-base-1.130.0.aar")
from zipTree("${project.rootDir}/libraries/sdk-base-1.140.0.aar")
into "${project.rootDir}/libraries/"
include "jni/**/libgvr.so"
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
28 changes: 16 additions & 12 deletions libraries/headers/vr/gvr/capi/include/gvr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,17 @@ typedef enum {

/// @}

/// Event data associated with a system-initiated GVR_EVENT_RECENTER event. The
/// client may wish to handle this event to provide custom recentering logic.
/// Event data associated with a GVR_EVENT_RECENTER event, which indicates head
/// tracking recentering. (Controller recentering is signaled separately
/// through gvr_controller_state_get_recentered().) The client may wish to
/// handle this event to provide custom recentering logic.
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.
/// The new transform that maps from headset's "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 @@ -635,12 +637,12 @@ typedef enum {
/// Type: float
GVR_PROPERTY_TRACKING_FLOOR_HEIGHT = 1,

/// 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. This
/// transform matches the one reported in the most
/// recent gvr_recenter_event_data.
/// The current transform that maps from headset's "sensor" space to the
/// recentered "start" space. Apps can optionally undo or extend this
/// transform to perform custom recentering logic with the SDK-provided poses,
/// but the SDK assumes poses supplied during frame submission are 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 @@ -699,7 +701,9 @@ typedef enum {

/// The type of gvr_event.
typedef enum {
/// Notification that a global recentering event has occurred.
/// Notification that head tracking has been recentered. (Note that controller
/// recentering is signaled separately through
/// gvr_controller_state_get_recentered().)
/// Event data type: gvr_recenter_event_data
GVR_EVENT_RECENTER = 1,

Expand Down
4 changes: 2 additions & 2 deletions libraries/headers/vr/gvr/capi/include/gvr_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ extern "C" {
/// 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.130.0"
#define GVR_SDK_VERSION_STRING "1.140.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 = 130,
GVR_SDK_MINOR_VERSION = 140,
GVR_SDK_PATCH_VERSION = 0,
};

Expand Down
Binary file removed libraries/sdk-audio-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-audio-1.140.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.130.0</version>
<version>1.140.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.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-base-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-base-1.140.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.130.0</version>
<version>1.140.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.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-common-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-common-1.140.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.130.0</version>
<version>1.140.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.130.0</version>
<version>1.140.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.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-controller-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-controller-1.140.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.130.0</version>
<version>1.140.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.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-panowidget-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-panowidget-1.140.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-panowidget</artifactId>
<version>1.130.0</version>
<version>1.140.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-CommonWidget</name>
Expand All @@ -19,7 +19,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-commonwidget</artifactId>
<type>aar</type>
<version>1.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
Binary file removed libraries/sdk-videowidget-1.130.0.aar
Binary file not shown.
Binary file added libraries/sdk-videowidget-1.140.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-videowidget</artifactId>
<version>1.130.0</version>
<version>1.140.0</version>
<packaging>aar</packaging>

<name>Google VR SDK-CommonWidget</name>
Expand Down Expand Up @@ -32,7 +32,7 @@
<groupId>com.google.vr</groupId>
<artifactId>sdk-commonwidget</artifactId>
<type>aar</type>
<version>1.130.0</version>
<version>1.140.0</version>
</dependency>
</dependencies>
</project>
33 changes: 33 additions & 0 deletions samples/ndk-controllerpaint/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html

cmake_minimum_required(VERSION 3.4.1)

# Configure the sample code.
file(GLOB native_srcs "src/main/jni/*.cc")
add_library(controllerpaint_jni
SHARED
${native_srcs})

# Include the GVR headers & libraries.
include_directories(${GVR_INCLUDE})

add_library(gvr-lib SHARED IMPORTED)
set_target_properties(
gvr-lib
PROPERTIES IMPORTED_LOCATION ${GVR_LIBPATH}/${ANDROID_ABI}/libgvr.so)

# Include general Android libraries.
find_library(android-lib android)
find_library(EGL-lib EGL)
find_library(GLESv2-lib GLESv2)
find_library(log-lib log)

# Build final libcontrollerpaint_jni.so
target_link_libraries(controllerpaint_jni
gvr-lib

${android-lib}
${EGL-lib}
${GLESv2-lib}
${log-lib} )
75 changes: 32 additions & 43 deletions samples/ndk-controllerpaint/build.gradle
Original file line number Diff line number Diff line change
@@ -1,59 +1,48 @@
apply plugin: 'com.android.model.application'
apply plugin: 'com.android.application'

model {
android {
compileSdkVersion = 26
buildToolsVersion = "26.0.0"

defaultConfig.with {
applicationId = "com.google.vr.ndk.samples.controllerpaint"
minSdkVersion.apiLevel = 24
targetSdkVersion.apiLevel = 24
versionCode = 1
versionName = "1.0"
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.google.vr.ndk.samples.controllerpaint"
minSdkVersion 24
targetSdkVersion 24
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
cppFlags "-std=gnu++11"
arguments "-DGVR_LIBPATH=${project.rootDir}/libraries/jni",
"-DGVR_INCLUDE=${project.rootDir}/libraries/headers"
}
}
}
android.buildTypes {
release {
minifyEnabled = true
proguardFiles.add(file('../../proguard-gvr.txt'))
buildTypes {
release {
minifyEnabled = true
proguardFiles.add(file("${project.rootDir}/proguard-gvr.txt"))
}
}
}
android.ndk {
moduleName = "controllerpaint_jni"
cppFlags.add("-std=c++11")
cppFlags.add("-I" + file("src/main/jni").absolutePath)
// Add the necessary GVR headers.
cppFlags.add("-I" + file("${project.rootDir}/libraries/headers").absolutePath)

stl = "gnustl_shared"
// Add the necessary GVR .so files for all architectures.
ldFlags.add("-L" + file("${project.rootDir}/libraries/jni/arm64-v8a").absolutePath)
ldFlags.add("-L" + file("${project.rootDir}/libraries/jni/armeabi-v7a").absolutePath)
ldFlags.add("-L" + file("${project.rootDir}/libraries/jni/x86").absolutePath)

ldLibs.addAll(["log", "android", "EGL", "GLESv2"])

// Specific the particular .so files this sample links against.
ldLibs.add("gvr")
}
android.productFlavors {
create ("fat") {
ndk {
// This sample builds all architectures by default. Note that if you
// only want to build for a specific architecture, you need to
// remove the appropriate lines below. You also need to remove the
// .so files from the apk using
// "packagingOptions {exclude('lib/armeabi-v7a/*')}" in the android
// section.
ndk.abiFilters.add("arm64-v8a")
ndk.abiFilters.add("armeabi-v7a")
ndk.abiFilters.add("x86")
abiFilters "arm64-v8a"
abiFilters "armeabi-v7a"
abiFilters "x86"
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}


dependencies {
compile 'com.google.vr:sdk-base:1.130.0'
compile 'com.google.vr:sdk-base:1.140.0'
}

build.dependsOn(':extractNdk')
build.dependsOn(':extractNdk')
4 changes: 2 additions & 2 deletions samples/ndk-controllerpaint/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.vr.ndk.samples.controllerpaint"
android:versionCode="180130033"
android:versionName="1.130.0">
android:versionCode="180313033"
android:versionName="1.140.0">

<!-- The Daydream SDK requires API 24+ and OpenGL ES 3.2+. -->
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24" />
Expand Down
Loading

0 comments on commit a8ec5b5

Please sign in to comment.