DistanceAttenuation.Linear


@RequiresSpatialApi(value = 4)
public final class DistanceAttenuation.Linear implements DistanceAttenuation


Configures linear rolloff between minDistance and maxDistance.

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

Linear(float minDistance, float maxDistance, float gainAtMaxDistance)

Public methods

boolean
equals(Object other)
final @FloatRange(from = 0.0, to = 1.0) float

Gain at maxDistance.

final @FloatRange(from = 0.1) float

Distance where attenuation reaches its maximum.

final @FloatRange(from = 0.1) float

Distance where attenuation begins (gain is 1.0).

int
@NonNull String

Public constructors

Linear

Added in 1.1.0-alpha02
public Linear(float minDistance, float maxDistance, float gainAtMaxDistance)
Parameters
float minDistance

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

float maxDistance

Distance where attenuation reaches its maximum.

float gainAtMaxDistance

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

Public methods

equals

public boolean equals(Object other)

getGainAtMaxDistance

Added in 1.1.0-alpha02
public final @FloatRange(from = 0.0, to = 1.0) float getGainAtMaxDistance()

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

getMaxDistance

Added in 1.1.0-alpha02
public final @FloatRange(from = 0.1) float getMaxDistance()

Distance where attenuation reaches its maximum.

getMinDistance

Added in 1.1.0-alpha02
public final @FloatRange(from = 0.1) float getMinDistance()

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

hashCode

public int hashCode()

toString

public @NonNull String toString()