Skip to content

Commit

Permalink
ARCore Android SDK v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictornvictor committed Mar 28, 2019
1 parent 851092a commit 5b67d88
Show file tree
Hide file tree
Showing 36 changed files with 732 additions and 726 deletions.
Binary file added assets/canonical_face_mesh.fbx
Binary file not shown.
71 changes: 38 additions & 33 deletions libraries/include/arcore_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ inline ArAugmentedFace *ArAsFace(ArTrackable *trackable) {

#if defined(__GNUC__) && !defined(AR_DEPRECATED_SUPPRESS)
#define AR_DEPRECATED(_deprecation_string) \
__attribute__((deprecated(_deprecation_string)));
__attribute__((deprecated(_deprecation_string)))
#else
#define AR_DEPRECATED(_deprecation_string)
#endif
Expand Down Expand Up @@ -858,7 +858,8 @@ AR_DEFINE_ENUM(ArLightEstimationMode){
AR_LIGHT_ESTIMATION_MODE_DISABLED = 0,
/// Lighting estimation is enabled, generating a single-value intensity
/// estimate.
AR_LIGHT_ESTIMATION_MODE_AMBIENT_INTENSITY = 1};
AR_LIGHT_ESTIMATION_MODE_AMBIENT_INTENSITY = 1,
};

/// @ingroup config
/// Select the behavior of the plane detection subsystem.
Expand Down Expand Up @@ -901,9 +902,9 @@ AR_DEFINE_ENUM(ArAugmentedFaceMode){
};

/// @ingroup augmented_face
/// Defines face regions for which the pose can be queried. Left and right
/// are defined relative to the person that the mesh belongs to. To retrieve the
/// center pose use #ArAugmentedFace_getCenterPose().
/// Defines face regions to query the pose for. Left and right are defined
/// relative to the person that the mesh belongs to. To retrieve the center pose
/// use #ArAugmentedFace_getCenterPose().
AR_DEFINE_ENUM(ArAugmentedFaceRegionType){
/// The region at the tip of the nose.
AR_AUGMENTED_FACE_REGION_NOSE_TIP = 0,
Expand All @@ -914,38 +915,12 @@ AR_DEFINE_ENUM(ArAugmentedFaceRegionType){
};

/// @ingroup config
/// Selects the desired behavior of the camera focus subsystem. Currently, the
/// default focus mode is AR_FOCUS_MODE_FIXED, but this default might change in
/// the future. Note, on devices where ARCore does not support Auto Focus due to
/// the use of a fixed focus camera, setting AR_FOCUS_MODE_AUTO will be ignored.
/// See the ARCore Supported Devices
/// (https://developers.google.com/ar/discover/supported-devices) page for a
/// list of affected devices.
///
/// For optimal AR tracking performance, use the focus mode provided by the
/// default session config. While capturing pictures or video, use
/// AR_FOCUS_MODE_AUTO. For optimal AR tracking, revert to the default focus
/// mode once auto focus behavior is no longer needed. If your app requires
/// fixed focus camera, call ArConfig_setFocusMode(…, …, AR_FOCUS_MODE_FIXED)
/// before enabling the AR session. This will ensure that your app always uses
/// fixed focus, even if the default camera config focus mode changes in a
/// future release.
/// Selects the desired behavior of the camera focus subsystem.
AR_DEFINE_ENUM(ArFocusMode){/// Focus is fixed.
AR_FOCUS_MODE_FIXED = 0,
/// Auto-focus is enabled.
AR_FOCUS_MODE_AUTO = 1};

/// Describes the direction a camera is facing relative to the device. Used by
/// ArCameraConfig_getFacingDirection().
AR_DEFINE_ENUM(ArCameraConfigFacingDirection){
/// Camera looks out the back of the device (away from the user).
AR_CAMERA_CONFIG_FACING_DIRECTION_BACK = 0,
/// Camera looks out the front of the device (towards the user). To create
/// a session using the front-facing (selfie) camera, include
/// #AR_SESSION_FEATURE_FRONT_CAMERA in the feature list passed to
/// ArSession_createWithFeatures().
AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT = 1};

/// @ingroup plane
/// Simple summary of the normal vector of a plane, for filtering purposes.
AR_DEFINE_ENUM(ArPlaneType){
Expand Down Expand Up @@ -1006,6 +981,22 @@ AR_DEFINE_ENUM(ArCoordinates2dType){

};

/// @addtogroup cameraconfig
/// @{

/// Describes the direction a camera is facing relative to the device. Used by
/// ArCameraConfig_getFacingDirection().
AR_DEFINE_ENUM(ArCameraConfigFacingDirection){
/// Camera looks out the back of the device (away from the user).
AR_CAMERA_CONFIG_FACING_DIRECTION_BACK = 0,
/// Camera looks out the front of the device (towards the user). To create
/// a session using the front-facing (selfie) camera, include
/// #AR_SESSION_FEATURE_FRONT_CAMERA in the feature list passed to
/// ArSession_createWithFeatures().
AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT = 1};

/// @}

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -1322,7 +1313,21 @@ void ArConfig_setAugmentedFaceMode(const ArSession *session,
ArAugmentedFaceMode augmented_face_mode);

/// Sets the focus mode that should be used. See ::ArFocusMode for available
/// options.
/// options. Currently, the default focus mode is AR_FOCUS_MODE_FIXED, but this
/// default might change in the future. Note, on devices where ARCore does not
/// support Auto Focus due to the use of a fixed focus camera, setting
/// AR_FOCUS_MODE_AUTO will be ignored. See the ARCore Supported Devices
/// (https://developers.google.com/ar/discover/supported-devices) page for a
/// list of affected devices.
///
/// For optimal AR tracking performance, use the focus mode provided by the
/// default session config. While capturing pictures or video, use
/// AR_FOCUS_MODE_AUTO. For optimal AR tracking, revert to the default focus
/// mode once auto focus behavior is no longer needed. If your app requires
/// fixed focus camera, call ArConfig_setFocusMode(…, …, AR_FOCUS_MODE_FIXED)
/// when configuring the AR session. This will ensure that your app always uses
/// fixed focus, even if the default camera config focus mode changes in a
/// future release.
void ArConfig_setFocusMode(const ArSession *session,
ArConfig *config,
ArFocusMode focus_mode);
Expand Down
4 changes: 2 additions & 2 deletions samples/augmented_image_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.7.0'
natives 'com.google.ar:core:1.7.0'
implementation 'com.google.ar:core:1.8.0'
natives 'com.google.ar:core:1.8.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ constexpr bool kUseSingleImage = false;

AugmentedImageApplication::AugmentedImageApplication(
AAssetManager* asset_manager)
: asset_manager_(asset_manager) {
}
: asset_manager_(asset_manager) {}

AugmentedImageApplication::~AugmentedImageApplication() {
if (ar_session_ != nullptr) {
Expand Down Expand Up @@ -103,6 +102,7 @@ void AugmentedImageApplication::OnResume(void* env, void* context,
ArConfig_setAugmentedImageDatabase(ar_session_, ar_config,
ar_augmented_image_database);

ArConfig_setFocusMode(ar_session_, ar_config, AR_FOCUS_MODE_AUTO);
CHECK(ArSession_configure(ar_session_, ar_config) == AR_SUCCESS);

ArAugmentedImageDatabase_destroy(ar_augmented_image_database);
Expand Down
Binary file modified samples/augmented_image_c/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/augmented_image_c/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
168 changes: 84 additions & 84 deletions samples/augmented_image_c/gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
2 changes: 1 addition & 1 deletion samples/augmented_image_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.7.0'
implementation 'com.google.ar:core:1.8.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ public void onDrawFrame(GL10 gl) {

private void configureSession() {
Config config = new Config(session);
config.setFocusMode(Config.FocusMode.AUTO);
if (!setupAugmentedImageDatabase(config)) {
messageSnackbarHelper.showError(this, "Could not setup augmented image database");
}
Expand Down
Binary file modified samples/augmented_image_java/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/augmented_image_java/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
Loading

0 comments on commit 5b67d88

Please sign in to comment.