Skip to content

Commit

Permalink
ARCore Android SDK v1.38.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Dibble committed Jul 5, 2023
1 parent 0192b44 commit 61508d0
Show file tree
Hide file tree
Showing 35 changed files with 59 additions and 355 deletions.
6 changes: 3 additions & 3 deletions libraries/include/arcore_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
/// Note: There is no runtime checking that casts are correct. When downcasting
/// @c ::ArTrackable, call @c ::ArTrackable_getType beforehand to figure out the
/// correct cast.
#endif // __cplusplus

/// @defgroup ArAnchor ArAnchor
/// Describes a fixed location and orientation in the real world, representing
Expand All @@ -107,7 +108,6 @@
/// Augmented Faces supports front-facing (selfie) camera only, and does not
/// support attaching anchors nor raycast hit testing. Calling
/// @c ::ArTrackable_acquireNewAnchor will return @c #AR_ERROR_ILLEGAL_STATE.
#endif // __cplusplus

/// @defgroup ArAugmentedImage ArAugmentedImage
/// An image being detected and tracked by ARCore.
Expand Down Expand Up @@ -265,7 +265,7 @@
/// ::ArEarth_getCameraGeospatialPose.
///

/// @defgroup ArSemantics ArSemantics
/// @defgroup ArSemanticLabel ArSemanticLabel
/// Scene Semantics API. See the
/// <a href="https://developers.google.com/ar/develop/c/scene-semantics">Scene
/// Semantics Developer Guide</a> for more information.
Expand Down Expand Up @@ -1480,7 +1480,7 @@ AR_DEFINE_ENUM(ArSemanticMode){
AR_SEMANTIC_MODE_ENABLED = 1,
};

/// @ingroup ArSemantics
/// @ingroup ArSemanticLabel
/// Defines the labels the Scene Semantics API is able to detect and maps
/// human-readable names to per-pixel semantic labels. See the
/// <a href="https://developers.google.com/ar/develop/c/scene-semantics">Scene
Expand Down
2 changes: 1 addition & 1 deletion samples/augmented_faces_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
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 @@ -68,8 +68,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
natives 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
natives 'com.google.ar:core:1.38.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
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 @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
2 changes: 1 addition & 1 deletion samples/cloud_anchor_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
4 changes: 2 additions & 2 deletions samples/computervision_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
natives 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
natives 'com.google.ar:core:1.38.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion samples/computervision_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
2 changes: 1 addition & 1 deletion samples/geospatial_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.android.gms:play-services-auth:19.0.0'

Expand Down
4 changes: 2 additions & 2 deletions samples/hardwarebuffer_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
natives 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
natives 'com.google.ar:core:1.38.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
4 changes: 2 additions & 2 deletions samples/hardwarebuffer_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
natives 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
natives 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions samples/hello_ar_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
natives 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'
natives 'com.google.ar:core:1.38.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_ar_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import androidx.appcompat.app.AppCompatActivity;
import com.google.ar.core.Anchor;
import com.google.ar.core.ArCoreApk;
import com.google.ar.core.ArCoreApk.Availability;
import com.google.ar.core.Camera;
import com.google.ar.core.Config;
import com.google.ar.core.Config.InstantPlacementMode;
Expand Down Expand Up @@ -181,10 +182,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
surfaceView = findViewById(R.id.surfaceview);
displayRotationHelper = new DisplayRotationHelper(/*context=*/ this);
displayRotationHelper = new DisplayRotationHelper(/* context= */ this);

// Set up touch listener.
tapHelper = new TapHelper(/*context=*/ this);
tapHelper = new TapHelper(/* context= */ this);
surfaceView.setOnTouchListener(tapHelper);

// Set up renderer.
Expand Down Expand Up @@ -241,12 +242,18 @@ protected void onResume() {
Exception exception = null;
String message = null;
try {
switch (ArCoreApk.getInstance().requestInstall(this, !installRequested)) {
case INSTALL_REQUESTED:
installRequested = true;
return;
case INSTALLED:
break;
// Always check the latest availability.
Availability availability = ArCoreApk.getInstance().checkAvailability(this);

// In all other cases, try to install ARCore and handle installation failures.
if (availability != Availability.SUPPORTED_INSTALLED) {
switch (ArCoreApk.getInstance().requestInstall(this, !installRequested)) {
case INSTALL_REQUESTED:
installRequested = true;
return;
case INSTALLED:
break;
}
}

// ARCore requires camera permissions to operate. If we did not yet obtain runtime
Expand Down Expand Up @@ -344,7 +351,7 @@ public void onSurfaceCreated(SampleRender render) {
try {
planeRenderer = new PlaneRenderer(render);
backgroundRenderer = new BackgroundRenderer(render);
virtualSceneFramebuffer = new Framebuffer(render, /*width=*/ 1, /*height=*/ 1);
virtualSceneFramebuffer = new Framebuffer(render, /* width= */ 1, /* height= */ 1);

cubemapFilter =
new SpecularCubemapFilter(
Expand All @@ -355,7 +362,7 @@ public void onSurfaceCreated(SampleRender render) {
render,
Texture.Target.TEXTURE_2D,
Texture.WrapMode.CLAMP_TO_EDGE,
/*useMipmaps=*/ false);
/* useMipmaps= */ false);
// The dfg.raw file is a raw half-float texture with two channels.
final int dfgResolution = 64;
final int dfgChannels = 2;
Expand All @@ -371,11 +378,11 @@ public void onSurfaceCreated(SampleRender render) {
GLError.maybeThrowGLException("Failed to bind DFG texture", "glBindTexture");
GLES30.glTexImage2D(
GLES30.GL_TEXTURE_2D,
/*level=*/ 0,
/* level= */ 0,
GLES30.GL_RG16F,
/*width=*/ dfgResolution,
/*height=*/ dfgResolution,
/*border=*/ 0,
/* width= */ dfgResolution,
/* height= */ dfgResolution,
/* border= */ 0,
GLES30.GL_RG,
GLES30.GL_HALF_FLOAT,
buffer);
Expand All @@ -384,17 +391,20 @@ public void onSurfaceCreated(SampleRender render) {
// Point cloud
pointCloudShader =
Shader.createFromAssets(
render, "shaders/point_cloud.vert", "shaders/point_cloud.frag", /*defines=*/ null)
render,
"shaders/point_cloud.vert",
"shaders/point_cloud.frag",
/* defines= */ null)
.setVec4(
"u_Color", new float[] {31.0f / 255.0f, 188.0f / 255.0f, 210.0f / 255.0f, 1.0f})
.setFloat("u_PointSize", 5.0f);
// four entries per vertex: X, Y, Z, confidence
pointCloudVertexBuffer =
new VertexBuffer(render, /*numberOfEntriesPerVertex=*/ 4, /*entries=*/ null);
new VertexBuffer(render, /* numberOfEntriesPerVertex= */ 4, /* entries= */ null);
final VertexBuffer[] pointCloudVertexBuffers = {pointCloudVertexBuffer};
pointCloudMesh =
new Mesh(
render, Mesh.PrimitiveMode.POINTS, /*indexBuffer=*/ null, pointCloudVertexBuffers);
render, Mesh.PrimitiveMode.POINTS, /* indexBuffer= */ null, pointCloudVertexBuffers);

// Virtual object to render (ARCore pawn)
virtualObjectAlbedoTexture =
Expand Down Expand Up @@ -422,7 +432,7 @@ public void onSurfaceCreated(SampleRender render) {
render,
"shaders/environmental_hdr.vert",
"shaders/environmental_hdr.frag",
/*defines=*/ new HashMap<String, String>() {
/* defines= */ new HashMap<String, String>() {
{
put(
"NUMBER_OF_MIPMAP_LEVELS",
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_ar_kotlin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {

dependencies {
// ARCore (Google Play Services for AR) library.
implementation 'com.google.ar:core:1.37.0'
implementation 'com.google.ar:core:1.38.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down

This file was deleted.

Loading

0 comments on commit 61508d0

Please sign in to comment.