Skip to content

Commit ffd25c3

Browse files
committed
moving a couple of things around
1 parent e94dc77 commit ffd25c3

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

core/src/processing/core/PConstants.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ public interface PConstants {
4848
static final String P2D = "processing.opengl.PGraphics2D";
4949
static final String P3D = "processing.opengl.PGraphics3D";
5050
static final String OPENGL = P3D;
51-
static final String PVR = "processing.vr.PGraphicsVRStereo";
52-
static final String STEREO = PVR;
51+
static final String STEREO = "processing.vr.PGraphicsVRStereo";
5352
static final String MONO = "processing.vr.PGraphicsVRMono";
54-
static final String PAR = "processing.ar.PGraphicsAR";
55-
static final String AUGMENT = PAR;
56-
static final String ARCORE = PAR;
53+
static final String AUGMENT = "processing.ar.PGraphicsAR";
54+
static final String ARCORE = AUGMENT;
5755

5856
// The PDF and DXF renderers are not available for Android.
5957

debug/apps/arscene/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ android {
44
compileSdkVersion 26
55
defaultConfig {
66
applicationId "processing.tests.arscene"
7-
minSdkVersion 19
7+
minSdkVersion 23
88
targetSdkVersion 26
99
versionCode 1
1010
versionName "1.0"

debug/apps/arscene/src/main/java/arscene/Sketch.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ public class Sketch extends PApplet {
77
float angle = 0;
88

99
public void settings() {
10-
fullScreen(ARCORE);
10+
fullScreen(AUGMENT);
1111
}
1212

1313
public void setup() {
14-
ARPlane.setPlaneColor(0xB4E7FF);
14+
PAR.planeColor(0xB4E7FF);
1515
}
1616

1717
public void draw() {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package processing.ar;
2+
3+
public class PAR {
4+
static public void planeColor(int color) {
5+
ARPlane.setPlaneColor(color);
6+
}
7+
}

mode/libraries/ar/src/processing/ar/PGraphicsAR.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public void beginDraw() {
6666
protected void backgroundImpl() {
6767
surfar.renderBackground();
6868

69+
surfar.getAnchors();
70+
71+
6972
// The helpers (planes, point clouds, should be drawn using Processing primitives, so this could
7073
// go after updateView() in beginDraw().
7174
surfar.renderHelpers();

mode/libraries/ar/src/processing/ar/PSurfaceAR.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ protected void updateMatrices() {
314314
camera.getViewMatrix(viewmtx, 0);
315315
}
316316

317+
protected void getAnchors() {
318+
for (Anchor anchor : anchors) {
319+
if (anchor.getTrackingState() != TrackingState.TRACKING) {
320+
continue;
321+
}
322+
anchor.getPose().toMatrix(anchorMatrix, 0);
323+
}
324+
}
325+
317326
protected void renderHelpers() {
318327
// This should be enabled/disabled with a parameter...
319328
// PointCloud foundPointCloud = frame.acquirePointCloud();
@@ -324,12 +333,6 @@ protected void renderHelpers() {
324333
// Same with the planes...
325334
planeRenderer.drawPlanes(
326335
session.getAllTrackables(Plane.class), camera.getDisplayOrientedPose(), projmtx);
327-
for (Anchor anchor : anchors) {
328-
if (anchor.getTrackingState() != TrackingState.TRACKING) {
329-
continue;
330-
}
331-
anchor.getPose().toMatrix(anchorMatrix, 0);
332-
}
333336
}
334337

335338

0 commit comments

Comments
 (0)