Skip to content

Commit 13e2d9a

Browse files
committed
added eye(), getObjectMatrix(), and getEyeMatrix() to PGraphics
1 parent b1b055d commit 13e2d9a

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

core/src/processing/core/PApplet.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8911,6 +8911,42 @@ public PMatrix3D getMatrix(PMatrix3D target) {
89118911
}
89128912

89138913

8914+
/**
8915+
* Returns a copy of the current object matrix.
8916+
* Pass in null to create a new matrix.
8917+
*/
8918+
public PMatrix3D getObjectMatrix() {
8919+
return g.getObjectMatrix();
8920+
}
8921+
8922+
8923+
/**
8924+
* Copy the current object matrix into the specified target.
8925+
* Pass in null to create a new matrix.
8926+
*/
8927+
public PMatrix3D getObjectMatrix(PMatrix3D target) {
8928+
return g.getObjectMatrix(target);
8929+
}
8930+
8931+
8932+
/**
8933+
* Returns a copy of the current eye matrix.
8934+
* Pass in null to create a new matrix.
8935+
*/
8936+
public PMatrix3D getEyeMatrix() {
8937+
return g.getEyeMatrix();
8938+
}
8939+
8940+
8941+
/**
8942+
* Copy the current eye matrix into the specified target.
8943+
* Pass in null to create a new matrix.
8944+
*/
8945+
public PMatrix3D getEyeMatrix(PMatrix3D target) {
8946+
return g.getEyeMatrix(target);
8947+
}
8948+
8949+
89148950
/**
89158951
* Set the current transformation matrix to the contents of another.
89168952
*/
@@ -8970,6 +9006,11 @@ public void printCamera() {
89709006
}
89719007

89729008

9009+
public void eye() {
9010+
g.eye();
9011+
}
9012+
9013+
89739014
public void ortho() {
89749015
g.ortho();
89759016
}

core/src/processing/core/PGraphics.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4006,6 +4006,46 @@ public PMatrix3D getMatrix(PMatrix3D target) {
40064006
}
40074007

40084008

4009+
/**
4010+
* Returns a copy of the current object matrix.
4011+
* Pass in null to create a new matrix.
4012+
*/
4013+
public PMatrix3D getObjectMatrix() {
4014+
showMissingWarning("getObjectMatrix");
4015+
return null;
4016+
}
4017+
4018+
4019+
/**
4020+
* Copy the current object matrix into the specified target.
4021+
* Pass in null to create a new matrix.
4022+
*/
4023+
public PMatrix3D getObjectMatrix(PMatrix3D target) {
4024+
showMissingWarning("getObjectMatrix");
4025+
return null;
4026+
}
4027+
4028+
4029+
/**
4030+
* Returns a copy of the current eye matrix.
4031+
* Pass in null to create a new matrix.
4032+
*/
4033+
public PMatrix3D getEyeMatrix() {
4034+
showMissingWarning("getEyeMatrix");
4035+
return null;
4036+
}
4037+
4038+
4039+
/**
4040+
* Copy the current eye matrix into the specified target.
4041+
* Pass in null to create a new matrix.
4042+
*/
4043+
public PMatrix3D getEyeMatrix(PMatrix3D target) {
4044+
showMissingWarning("getEyeMatrix");
4045+
return null;
4046+
}
4047+
4048+
40094049
/**
40104050
* Set the current transformation matrix to the contents of another.
40114051
*/
@@ -4074,6 +4114,10 @@ public void printCamera() {
40744114
}
40754115

40764116

4117+
public void eye() {
4118+
showMethodWarning("eye");
4119+
}
4120+
40774121

40784122
//////////////////////////////////////////////////////////////
40794123

libraries/vr/src/processing/vr/PGraphicsVR.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public void vrCoordinates(boolean v) {
6767
}
6868

6969

70+
@Override
7071
public PMatrix3D getEyeMatrix() {
7172
PMatrix3D mat = new PMatrix3D();
7273
mat.set(rightX, upX, forwardX, cameraX,
@@ -77,6 +78,7 @@ public PMatrix3D getEyeMatrix() {
7778
}
7879

7980

81+
@Override
8082
public PMatrix3D getEyeMatrix(PMatrix3D target) {
8183
if (target == null) {
8284
target = new PMatrix3D();
@@ -89,6 +91,7 @@ public PMatrix3D getEyeMatrix(PMatrix3D target) {
8991
}
9092

9193

94+
@Override
9295
public PMatrix3D getObjectMatrix() {
9396
PMatrix3D mat = new PMatrix3D();
9497
mat.set(modelviewInv);
@@ -97,6 +100,7 @@ public PMatrix3D getObjectMatrix() {
97100
}
98101

99102

103+
@Override
100104
public PMatrix3D getObjectMatrix(PMatrix3D target) {
101105
if (target == null) {
102106
target = new PMatrix3D();
@@ -107,6 +111,7 @@ public PMatrix3D getObjectMatrix(PMatrix3D target) {
107111
}
108112

109113

114+
@Override
110115
public void eye() {
111116
eyeMatrix = getEyeMatrix(eyeMatrix);
112117

0 commit comments

Comments
 (0)