MutableCubic


public final class MutableCubic extends Cubic


This is a Mutable version of Cubic, used mostly for performance critical paths so we can avoid creating new Cubics

This is used in Morph.forEachCubic, reusing a MutableCubic instance to avoid creating new Cubics.

Summary

Public constructors

Public methods

final void
interpolate(@NonNull Cubic c1, @NonNull Cubic c2, float progress)
final void

Inherited methods

From androidx.graphics.shapes.Cubic
final @NonNull Cubic
div(float x)

Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"

final @NonNull Cubic
div(int x)

Operator overload to enable dividing Cubics by a scalar value x, like "c0 / x"

boolean
equals(Object other)
final float

The first anchor point x coordinate

final float

The first anchor point y coordinate

final float

The second anchor point x coordinate

final float

The second anchor point y coordinate

final float

The first control point x coordinate

final float

The first control point y coordinate

final float

The second control point x coordinate

final float

The second control point y coordinate

int
final @NonNull Cubic

Operator overload to enable adding Cubic objects together, like "c0 + c1"

final @NonNull Cubic

Utility function to reverse the control/anchor points for this curve.

final @NonNull Pair<@NonNull Cubic, @NonNull Cubic>
split(float t)

Returns two Cubics, created by splitting this curve at the given distance of t between the original starting and ending anchor points.

final @NonNull Cubic
times(float x)

Operator overload to enable multiplying Cubics by a scalar value x, like "c0 * x"

final @NonNull Cubic
times(int x)

Operator overload to enable multiplying Cubics by an Int scalar value x, like "c0 * x"

@NonNull String
final @NonNull Cubic

Transforms the points in this Cubic with the given PointTransformer and returns a new Cubic

Public constructors

MutableCubic

Added in 1.0.1
public MutableCubic()

Public methods

interpolate

Added in 1.0.1
public final void interpolate(@NonNull Cubic c1, @NonNull Cubic c2, float progress)

transform

Added in 1.0.1
public final void transform(@NonNull PointTransformer f)