private void translateRelative(SpriterAbstractObject @object, SpriterAbstractObject parent) { @object.setAngle(@object.getAngle() * this.flippedX * this.flippedY + parent.getAngle() ); @object.setScaleX(@object.getScaleX() * parent.getScaleX()); @object.setScaleY(@object.getScaleY() * parent.getScaleY()); SpriterCalculator.translateRelative(parent, @object); }
private void interpolateAbstractObject(SpriterAbstractObject target, SpriterAbstractObject obj1, SpriterAbstractObject obj2, float startTime, float endTime) { if (obj2 == null) { return; } target.setX(this.interpolate(obj1.getX(), obj2.getX(), startTime, endTime, this.frame )); target.setY(this.interpolate(obj1.getY(), obj2.getY(), startTime, endTime, this.frame )); target.setScaleX(this.interpolate(obj1.getScaleX(), obj2.getScaleX(), startTime, endTime, this.frame)); target.setScaleY(this.interpolate(obj1.getScaleY(), obj2.getScaleY(), startTime, endTime, this.frame)); target.setAngle(this.interpolateAngle(obj1.getAngle(), obj2.getAngle(), startTime , endTime, this.frame)); }