UserGeometry

class UserGeometry(val location: LngLatAlt = LngLatAlt(), var phoneHeading: Double? = null, val fovDistance: Double = 50.0, val inVehicle: Boolean = false, val inMotion: Boolean = false, val speed: Double = 0.0, headingMode: UserGeometry.HeadingMode = HeadingMode.CourseAuto, travelHeading: Double? = null, headHeading: Double? = null, inStreetPreview: Boolean = false)

UserGeometry contains all of the data relating to the location and motion of the user. It's aim is to reduces the number of arguments to many of the API calls and to concentrate some of the logic around heading choice.

Parameters

phoneHeading

is the direction in which the phone is pointing

travelHeading

is the direction in which the phone is moving

headHeading

is the direction in which the head tracking is pointing (not currently implemented)

The heading prioritization comes from iOS - see https://github.com/Scottish-Tech-Army/Soundscape-Android/issues/364

collection - used for calculating callouts, two possibilities: course (travel), user (head), device (phone), or user (head), device (phone), course (travel)

presentation - user for audio positioning: user (head), course (travel), device (phone)

Constructors

Link copied to clipboard
constructor(location: LngLatAlt = LngLatAlt(), phoneHeading: Double? = null, fovDistance: Double = 50.0, inVehicle: Boolean = false, inMotion: Boolean = false, speed: Double = 0.0, headingMode: UserGeometry.HeadingMode = HeadingMode.CourseAuto, travelHeading: Double? = null, headHeading: Double? = null, inStreetPreview: Boolean = false)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val fovDistance: Double = 50.0
Link copied to clipboard
val inMotion: Boolean = false
Link copied to clipboard
val inVehicle: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val speed: Double = 0.0

Functions

Link copied to clipboard

getTriggerRange returns the distance if a POI is still in proximity after a callout

Link copied to clipboard

getSearchDistance returns the distance to use when searching for POIs

Link copied to clipboard
Link copied to clipboard
fun getTriggerRange(category: String): Double

getTriggerRange returns the distance to use when detecting POIs to call out

Link copied to clipboard
fun heading(): Double?
Link copied to clipboard