DistanceAttenuation.Custom


@RequiresSpatialApi(value = 4)
class DistanceAttenuation.Custom : DistanceAttenuation


Configures a custom distance attenuation model

Throws
IllegalArgumentException

if minDistance is less than 0.1, maxDistance is less than minDistance or gainAtMaxDistance is not between 0.0 and 1.0

Summary

Public constructors

Custom(
    minDistance: Float,
    maxDistance: Float,
    gainAtMaxDistance: Float,
    rolloffFactor: Float
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Float

Gain at maxDistance.

Float

Distance where attenuation reaches its maximum.

Float

Distance where attenuation begins (gain is 1.0).

Float

Custom curve shape: < 0 for inverse, > 0 for parabolic, 0 for linear.

Public constructors

Custom

Added in 1.1.0-alpha02
Custom(
    minDistance: Float,
    maxDistance: Float,
    gainAtMaxDistance: Float,
    rolloffFactor: Float
)
Parameters
minDistance: Float

Distance where attenuation begins (gain is 1.0). Must be >= 0.1.

maxDistance: Float

Distance where attenuation reaches its maximum. Must be > minDistance.

gainAtMaxDistance: Float

Gain at maxDistance. Must be in range 0.0, 1.0.

rolloffFactor: Float

Custom curve shape: < 0 for inverse, > 0 for parabolic, 0 for linear.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

gainAtMaxDistance

Added in 1.1.0-alpha02
val gainAtMaxDistance: Float

Gain at maxDistance. Must be in range 0.0, 1.0.

maxDistance

Added in 1.1.0-alpha02
val maxDistance: Float

Distance where attenuation reaches its maximum. Must be > minDistance.

minDistance

Added in 1.1.0-alpha02
val minDistance: Float

Distance where attenuation begins (gain is 1.0). Must be >= 0.1.

rolloffFactor

Added in 1.1.0-alpha02
val rolloffFactor: Float

Custom curve shape: < 0 for inverse, > 0 for parabolic, 0 for linear.