Merge pull request #2146 from KiwiStrongis/master

added PMatrix.preApply( PMatrix) to resolve Issue #2145
This commit is contained in:
Ben Fry
2013-10-25 06:40:27 -07:00
3 changed files with 20 additions and 0 deletions
+2
View File
@@ -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);
+9
View File
@@ -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);
+9
View File
@@ -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,