@@ -92,11 +92,68 @@ public void imageToForeground(PImage theImage, int x0, int y0, int w, int h) {
9292 renderer .imageToForeground (theImage , x0 , y0 , w , h );
9393 }
9494
95+ /* TODO: figure out a way for this to work
9596 public void imageToBackground(PImage theImage, int x0, int y0, int w, int h) {
9697 renderer.imageToBackground(theImage, x0, y0, w, h);
9798 }
99+ */
98100
101+
102+ /**
103+ * Returns the currently rendered face index.
104+ *
105+ * @return 0 == DomeCamera.POSITIVE_X
106+ * 1 == DomeCamera.NEGATIVE_X
107+ * 2 == DomeCamera.POSITIVE_Y
108+ * 3 == DomeCamera.NEGATIVE_Y
109+ * 4 == DomeCamera.POSITIVE_Z
110+ * 5 == DomeCamera.NEGATIVE_Z
111+ */
99112 public int getFace () {
100113 return renderer .getCurrentFace () - PGL .TEXTURE_CUBE_MAP_POSITIVE_X ;
101114 }
115+
116+ /**
117+ * Toggles the rendering into a cubemap face by index.
118+ *
119+ * @param theFace 0 == DomeCamera.POSITIVE_X
120+ * 1 == DomeCamera.NEGATIVE_X
121+ * 2 == DomeCamera.POSITIVE_Y
122+ * 3 == DomeCamera.NEGATIVE_Y
123+ * 4 == DomeCamera.POSITIVE_Z
124+ * 5 == DomeCamera.NEGATIVE_Z
125+ */
126+ public void toggleFaceDraw (int theFace ) {
127+ renderer .setFaceDraw (theFace , !renderer .getFaceDraw (theFace ));
128+ }
129+
130+ /**
131+ * Sets the rendering into a cubemap face by index.
132+ *
133+ * @param theFace 0 == DomeCamera.POSITIVE_X
134+ * 1 == DomeCamera.NEGATIVE_X
135+ * 2 == DomeCamera.POSITIVE_Y
136+ * 3 == DomeCamera.NEGATIVE_Y
137+ * 4 == DomeCamera.POSITIVE_Z
138+ * 5 == DomeCamera.NEGATIVE_Z
139+ * @param doDraw true or false
140+ */
141+ public void setFaceDraw (int theFace , boolean doDraw ) {
142+ renderer .setFaceDraw (theFace , doDraw );
143+ }
144+
145+ /**
146+ * Informs if a given face is being rendered into.
147+ *
148+ * @param theFace 0 == DomeCamera.POSITIVE_X
149+ * 1 == DomeCamera.NEGATIVE_X
150+ * 2 == DomeCamera.POSITIVE_Y
151+ * 3 == DomeCamera.NEGATIVE_Y
152+ * 4 == DomeCamera.POSITIVE_Z
153+ * 5 == DomeCamera.NEGATIVE_Z
154+ * @return true if the given camera is being updated.
155+ */
156+ public boolean getFaceDraw (int theFace ) {
157+ return renderer .getFaceDraw (theFace );
158+ }
102159}
0 commit comments