DampingNode


public final class DampingNode extends ValueNode


A ValueNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

Summary

Public constructors

DampingNode(
    @NonNull ProgressDomain dampOver,
    float strength,
    @NonNull ValueNode input
)

Creates a DampingNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

Public methods

boolean
equals(Object other)
final @NonNull ProgressDomain

The domain units over which damping is applied.

final @NonNull ValueNode

The input node that produces the value to be modified by the damping.

final float

The amount of damping to apply.

int
@NonNull String

Inherited methods

From androidx.ink.brush.behavior.Node
final @NonNull Version

Returns the minimum required Version for this Node.

final @NonNull List<@NonNull ValueNode>

The ordered list of inputs that this node directly depends on.

Public constructors

DampingNode

Added in 1.1.0-alpha08
public DampingNode(
    @NonNull ProgressDomain dampOver,
    float strength,
    @NonNull ValueNode input
)

Creates a DampingNode that damps changes in an input value, causing the output value to slowly follow changes in the input value over a specified time or distance.

If dampOver is ProgressDomain.DISTANCE_IN_CENTIMETERS and the stroke input data does not indicate the relationship between stroke units and physical units (e.g. as may be the case for programmatically-generated inputs), then the output value will be null regardless of the input.

Parameters
@NonNull ProgressDomain dampOver

The domain units over which damping is applied.

float strength

A scaling factor, in dampOver units, for the damping. A smaller strength value results in less damping, so the output follows the input more closely.

@NonNull ValueNode input

input node that produces the value to be modified by the damping

Public methods

equals

public boolean equals(Object other)

getDampOver

Added in 1.1.0-alpha08
public final @NonNull ProgressDomain getDampOver()

The domain units over which damping is applied.

getInput

Added in 1.1.0-alpha08
public final @NonNull ValueNode getInput()

The input node that produces the value to be modified by the damping.

getStrength

Added in 1.1.0-alpha08
public final float getStrength()

The amount of damping to apply.

hashCode

public int hashCode()

toString

public @NonNull String toString()