diff --git a/libraries/include/arcore_c_api.h b/libraries/include/arcore_c_api.h
index 9b74c82da7..d0cff3d198 100644
--- a/libraries/include/arcore_c_api.h
+++ b/libraries/include/arcore_c_api.h
@@ -1331,6 +1331,15 @@ AR_DEFINE_ENUM(ArFocusMode){/// Focus is fixed.
/// Auto-focus is enabled.
AR_FOCUS_MODE_AUTO = 1};
+/// @ingroup ArConfig
+/// Selects the desired behavior of the camera flash subsystem. See the documentation
+/// page for more information on using the device's flash.
+AR_DEFINE_ENUM(ArFlashMode){/// Flash is off.
+ AR_FLASH_MODE_OFF = 0,
+ /// Flash is on.
+ AR_FLASH_MODE_TORCH = 2};
+
/// @ingroup ArConfig
/// Describes the behavior of the Electronic Image Stabilization (EIS) API. When
/// enabled, EIS smoothes the camera feed and helps correct video shakes in the
@@ -2504,6 +2513,33 @@ void ArConfig_getFocusMode(const ArSession *session,
ArConfig *config,
ArFocusMode *focus_mode);
+/// @ingroup ArConfig
+/// Gets the current camera flash mode set on this config object.
+///
+/// @param[in] session The ARCore session.
+/// @param[in] config The configuration object.
+/// @param[inout] out_flash_mode The current camera flash mode.
+void ArConfig_getFlashMode(const ArSession *session,
+ const ArConfig *config,
+ ArFlashMode *out_flash_mode);
+
+/// @ingroup ArConfig
+/// Sets the camera flash mode.
+///
+/// See @c ::ArFlashMode for available options. The default flash
+/// mode is @c #AR_FLASH_MODE_OFF. Note, on devices where camera flash hardware
+/// is not supported, calling this function will do nothing.
+/// See the documentation
+/// page for more information on how to query device flash capability.
+///
+/// @param[in] session The ARCore session.
+/// @param[in] config The configuration object.
+/// @param[in] flash_mode The desired camera flash mode.
+void ArConfig_setFlashMode(const ArSession *session,
+ ArConfig *config,
+ ArFlashMode flash_mode);
+
/// @ingroup ArConfig
/// Gets the camera image stabilization mode set on this config
/// object.
@@ -7675,7 +7711,7 @@ typedef struct ArImageMetadata_const_entry {
/// The tag identifying the entry.
uint32_t tag;
/// The data type of this metadata entry. Determines which data pointer in the
- /// @c union below is valid.
+ /// @c union below is valid. See @c ACAMERA_TYPE_* enum values in the NDK.
uint8_t type;
/// Count of elements (NOT count of bytes) in this metadata entry.
uint32_t count;
@@ -7728,7 +7764,7 @@ void ArImageMetadata_getAllKeys(const ArSession *session,
/// Get a metadata entry for the provided @c ::ArImageMetadata and tag.
///
/// The returned @p out_metadata_entry remains valid until the provided @p
-/// image_metadata is released via @c ::ArFrame_acquireImageMetadata.
+/// image_metadata is released via @c ::ArImageMetadata_release.
///
/// @param[in] session The ARCore session.
/// @param[in] image_metadata @c ::ArImageMetadata struct obtained from
diff --git a/samples/augmented_faces_java/app/build.gradle b/samples/augmented_faces_java/app/build.gradle
index 8486d040d3..5f155610c6 100644
--- a/samples/augmented_faces_java/app/build.gradle
+++ b/samples/augmented_faces_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/augmented_image_c/app/build.gradle b/samples/augmented_image_c/app/build.gradle
index dc47f9281f..f5ffb81bfb 100644
--- a/samples/augmented_image_c/app/build.gradle
+++ b/samples/augmented_image_c/app/build.gradle
@@ -68,8 +68,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/augmented_image_java/app/build.gradle b/samples/augmented_image_java/app/build.gradle
index 8de766a773..21acb7e1a2 100644
--- a/samples/augmented_image_java/app/build.gradle
+++ b/samples/augmented_image_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/cloud_anchor_java/app/build.gradle b/samples/cloud_anchor_java/app/build.gradle
index 96b20303c4..7eff627159 100644
--- a/samples/cloud_anchor_java/app/build.gradle
+++ b/samples/cloud_anchor_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/computervision_c/app/build.gradle b/samples/computervision_c/app/build.gradle
index f5727ec7ab..f77f3f369f 100644
--- a/samples/computervision_c/app/build.gradle
+++ b/samples/computervision_c/app/build.gradle
@@ -68,8 +68,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/computervision_java/app/build.gradle b/samples/computervision_java/app/build.gradle
index ed8494f456..393f657524 100644
--- a/samples/computervision_java/app/build.gradle
+++ b/samples/computervision_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/geospatial_java/app/build.gradle b/samples/geospatial_java/app/build.gradle
index 9045a78eb0..349c68cf5f 100644
--- a/samples/geospatial_java/app/build.gradle
+++ b/samples/geospatial_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
diff --git a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/hardwarebuffer_c/app/build.gradle b/samples/hardwarebuffer_c/app/build.gradle
index acccc2f700..d06f8d9d3c 100644
--- a/samples/hardwarebuffer_c/app/build.gradle
+++ b/samples/hardwarebuffer_c/app/build.gradle
@@ -70,8 +70,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hardwarebuffer_java/app/build.gradle b/samples/hardwarebuffer_java/app/build.gradle
index 4476dd6fa0..5296a6051d 100644
--- a/samples/hardwarebuffer_java/app/build.gradle
+++ b/samples/hardwarebuffer_java/app/build.gradle
@@ -66,8 +66,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/hello_ar_c/app/build.gradle b/samples/hello_ar_c/app/build.gradle
index 25bd561066..e5711524cb 100644
--- a/samples/hello_ar_c/app/build.gradle
+++ b/samples/hello_ar_c/app/build.gradle
@@ -68,8 +68,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hello_ar_java/app/build.gradle b/samples/hello_ar_java/app/build.gradle
index 7674997f13..ccd567456d 100644
--- a/samples/hello_ar_java/app/build.gradle
+++ b/samples/hello_ar_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/hello_ar_kotlin/app/build.gradle b/samples/hello_ar_kotlin/app/build.gradle
index 3d6cf522ad..deab2aad14 100644
--- a/samples/hello_ar_kotlin/app/build.gradle
+++ b/samples/hello_ar_kotlin/app/build.gradle
@@ -45,7 +45,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/hello_ar_vulkan_c/app/build.gradle b/samples/hello_ar_vulkan_c/app/build.gradle
index 9264f94822..5bc4a20ff2 100644
--- a/samples/hello_ar_vulkan_c/app/build.gradle
+++ b/samples/hello_ar_vulkan_c/app/build.gradle
@@ -69,8 +69,8 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
- natives 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
+ natives 'com.google.ar:core:1.45.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hello_eis_kotlin/app/build.gradle b/samples/hello_eis_kotlin/app/build.gradle
index d86b883835..09e0c49858 100644
--- a/samples/hello_eis_kotlin/app/build.gradle
+++ b/samples/hello_eis_kotlin/app/build.gradle
@@ -45,7 +45,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/ml_kotlin/app/build.gradle b/samples/ml_kotlin/app/build.gradle
index 7f54a29e7a..c2aa524288 100644
--- a/samples/ml_kotlin/app/build.gradle
+++ b/samples/ml_kotlin/app/build.gradle
@@ -69,7 +69,7 @@ dependencies {
implementation 'com.google.mlkit:object-detection-custom:16.3.1'
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/persistent_cloud_anchor_java/app/build.gradle b/samples/persistent_cloud_anchor_java/app/build.gradle
index a227a774b0..d228b32d67 100644
--- a/samples/persistent_cloud_anchor_java/app/build.gradle
+++ b/samples/persistent_cloud_anchor_java/app/build.gradle
@@ -45,7 +45,7 @@ repositories {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/raw_depth_java/app/build.gradle b/samples/raw_depth_java/app/build.gradle
index b4f9068c8a..962cc3020e 100644
--- a/samples/raw_depth_java/app/build.gradle
+++ b/samples/raw_depth_java/app/build.gradle
@@ -42,7 +42,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/recording_playback_java/app/build.gradle b/samples/recording_playback_java/app/build.gradle
index c728e4d24c..16c95bd69f 100644
--- a/samples/recording_playback_java/app/build.gradle
+++ b/samples/recording_playback_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/semantics_java/app/build.gradle b/samples/semantics_java/app/build.gradle
index 9df67b4ebc..602bfbb3d1 100644
--- a/samples/semantics_java/app/build.gradle
+++ b/samples/semantics_java/app/build.gradle
@@ -41,7 +41,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java
index 6585d445db..53ea620618 100644
--- a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java
+++ b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java
@@ -333,10 +333,10 @@ public void onDrawFrame(SampleRender render) {
message = TrackingStateHelper.getTrackingFailureReasonString(camera);
}
}
- if (message == null) {
- messageSnackbarHelper.hide(this);
- } else {
+ if (message != null && !message.isEmpty()) {
messageSnackbarHelper.showMessage(this, message);
+ } else if (messageSnackbarHelper.isDurationIndefinite()) {
+ messageSnackbarHelper.hide(this);
}
// -- Draw background
diff --git a/samples/shared_camera_java/app/build.gradle b/samples/shared_camera_java/app/build.gradle
index 97b2fd86f5..7564a133e4 100644
--- a/samples/shared_camera_java/app/build.gradle
+++ b/samples/shared_camera_java/app/build.gradle
@@ -42,7 +42,7 @@ android {
dependencies {
// ARCore (Google Play Services for AR) library.
- implementation 'com.google.ar:core:1.44.0'
+ implementation 'com.google.ar:core:1.45.0'
// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
diff --git a/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
index cc493013ee..d251ec9683 100644
--- a/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
+++ b/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java
@@ -92,6 +92,11 @@ public void setMaxLines(int lines) {
maxLines = lines;
}
+ /** Returns whether the snackbar is currently being shown with an indefinite duration. */
+ public boolean isDurationIndefinite() {
+ return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE;
+ }
+
/**
* Sets the view that will be used to find a suitable parent view to hold the Snackbar view.
*
diff --git a/third_party/glm/common.hpp b/third_party/glm/common.hpp
index 0328dc91ee..badaf0f522 100644
--- a/third_party/glm/common.hpp
+++ b/third_party/glm/common.hpp
@@ -51,7 +51,7 @@ namespace glm
/// @see GLSL sign man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
template
- GLM_FUNC_DECL vec sign(vec const& x);
+ GLM_FUNC_DECL GLM_CONSTEXPR vec sign(vec const& x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
@@ -291,7 +291,7 @@ namespace glm
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
///
/// @code
- /// #include
+ /// #include "third_party/glm/latest/glm/glm.hpp"
/// ...
/// float a;
/// bool b;
@@ -306,13 +306,13 @@ namespace glm
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template
- GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
+ GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
template
- GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a);
+ GLM_FUNC_DECL GLM_CONSTEXPR vec mix(vec const& x, vec const& y, vec const& a);
template
- GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a);
+ GLM_FUNC_DECL GLM_CONSTEXPR vec mix(vec const& x, vec const& y, U a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
@@ -404,7 +404,7 @@ namespace glm
///
/// @see GLSL floatBitsToInt man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL int floatBitsToInt(float const& v);
+ GLM_FUNC_DECL int floatBitsToInt(float v);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint
@@ -424,7 +424,7 @@ namespace glm
///
/// @see GLSL floatBitsToUint man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL uint floatBitsToUint(float const& v);
+ GLM_FUNC_DECL uint floatBitsToUint(float v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
@@ -446,7 +446,7 @@ namespace glm
///
/// @see GLSL intBitsToFloat man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL float intBitsToFloat(int const& v);
+ GLM_FUNC_DECL float intBitsToFloat(int v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
@@ -470,7 +470,7 @@ namespace glm
///
/// @see GLSL uintBitsToFloat man page
/// @see GLSL 4.20.8 specification, section 8.3 Common Functions
- GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
+ GLM_FUNC_DECL float uintBitsToFloat(uint v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
diff --git a/third_party/glm/detail/_swizzle.hpp b/third_party/glm/detail/_swizzle.hpp
index 87896ef4f6..e1f57ccb77 100644
--- a/third_party/glm/detail/_swizzle.hpp
+++ b/third_party/glm/detail/_swizzle.hpp
@@ -8,8 +8,8 @@ namespace detail
struct _swizzle_base0
{
protected:
- GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; }
- GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; }
+ GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast(_buffer))[i]; }
+ GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast(_buffer))[i]; }
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
// The size 1 buffer is assumed to aligned to the actual members so that the
@@ -113,12 +113,12 @@ namespace detail
_apply_op(that, op_div());
}
- GLM_FUNC_QUALIFIER T& operator[](size_t i)
+ GLM_FUNC_QUALIFIER T& operator[](int i)
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
- GLM_FUNC_QUALIFIER T operator[](size_t i) const
+ GLM_FUNC_QUALIFIER T operator[](int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
@@ -147,7 +147,7 @@ namespace detail
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
- GLM_FUNC_QUALIFIER T operator[] (size_t i) const
+ GLM_FUNC_QUALIFIER T operator[] (int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
diff --git a/third_party/glm/detail/_swizzle_func.hpp b/third_party/glm/detail/_swizzle_func.hpp
index d93c6afd5b..a264ae9eff 100644
--- a/third_party/glm/detail/_swizzle_func.hpp
+++ b/third_party/glm/detail/_swizzle_func.hpp
@@ -1,40 +1,40 @@
#pragma once
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \
- vec<2, T, Q> A ## B() CONST \
+ GLM_FUNC_QUALIFIER vec<2, T, Q> A ## B() CONST \
{ \
return vec<2, T, Q>(this->A, this->B); \
}
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \
- vec<3, T, Q> A ## B ## C() CONST \
+ GLM_FUNC_QUALIFIER vec<3, T, Q> A ## B ## C() CONST \
{ \
return vec<3, T, Q>(this->A, this->B, this->C); \
}
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \
- vec<4, T, Q> A ## B ## C ## D() CONST \
+ GLM_FUNC_QUALIFIER vec<4, T, Q> A ## B ## C ## D() CONST \
{ \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
template \
- vec vec::A ## B() CONST \
+ GLM_FUNC_QUALIFIER vec vec::A ## B() CONST \
{ \
return vec<2, T, Q>(this->A, this->B); \
}
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
template \
- vec<3, T, Q> vec::A ## B ## C() CONST \
+ GLM_FUNC_QUALIFIER vec<3, T, Q> vec::A ## B ## C() CONST \
{ \
return vec<3, T, Q>(this->A, this->B, this->C); \
}
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
template \
- vec<4, T, Q> vec::A ## B ## C ## D() CONST \
+ GLM_FUNC_QUALIFIER vec<4, T, Q> vec::A ## B ## C ## D() CONST \
{ \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}
diff --git a/third_party/glm/detail/compute_common.hpp b/third_party/glm/detail/compute_common.hpp
index cc24b9e62f..83362bc7b3 100644
--- a/third_party/glm/detail/compute_common.hpp
+++ b/third_party/glm/detail/compute_common.hpp
@@ -16,7 +16,7 @@ namespace detail
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
{
GLM_STATIC_ASSERT(
- std::numeric_limits::is_iec559 || std::numeric_limits::is_signed,
+ std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_signed,
"'abs' only accept floating-point and integer scalar or vector inputs");
return x >= genFIType(0) ? x : -x;
@@ -24,11 +24,11 @@ namespace detail
}
};
-#if GLM_COMPILER & GLM_COMPILER_CUDA
+#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
template<>
struct compute_abs
{
- GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x)
+ GLM_FUNC_QUALIFIER static float call(float x)
{
return fabsf(x);
}
diff --git a/third_party/glm/detail/compute_vector_decl.hpp b/third_party/glm/detail/compute_vector_decl.hpp
new file mode 100644
index 0000000000..00d7de5e1d
--- /dev/null
+++ b/third_party/glm/detail/compute_vector_decl.hpp
@@ -0,0 +1,190 @@
+
+#pragma once
+#include
+#include "_vectorize.hpp"
+
+namespace glm {
+ namespace detail
+ {
+ template
+ struct compute_vec_add {};
+
+ template
+ struct compute_vec_sub {};
+
+ template
+ struct compute_vec_mul {};
+
+ template
+ struct compute_vec_div {};
+
+ template
+ struct compute_vec_mod {};
+
+ template
+ struct compute_splat {};
+
+ template
+ struct compute_vec_and {};
+
+ template
+ struct compute_vec_or {};
+
+ template
+ struct compute_vec_xor {};
+
+ template
+ struct compute_vec_shift_left {};
+
+ template
+ struct compute_vec_shift_right {};
+
+ template
+ struct compute_vec_equal {};
+
+ template
+ struct compute_vec_nequal {};
+
+ template
+ struct compute_vec_bitwise_not {};
+
+ template
+ struct compute_vec_add
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ return detail::functor2::call(std::plus(), a, b);
+ }
+ };
+
+ template
+ struct compute_vec_sub
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ return detail::functor2::call(std::minus(), a, b);
+ }
+ };
+
+ template
+ struct compute_vec_mul
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ return detail::functor2::call(std::multiplies(), a, b);
+ }
+ };
+
+ template
+ struct compute_vec_div
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ return detail::functor2::call(std::divides(), a, b);
+ }
+ };
+
+ template
+ struct compute_vec_mod
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ return detail::functor2::call(std::modulus(), a, b);
+ }
+ };
+
+ template
+ struct compute_vec_and
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] &= static_cast(b[i]);
+ return v;
+ }
+ };
+
+ template
+ struct compute_vec_or
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] |= static_cast(b[i]);
+ return v;
+ }
+ };
+
+ template
+ struct compute_vec_xor
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] ^= static_cast(b[i]);
+ return v;
+ }
+ };
+
+ template
+ struct compute_vec_shift_left
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] <<= static_cast(b[i]);
+ return v;
+ }
+ };
+
+ template
+ struct compute_vec_shift_right
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] >>= static_cast(b[i]);
+ return v;
+ }
+ };
+
+ template
+ struct compute_vec_equal
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec const& v1, vec const& v2)
+ {
+ bool b = true;
+ for (length_t i = 0; i < L; ++i)
+ b = b && detail::compute_equal::is_iec559>::call(v1.x, v2.x);
+ return b;
+ }
+ };
+
+ template
+ struct compute_vec_nequal
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
+ {
+ return !compute_vec_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2);
+ }
+ };
+
+ template
+ struct compute_vec_bitwise_not
+ {
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a)
+ {
+ vec v(a);
+ for (length_t i = 0; i < L; ++i)
+ v[i] = ~v[i];
+ return v;
+ }
+ };
+
+ }
+}
diff --git a/third_party/glm/detail/func_common.inl b/third_party/glm/detail/func_common.inl
index 4b5f14410f..f8584c9e87 100644
--- a/third_party/glm/detail/func_common.inl
+++ b/third_party/glm/detail/func_common.inl
@@ -16,7 +16,7 @@ namespace glm
template
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs");
return (y < x) ? y : x;
}
@@ -24,7 +24,7 @@ namespace glm
template
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs");
return (x < y) ? y : x;
}
@@ -44,7 +44,7 @@ namespace glm
template
GLM_FUNC_QUALIFIER genType round(genType x)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'round' only accept floating-point inputs");
return x < static_cast(0) ? static_cast(int(x - static_cast(0.5))) : static_cast(int(x + static_cast(0.5)));
}
@@ -57,7 +57,7 @@ namespace glm
template
GLM_FUNC_QUALIFIER genType trunc(genType x)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'trunc' only accept floating-point inputs");
return x < static_cast(0) ? -std::floor(-x) : std::floor(x);
}
@@ -80,9 +80,9 @@ namespace detail
template
struct compute_mix_vector
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, vec const& a)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vec(vec(x) * (static_cast(1) - a) + vec(y) * a);
}
@@ -91,9 +91,9 @@ namespace detail
template
struct compute_mix_vector
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, vec const& a)
{
- vec Result;
+ vec Result(0);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = a[i] ? y[i] : x[i];
return Result;
@@ -103,9 +103,9 @@ namespace detail
template
struct compute_mix_scalar
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, U const& a)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vec(vec(x) * (static_cast(1) - a) + vec(y) * a);
}
@@ -114,7 +114,7 @@ namespace detail
template
struct compute_mix_scalar
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, bool const& a)
{
return a ? y : x;
}
@@ -123,9 +123,9 @@ namespace detail
template
struct compute_mix
{
- GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(T const& x, T const& y, U const& a)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return static_cast(static_cast(x) * (static_cast(1) - a) + static_cast(y) * a);
}
@@ -134,7 +134,7 @@ namespace detail
template
struct compute_mix
{
- GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, bool const& a)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(T const& x, T const& y, bool const& a)
{
return a ? y : x;
}
@@ -143,7 +143,7 @@ namespace detail
template
struct compute_sign
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x)
{
return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0)));
}
@@ -153,7 +153,7 @@ namespace detail
template
struct compute_sign
{
- GLM_FUNC_QUALIFIER static vec call(vec const& x)
+ GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x)
{
T const Shift(static_cast(sizeof(T) * 8 - 1));
vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift));
@@ -213,7 +213,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs.");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mod' only accept floating-point inputs. Include for integer inputs.");
return a - b * floor(a / b);
}
};
@@ -259,7 +259,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x)
{
- GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
+ GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast