diff --git a/core/src/processing/core/PMatrix.java b/core/src/processing/core/PMatrix.java index 53f7fa54b..2670eb5ce 100644 --- a/core/src/processing/core/PMatrix.java +++ b/core/src/processing/core/PMatrix.java @@ -97,6 +97,8 @@ public interface PMatrix { /** * Apply another matrix to the left of this one. */ + public void preApply(PMatrix left); + public void preApply(PMatrix2D left); public void preApply(PMatrix3D left); diff --git a/core/src/processing/core/PMatrix2D.java b/core/src/processing/core/PMatrix2D.java index d5616b58d..1ee6b0a88 100644 --- a/core/src/processing/core/PMatrix2D.java +++ b/core/src/processing/core/PMatrix2D.java @@ -247,6 +247,15 @@ public class PMatrix2D implements PMatrix { /** * Apply another matrix to the left of this one. */ + public void preApply(PMatrix source) { + if (source instanceof PMatrix2D) { + preApply((PMatrix2D) source); + } else if (source instanceof PMatrix3D) { + preApply((PMatrix3D) source); + } + } + + public void preApply(PMatrix2D left) { preApply(left.m00, left.m01, left.m02, left.m10, left.m11, left.m12); diff --git a/core/src/processing/core/PMatrix3D.java b/core/src/processing/core/PMatrix3D.java index deeb23b45..f75cb1227 100644 --- a/core/src/processing/core/PMatrix3D.java +++ b/core/src/processing/core/PMatrix3D.java @@ -369,6 +369,15 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { /** * Apply another matrix to the left of this one. */ + public void preApply(PMatrix source) { + if (source instanceof PMatrix2D) { + preApply((PMatrix2D) source); + } else if (source instanceof PMatrix3D) { + preApply((PMatrix3D) source); + } + } + + public void preApply(PMatrix3D left) { preApply(left.m00, left.m01, left.m02, left.m03, left.m10, left.m11, left.m12, left.m13,