@Override public Vector2 interpolate (Vector2 target, float alpha, Interpolation interpolation) { return lerp(target, interpolation.apply(alpha)); }
@Override public Vector2 interpolate (Vector2 target, float alpha, Interpolation interpolation) { return lerp(target, interpolation.apply(alpha)); }
public VertexInfo lerp (final VertexInfo target, float alpha) { if (hasPosition && target.hasPosition) position.lerp(target.position, alpha); if (hasNormal && target.hasNormal) normal.lerp(target.normal, alpha); if (hasColor && target.hasColor) color.lerp(target.color, alpha); if (hasUV && target.hasUV) uv.lerp(target.uv, alpha); return this; } }
public VertexInfo lerp (final VertexInfo target, float alpha) { if (hasPosition && target.hasPosition) position.lerp(target.position, alpha); if (hasNormal && target.hasNormal) normal.lerp(target.normal, alpha); if (hasColor && target.hasColor) color.lerp(target.color, alpha); if (hasUV && target.hasUV) uv.lerp(target.uv, alpha); return this; } }
lerping1.lerp(lerpTarget, 0.025f);
@Override public Vector2 interpolate (Vector2 target, float alpha, Interpolation interpolation) { return lerp(target, interpolation.apply(alpha)); }
@Override public Vector2 interpolate (Vector2 target, float alpha, Interpolation interpolation) { return lerp(target, interpolation.apply(alpha)); }
tmp.lerp(tmp2, zoomFactor * 0.35f);
/** Interpolate between the specified render states, by the specified quantity. */ public static EntityRenderState interpolate (EntityRenderState previous, EntityRenderState current, float alpha) { result.position.set(previous.position); result.position.set(result.position.lerp(current.position, alpha)); float curr = current.orientation; float prev = previous.orientation; boolean hasWrapped = ((curr > 0 && prev < 0) || (prev > 0 && curr < 0)); boolean needWrap = hasWrapped && (Math.abs(curr) + Math.abs(prev) > 1f); if (needWrap) { if (prev < 0) { prev += AMath.TWO_PI; } else { curr += AMath.TWO_PI; } result.orientation = curr * alpha + prev * (1 - alpha); result.orientation = -(AMath.TWO_PI - result.orientation); // Debug.print( "curr=%.4f, prev=%.4f, res=%.4f", current.orientation, previous.orientation, // result.orientation ); } else { result.orientation = current.orientation * alpha + previous.orientation * (1 - alpha); } return result; }
public VertexInfo lerp(final VertexInfo target, float alpha) { if (hasPosition && target.hasPosition) position.lerp(target.position, alpha); if (hasNormal && target.hasNormal) normal.lerp(target.normal, alpha); if (hasColor && target.hasColor) color.lerp(target.color, alpha); if (hasUV && target.hasUV) uv.lerp(target.uv, alpha); return this; } }
public VertexInfo lerp (final VertexInfo target, float alpha) { if (hasPosition && target.hasPosition) position.lerp(target.position, alpha); if (hasNormal && target.hasNormal) normal.lerp(target.normal, alpha); if (hasColor && target.hasColor) color.lerp(target.color, alpha); if (hasUV && target.hasUV) uv.lerp(target.uv, alpha); return this; } }
offset.lerp(target, 0.5f);
mouse.set(board.snapToGrid(piece, mouse)); piece.pos.lerp(mouse, DRAG_SPEED); piece.cellSize = Interpolation.linear.apply(piece.cellSize, pickedCellSize, DRAG_SPEED); piece.pos.lerp(new Vector2(original.x, original.y), 0.3f); piece.cellSize = Interpolation.linear.apply(piece.cellSize, original.width, 0.3f);