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