Only get Fields to Interpolate in Interpolation implementations if not done before -> massive performance increase
This commit is contained in:
@@ -22,9 +22,11 @@ public class GenericLinearInterpolation<T extends KeyframeValue> implements Inte
|
|||||||
public void addPoint(T point) {
|
public void addPoint(T point) {
|
||||||
points.add(point);
|
points.add(point);
|
||||||
|
|
||||||
|
if(fields == null) {
|
||||||
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
|
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
|
||||||
this.fields = fields.toArray(new Field[fields.size()]);
|
this.fields = fields.toArray(new Field[fields.size()]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyPoint(float position, T toEdit) {
|
public void applyPoint(float position, T toEdit) {
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ public class GenericSplineInterpolation<T extends KeyframeValue> extends BasicSp
|
|||||||
public void addPoint(T point) {
|
public void addPoint(T point) {
|
||||||
this.points.add(point);
|
this.points.add(point);
|
||||||
|
|
||||||
|
if(fields == null) {
|
||||||
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
|
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
|
||||||
this.fields = fields.toArray(new Field[fields.size()]);
|
this.fields = fields.toArray(new Field[fields.size()]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void prepare() {
|
public void prepare() {
|
||||||
|
|||||||
Reference in New Issue
Block a user