Package-level declarations

Types

Link copied to clipboard
class ARSession(context: Context, features: Set<Session.Feature> = setOf(), val onResumed: (session: Session) -> Unit, val onPaused: (session: Session) -> Unit, val onConfigChanged: (session: Session, config: Config) -> Unit) : Session

Properties

Link copied to clipboard
val AugmentedImage.isTracking: Boolean
val Trackable.isTracking: Boolean

val Camera.isTracking: Boolean

Keep the screen unlocked while tracking, but allow it to lock when tracking stops.

Link copied to clipboard
val Pose.position: Position
Link copied to clipboard
val Pose.quaternion: Quaternion
Link copied to clipboard
val Pose.rotation: Rotation
Link copied to clipboard
val GeospatialPose.transform: Transform
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun Config.addAugmentedImage(session: Session, name: String, bitmap: Bitmap, widthInMeters: Float? = null)

Adds a single named image with known physical size to the augmented image database from an Android bitmap, with a specified physical width in meters.

Link copied to clipboard
fun Session.canHostCloudAnchor(cameraNode: ARCameraNode): Boolean
Link copied to clipboard
fun Session.configure(config: (Config) -> Unit)

Define the session config used by ARCore

Link copied to clipboard
fun Earth.createAnchor(latitude: Double, longitude: Double, altitude: Double, rotation: Rotation): Anchor
fun Earth.createAnchor(latitude: Double, longitude: Double, altitude: Double, quaternion: Quaternion): Anchor
Link copied to clipboard
fun HitResult.createAnchorOrNull(): Anchor?

Creates a new anchor at the hit location.

fun Trackable.createAnchorOrNull(pose: Pose): Anchor?

Creates an anchor that is attached to this trackable, using the given initial pose in the world coordinate space. The type of trackable will determine the semantics of attachment and how the anchor's pose will be updated to maintain this relationship. Note that the relative offset between the pose of multiple anchors attached to a trackable may adjust slightly over time as ARCore updates its model of the world.

Link copied to clipboard
fun Pose.distanceTo(other: Pose): Float

Calculate the normal distance from this to the other.

Link copied to clipboard
fun Pose.distanceToPlane(cameraPose: Pose): Float

Calculate the normal distance to plane from camera Pose

Link copied to clipboard
fun List<HitResult>.filterTypes(planeTypes: Set<Plane.Type> = setOf(), point: Boolean = false, depthPoint: Boolean = false, instantPlacementPoint: Boolean = false, trackingStates: Set<TrackingState> = setOf(TrackingState.TRACKING), pointOrientationModes: Set<Point.OrientationMode> = setOf(OrientationMode.ESTIMATED_SURFACE_NORMAL), planePoseInPolygon: Boolean = true, minCameraDistance: Pair<Camera, Float>? = null, predicate: (HitResult) -> Boolean? = null): List<HitResult>

Returns a list containing only elements matching the given parameters and predicate.

Link copied to clipboard
fun List<HitResult>.findByType(planeTypes: Set<Plane.Type> = setOf(), point: Boolean = false, depthPoint: Boolean = false, instantPlacementPoint: Boolean = false, trackingStates: Set<TrackingState> = setOf(TrackingState.TRACKING), pointOrientationModes: Set<Point.OrientationMode> = setOf(OrientationMode.ESTIMATED_SURFACE_NORMAL), planePoseInPolygon: Boolean = true, minCameraDistance: Pair<Camera, Float>? = null, predicate: (HitResult) -> Boolean? = null): HitResult?

Returns the first element matching the given predicate, or null if element was not found.

Link copied to clipboard
fun List<HitResult>.firstByTypeOrNull(planeTypes: Set<Plane.Type> = setOf(), point: Boolean = false, depthPoint: Boolean = false, instantPlacementPoint: Boolean = false, trackingStates: Set<TrackingState> = setOf(TrackingState.TRACKING), pointOrientationModes: Set<Point.OrientationMode> = setOf(OrientationMode.ESTIMATED_SURFACE_NORMAL), planePoseInPolygon: Boolean = true, minCameraDistance: Pair<Camera, Float>? = null, predicate: (HitResult) -> Boolean? = null): HitResult?

Returns the first element matching the given predicate, or null if element was not found.

Link copied to clipboard
fun Frame.fps(other: Frame?): Double
Link copied to clipboard
fun Camera.getProjectionTransform(near: Float, far: Float): Mat4
Link copied to clipboard
fun Frame.getUpdatedAugmentedFaces(): MutableCollection<AugmentedFace>

Retrieve the frame tracked Augmented Faces.

Link copied to clipboard
fun Frame.getUpdatedAugmentedImages(): MutableCollection<AugmentedImage>

Retrieve the frame tracked Augmented Images.

Link copied to clipboard

Retrieve the frame tracked Planes.

Link copied to clipboard
fun Frame.getUpdatedStreetscapeGeometries(): MutableCollection<StreetscapeGeometry>

Retrieve the frame tracked Streetscape Geometries.

Link copied to clipboard
fun Frame.getUpdatedTrackables(): MutableCollection<Trackable>

Retrieve all the frame tracked Planes.

Link copied to clipboard
inline fun <T : Trackable> Frame.hasUpdatedTrackable(trackable: T): MutableCollection<T>

Retrieve all the frame tracked Planes.

Link copied to clipboard
fun Frame.hitTest(ray: Ray): List<HitResult>

Similar to Frame.hitTest, but takes an arbitrary ray in world space coordinates instead of a screen-space point.

Link copied to clipboard
fun Frame.intervalSeconds(other: Frame?): Double
Link copied to clipboard

Retrieve if the frame is currently tracking a plane.

Link copied to clipboard
fun HitResult.isValid(planeTypes: Set<Plane.Type> = Plane.Type.values().toSet(), point: Boolean = true, depthPoint: Boolean = true, instantPlacementPoint: Boolean = true, trackingStates: Set<TrackingState> = setOf(TrackingState.TRACKING), pointOrientationModes: Set<Point.OrientationMode> = setOf(OrientationMode.ESTIMATED_SURFACE_NORMAL), planePoseInPolygon: Boolean = true, minCameraDistance: Pair<Camera, Float>? = null, predicate: (HitResult) -> Boolean? = null): Boolean

Check for hit results first valid on provided criteria.