|
|
|
|
|
|
return b * t; |
|
|
|
if (b == null) |
|
|
|
return a * (1.0f - t); |
|
|
|
if (a is Alignment && b is Alignment) |
|
|
|
return Alignment.lerp(a, b, t); |
|
|
|
if (a is AlignmentDirectional && b is AlignmentDirectional) |
|
|
|
return AlignmentDirectional.lerp(a, b, t); |
|
|
|
if (a is Alignment _a && b is Alignment _b) |
|
|
|
return Alignment.lerpAlignment(_a, _b, t); |
|
|
|
if (a is AlignmentDirectional _ad && b is AlignmentDirectional _bd) |
|
|
|
return AlignmentDirectional.lerpAlignmentDirectional(_ad, _bd, t); |
|
|
|
return new _MixedAlignment( |
|
|
|
MathUtils.lerpNullableFloat(a._x, b._x, t), |
|
|
|
MathUtils.lerpNullableFloat(a._start, b._start, t), |
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public static Alignment lerp(Alignment a, Alignment b, float t) { |
|
|
|
public static Alignment lerpAlignment(Alignment a, Alignment b, float t) { |
|
|
|
if (a == null && b == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
return new AlignmentDirectional(start % other, y % other); |
|
|
|
} |
|
|
|
|
|
|
|
static AlignmentDirectional lerp(AlignmentDirectional a, AlignmentDirectional b, float t) { |
|
|
|
public static AlignmentDirectional lerpAlignmentDirectional(AlignmentDirectional a, AlignmentDirectional b, float t) { |
|
|
|
D.assert(t != null); |
|
|
|
if (a == null && b == null) |
|
|
|
return null; |
|
|
|