Skip to content

Commit c684bbd

Browse files
committed
ARCore Android SDK v1.23.0
1 parent eaa8594 commit c684bbd

File tree

60 files changed

+507
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+507
-468
lines changed

libraries/include/arcore_c_api.h

Lines changed: 142 additions & 151 deletions
Large diffs are not rendered by default.

samples/augmented_faces_java/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626

2727
dependencies {
2828
// ARCore (Google Play Services for AR) library.
29-
implementation 'com.google.ar:core:1.22.0'
29+
implementation 'com.google.ar:core:1.23.0'
3030

3131
// Obj - a simple Wavefront OBJ file loader
3232
// https://github.com/javagl/Obj

samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/augmentedfaces/AugmentedFacesActivity.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import com.google.ar.core.AugmentedFace;
2727
import com.google.ar.core.AugmentedFace.RegionType;
2828
import com.google.ar.core.Camera;
29+
import com.google.ar.core.CameraConfig;
30+
import com.google.ar.core.CameraConfigFilter;
2931
import com.google.ar.core.Config;
3032
import com.google.ar.core.Config.AugmentedFaceMode;
3133
import com.google.ar.core.Frame;
@@ -47,6 +49,7 @@
4749
import java.io.IOException;
4850
import java.util.Collection;
4951
import java.util.EnumSet;
52+
import java.util.List;
5053
import javax.microedition.khronos.egl.EGLConfig;
5154
import javax.microedition.khronos.opengles.GL10;
5255

@@ -134,10 +137,19 @@ protected void onResume() {
134137
return;
135138
}
136139

137-
// Configure session to use front facing camera.
138-
EnumSet<Session.Feature> featureSet = EnumSet.of(Session.Feature.FRONT_CAMERA);
139-
// Create the session.
140-
session = new Session(/* context= */ this, featureSet);
140+
// Create the session and configure it to use a front-facing (selfie) camera.
141+
session = new Session(/* context= */ this, EnumSet.noneOf(Session.Feature.class));
142+
CameraConfigFilter cameraConfigFilter = new CameraConfigFilter(session);
143+
cameraConfigFilter.setFacingDirection(CameraConfig.FacingDirection.FRONT);
144+
List<CameraConfig> cameraConfigs = session.getSupportedCameraConfigs(cameraConfigFilter);
145+
if (!cameraConfigs.isEmpty()) {
146+
// Element 0 contains the camera config that best matches the session feature
147+
// and filter settings.
148+
session.setCameraConfig(cameraConfigs.get(0));
149+
} else {
150+
message = "This device does not have a front-facing (selfie) camera";
151+
exception = new UnavailableDeviceNotCompatibleException(message);
152+
}
141153
configureSession();
142154

143155
} catch (UnavailableArcoreNotInstalledException
@@ -221,18 +233,13 @@ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
221233
backgroundRenderer.createOnGlThread(/*context=*/ this);
222234
augmentedFaceRenderer.createOnGlThread(this, "models/freckles.png");
223235
augmentedFaceRenderer.setMaterialProperties(0.0f, 1.0f, 0.1f, 6.0f);
224-
noseObject.createOnGlThread(
225-
/*context=*/ this,
226-
"models/nose.obj",
227-
"models/nose_fur.png");
236+
noseObject.createOnGlThread(/*context=*/ this, "models/nose.obj", "models/nose_fur.png");
228237
noseObject.setMaterialProperties(0.0f, 1.0f, 0.1f, 6.0f);
229238
noseObject.setBlendMode(ObjectRenderer.BlendMode.AlphaBlending);
230-
rightEarObject.createOnGlThread(
231-
this, "models/forehead_right.obj", "models/ear_fur.png");
239+
rightEarObject.createOnGlThread(this, "models/forehead_right.obj", "models/ear_fur.png");
232240
rightEarObject.setMaterialProperties(0.0f, 1.0f, 0.1f, 6.0f);
233241
rightEarObject.setBlendMode(ObjectRenderer.BlendMode.AlphaBlending);
234-
leftEarObject.createOnGlThread(
235-
this, "models/forehead_left.obj", "models/ear_fur.png");
242+
leftEarObject.createOnGlThread(this, "models/forehead_left.obj", "models/ear_fur.png");
236243
leftEarObject.setMaterialProperties(0.0f, 1.0f, 0.1f, 6.0f);
237244
leftEarObject.setBlendMode(ObjectRenderer.BlendMode.AlphaBlending);
238245

Binary file not shown.

samples/augmented_faces_java/gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

samples/augmented_faces_java/gradlew.bat

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
3740

3841
set JAVA_EXE=java.exe
3942
%JAVA_EXE% -version >NUL 2>&1
40-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4144

4245
echo.
4346
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
5154
set JAVA_HOME=%JAVA_HOME:"=%
5255
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5356

54-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5558

5659
echo.
5760
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
6164

6265
goto fail
6366

64-
:init
65-
@rem Get command-line arguments, handling Windows variants
66-
67-
if not "%OS%" == "Windows_NT" goto win9xME_args
68-
69-
:win9xME_args
70-
@rem Slurp the command line arguments.
71-
set CMD_LINE_ARGS=
72-
set _SKIP=2
73-
74-
:win9xME_args_slurp
75-
if "x%~1" == "x" goto execute
76-
77-
set CMD_LINE_ARGS=%*
78-
7967
:execute
8068
@rem Setup the command line
8169

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

72+
8473
@rem Execute Gradle
85-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8675

8776
:end
8877
@rem End local scope for the variables with windows NT shell

samples/augmented_image_c/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ android {
5353

5454
dependencies {
5555
// ARCore (Google Play Services for AR) library.
56-
implementation 'com.google.ar:core:1.22.0'
57-
natives 'com.google.ar:core:1.22.0'
56+
implementation 'com.google.ar:core:1.23.0'
57+
natives 'com.google.ar:core:1.23.0'
5858

5959
implementation 'androidx.appcompat:appcompat:1.1.0'
6060
implementation 'com.google.android.material:material:1.1.0'

samples/augmented_image_c/app/src/main/cpp/util.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ bool LoadObjFile(AAssetManager* mgr, const std::string& file_name,
314314
int matches = sscanf(line_header, "v %f %f %f\n", &vertex[0], &vertex[1],
315315
&vertex[2]);
316316
if (matches != 3) {
317-
LOGE("Format of 'v float float float' required for each vertice line");
317+
LOGE("Format of 'v float float float' required for each vertex line");
318318
return false;
319319
}
320320

Binary file not shown.

samples/augmented_image_c/gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

0 commit comments

Comments
 (0)