picrate 0.2.0-java → 0.3.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -5
- data/Rakefile +10 -2
- data/docs/_posts/2018-06-26-auto_install_picrate.md +15 -0
- data/lib/export.txt +8 -0
- data/lib/picrate/app.rb +4 -4
- data/lib/picrate/version.rb +1 -1
- data/picrate.gemspec +1 -1
- data/pom.rb +1 -1
- data/pom.xml +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +16 -85
- data/src/main/java/processing/awt/PShapeJava2D.java +9 -33
- data/src/main/java/processing/awt/PSurfaceAWT.java +76 -169
- data/src/main/java/processing/core/PApplet.java +14019 -15963
- data/src/main/java/processing/core/PConstants.java +475 -981
- data/src/main/java/processing/core/PFont.java +50 -202
- data/src/main/java/processing/core/PGraphics.java +7330 -8477
- data/src/main/java/processing/core/PImage.java +42 -212
- data/src/main/java/processing/core/PMatrix.java +21 -160
- data/src/main/java/processing/core/PMatrix2D.java +18 -178
- data/src/main/java/processing/core/PMatrix3D.java +48 -324
- data/src/main/java/processing/core/PShape.java +294 -1181
- data/src/main/java/processing/core/PShapeOBJ.java +16 -91
- data/src/main/java/processing/core/PShapeSVG.java +53 -253
- data/src/main/java/processing/core/PStyle.java +34 -179
- data/src/main/java/processing/core/PSurface.java +13 -94
- data/src/main/java/processing/core/PSurfaceNone.java +35 -140
- data/src/main/java/processing/core/PVector.java +10 -87
- data/src/main/java/processing/event/Event.java +86 -69
- data/src/main/java/processing/event/MouseEvent.java +102 -102
- data/src/main/java/processing/opengl/PGL.java +23 -16
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -10
- data/src/main/java/processing/opengl/PJOGL.java +32 -12
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +154 -0
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +2 -2
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +160 -0
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +2 -2
- metadata +7 -3
| @@ -42,106 +42,22 @@ package processing.core; | |
| 42 42 | 
             
             */
         | 
| 43 43 | 
             
            public final class PMatrix3D implements PMatrix /*, PConstants*/ {
         | 
| 44 44 |  | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
                /**
         | 
| 51 | 
            -
                 *
         | 
| 52 | 
            -
                 */
         | 
| 53 | 
            -
                m01,
         | 
| 54 | 
            -
             | 
| 55 | 
            -
                /**
         | 
| 56 | 
            -
                 *
         | 
| 57 | 
            -
                 */
         | 
| 58 | 
            -
                m02,
         | 
| 59 | 
            -
             | 
| 60 | 
            -
                /**
         | 
| 61 | 
            -
                 *
         | 
| 62 | 
            -
                 */
         | 
| 63 | 
            -
                m03;
         | 
| 64 | 
            -
             | 
| 65 | 
            -
                /**
         | 
| 66 | 
            -
                 *
         | 
| 67 | 
            -
                 */
         | 
| 68 | 
            -
                public float m10,
         | 
| 69 | 
            -
             | 
| 70 | 
            -
                /**
         | 
| 71 | 
            -
                 *
         | 
| 72 | 
            -
                 */
         | 
| 73 | 
            -
                m11,
         | 
| 74 | 
            -
             | 
| 75 | 
            -
                /**
         | 
| 76 | 
            -
                 *
         | 
| 77 | 
            -
                 */
         | 
| 78 | 
            -
                m12,
         | 
| 79 | 
            -
             | 
| 80 | 
            -
                /**
         | 
| 81 | 
            -
                 *
         | 
| 82 | 
            -
                 */
         | 
| 83 | 
            -
                m13;
         | 
| 84 | 
            -
             | 
| 85 | 
            -
                /**
         | 
| 86 | 
            -
                 *
         | 
| 87 | 
            -
                 */
         | 
| 88 | 
            -
                public float m20,
         | 
| 89 | 
            -
             | 
| 90 | 
            -
                /**
         | 
| 91 | 
            -
                 *
         | 
| 92 | 
            -
                 */
         | 
| 93 | 
            -
                m21,
         | 
| 94 | 
            -
             | 
| 95 | 
            -
                /**
         | 
| 96 | 
            -
                 *
         | 
| 97 | 
            -
                 */
         | 
| 98 | 
            -
                m22, m23;
         | 
| 99 | 
            -
             | 
| 100 | 
            -
                /**
         | 
| 101 | 
            -
                 *
         | 
| 102 | 
            -
                 */
         | 
| 103 | 
            -
                public float m30,
         | 
| 104 | 
            -
             | 
| 105 | 
            -
                /**
         | 
| 106 | 
            -
                 *
         | 
| 107 | 
            -
                 */
         | 
| 108 | 
            -
                m31,
         | 
| 109 | 
            -
             | 
| 110 | 
            -
                /**
         | 
| 111 | 
            -
                 *
         | 
| 112 | 
            -
                 */
         | 
| 113 | 
            -
                m32,
         | 
| 114 | 
            -
             | 
| 115 | 
            -
                /**
         | 
| 116 | 
            -
                 *
         | 
| 117 | 
            -
                 */
         | 
| 118 | 
            -
                m33;
         | 
| 45 | 
            +
              public float m00, m01, m02, m03;
         | 
| 46 | 
            +
              public float m10, m11, m12, m13;
         | 
| 47 | 
            +
              public float m20, m21, m22, m23;
         | 
| 48 | 
            +
              public float m30, m31, m32, m33;
         | 
| 119 49 |  | 
| 120 50 |  | 
| 121 51 | 
             
              // locally allocated version to avoid creating new memory
         | 
| 122 | 
            -
             | 
| 123 | 
            -
                /**
         | 
| 124 | 
            -
                 *
         | 
| 125 | 
            -
                 */
         | 
| 126 52 | 
             
              protected PMatrix3D inverseCopy;
         | 
| 127 53 |  | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
                 */
         | 
| 131 | 
            -
                public PMatrix3D() {
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              public PMatrix3D() {
         | 
| 132 56 | 
             
                reset();
         | 
| 133 57 | 
             
              }
         | 
| 134 58 |  | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 137 | 
            -
                 * @param m00
         | 
| 138 | 
            -
                 * @param m01
         | 
| 139 | 
            -
                 * @param m02
         | 
| 140 | 
            -
                 * @param m10
         | 
| 141 | 
            -
                 * @param m11
         | 
| 142 | 
            -
                 * @param m12
         | 
| 143 | 
            -
                 */
         | 
| 144 | 
            -
                public PMatrix3D(float m00, float m01, float m02,
         | 
| 59 | 
            +
             | 
| 60 | 
            +
              public PMatrix3D(float m00, float m01, float m02,
         | 
| 145 61 | 
             
                               float m10, float m11, float m12) {
         | 
| 146 62 | 
             
                set(m00, m01, m02, 0,
         | 
| 147 63 | 
             
                    m10, m11, m12, 0,
         | 
| @@ -149,26 +65,8 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 149 65 | 
             
                    0,   0,   0,   1);
         | 
| 150 66 | 
             
              }
         | 
| 151 67 |  | 
| 152 | 
            -
             | 
| 153 | 
            -
             | 
| 154 | 
            -
                 * @param m00
         | 
| 155 | 
            -
                 * @param m01
         | 
| 156 | 
            -
                 * @param m02
         | 
| 157 | 
            -
                 * @param m03
         | 
| 158 | 
            -
                 * @param m10
         | 
| 159 | 
            -
                 * @param m11
         | 
| 160 | 
            -
                 * @param m12
         | 
| 161 | 
            -
                 * @param m13
         | 
| 162 | 
            -
                 * @param m20
         | 
| 163 | 
            -
                 * @param m21
         | 
| 164 | 
            -
                 * @param m22
         | 
| 165 | 
            -
                 * @param m23
         | 
| 166 | 
            -
                 * @param m30
         | 
| 167 | 
            -
                 * @param m31
         | 
| 168 | 
            -
                 * @param m32
         | 
| 169 | 
            -
                 * @param m33
         | 
| 170 | 
            -
                 */
         | 
| 171 | 
            -
                public PMatrix3D(float m00, float m01, float m02, float m03,
         | 
| 68 | 
            +
             | 
| 69 | 
            +
              public PMatrix3D(float m00, float m01, float m02, float m03,
         | 
| 172 70 | 
             
                               float m10, float m11, float m12, float m13,
         | 
| 173 71 | 
             
                               float m20, float m21, float m22, float m23,
         | 
| 174 72 | 
             
                               float m30, float m31, float m32, float m33) {
         | 
| @@ -178,11 +76,8 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 178 76 | 
             
                    m30, m31, m32, m33);
         | 
| 179 77 | 
             
              }
         | 
| 180 78 |  | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 183 | 
            -
                 * @param matrix
         | 
| 184 | 
            -
                 */
         | 
| 185 | 
            -
                public PMatrix3D(PMatrix matrix) {
         | 
| 79 | 
            +
             | 
| 80 | 
            +
              public PMatrix3D(PMatrix matrix) {
         | 
| 186 81 | 
             
                set(matrix);
         | 
| 187 82 | 
             
              }
         | 
| 188 83 |  | 
| @@ -197,7 +92,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 197 92 |  | 
| 198 93 | 
             
              /**
         | 
| 199 94 | 
             
               * Returns a copy of this PMatrix.
         | 
| 200 | 
            -
                 * @return 
         | 
| 201 95 | 
             
               */
         | 
| 202 96 | 
             
              public PMatrix3D get() {
         | 
| 203 97 | 
             
                PMatrix3D outgoing = new PMatrix3D();
         | 
| @@ -209,8 +103,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 209 103 | 
             
              /**
         | 
| 210 104 | 
             
               * Copies the matrix contents into a 16 entry float array.
         | 
| 211 105 | 
             
               * If target is null (or not the correct size), a new array will be created.
         | 
| 212 | 
            -
                 * @param target
         | 
| 213 | 
            -
                 * @return 
         | 
| 214 106 | 
             
               */
         | 
| 215 107 | 
             
              public float[] get(float[] target) {
         | 
| 216 108 | 
             
                if ((target == null) || (target.length != 16)) {
         | 
| @@ -305,12 +197,8 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 305 197 | 
             
                this.m30 = m30; this.m31 = m31; this.m32 = m32; this.m33 = m33;
         | 
| 306 198 | 
             
              }
         | 
| 307 199 |  | 
| 308 | 
            -
             | 
| 309 | 
            -
             | 
| 310 | 
            -
                 * @param tx
         | 
| 311 | 
            -
                 * @param ty
         | 
| 312 | 
            -
                 */
         | 
| 313 | 
            -
                public void translate(float tx, float ty) {
         | 
| 200 | 
            +
             | 
| 201 | 
            +
              public void translate(float tx, float ty) {
         | 
| 314 202 | 
             
                translate(tx, ty, 0);
         | 
| 315 203 | 
             
              }
         | 
| 316 204 |  | 
| @@ -318,65 +206,42 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 318 206 | 
             
            //    invTranslate(tx, ty, 0);
         | 
| 319 207 | 
             
            //  }
         | 
| 320 208 |  | 
| 321 | 
            -
             | 
| 322 | 
            -
             | 
| 323 | 
            -
                 * @param tx
         | 
| 324 | 
            -
                 * @param ty
         | 
| 325 | 
            -
                 * @param tz
         | 
| 326 | 
            -
                 */
         | 
| 327 | 
            -
                public void translate(float tx, float ty, float tz) {
         | 
| 209 | 
            +
             | 
| 210 | 
            +
              public void translate(float tx, float ty, float tz) {
         | 
| 328 211 | 
             
                m03 += tx*m00 + ty*m01 + tz*m02;
         | 
| 329 212 | 
             
                m13 += tx*m10 + ty*m11 + tz*m12;
         | 
| 330 213 | 
             
                m23 += tx*m20 + ty*m21 + tz*m22;
         | 
| 331 214 | 
             
                m33 += tx*m30 + ty*m31 + tz*m32;
         | 
| 332 215 | 
             
              }
         | 
| 333 216 |  | 
| 334 | 
            -
             | 
| 335 | 
            -
             | 
| 336 | 
            -
                 * @param angle
         | 
| 337 | 
            -
                 */
         | 
| 338 | 
            -
                public void rotate(float angle) {
         | 
| 217 | 
            +
             | 
| 218 | 
            +
              public void rotate(float angle) {
         | 
| 339 219 | 
             
                rotateZ(angle);
         | 
| 340 220 | 
             
              }
         | 
| 341 221 |  | 
| 342 | 
            -
             | 
| 343 | 
            -
             | 
| 344 | 
            -
                 * @param angle
         | 
| 345 | 
            -
                 */
         | 
| 346 | 
            -
                public void rotateX(float angle) {
         | 
| 222 | 
            +
             | 
| 223 | 
            +
              public void rotateX(float angle) {
         | 
| 347 224 | 
             
                float c = cos(angle);
         | 
| 348 225 | 
             
                float s = sin(angle);
         | 
| 349 226 | 
             
                apply(1, 0, 0, 0,  0, c, -s, 0,  0, s, c, 0,  0, 0, 0, 1);
         | 
| 350 227 | 
             
              }
         | 
| 351 228 |  | 
| 352 | 
            -
             | 
| 353 | 
            -
             | 
| 354 | 
            -
                 * @param angle
         | 
| 355 | 
            -
                 */
         | 
| 356 | 
            -
                public void rotateY(float angle) {
         | 
| 229 | 
            +
             | 
| 230 | 
            +
              public void rotateY(float angle) {
         | 
| 357 231 | 
             
                float c = cos(angle);
         | 
| 358 232 | 
             
                float s = sin(angle);
         | 
| 359 233 | 
             
                apply(c, 0, s, 0,  0, 1, 0, 0,  -s, 0, c, 0,  0, 0, 0, 1);
         | 
| 360 234 | 
             
              }
         | 
| 361 235 |  | 
| 362 | 
            -
             | 
| 363 | 
            -
             | 
| 364 | 
            -
                 * @param angle
         | 
| 365 | 
            -
                 */
         | 
| 366 | 
            -
                public void rotateZ(float angle) {
         | 
| 236 | 
            +
             | 
| 237 | 
            +
              public void rotateZ(float angle) {
         | 
| 367 238 | 
             
                float c = cos(angle);
         | 
| 368 239 | 
             
                float s = sin(angle);
         | 
| 369 240 | 
             
                apply(c, -s, 0, 0,  s, c, 0, 0,  0, 0, 1, 0,  0, 0, 0, 1);
         | 
| 370 241 | 
             
              }
         | 
| 371 242 |  | 
| 372 | 
            -
             | 
| 373 | 
            -
             | 
| 374 | 
            -
                 * @param angle
         | 
| 375 | 
            -
                 * @param v0
         | 
| 376 | 
            -
                 * @param v1
         | 
| 377 | 
            -
                 * @param v2
         | 
| 378 | 
            -
                 */
         | 
| 379 | 
            -
                public void rotate(float angle, float v0, float v1, float v2) {
         | 
| 243 | 
            +
             | 
| 244 | 
            +
              public void rotate(float angle, float v0, float v1, float v2) {
         | 
| 380 245 | 
             
                float norm2 = v0 * v0 + v1 * v1 + v2 * v2;
         | 
| 381 246 | 
             
                if (norm2 < PConstants.EPSILON) {
         | 
| 382 247 | 
             
                  // The vector is zero, cannot apply rotation.
         | 
| @@ -401,32 +266,20 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 401 266 | 
             
                      0, 0, 0, 1);
         | 
| 402 267 | 
             
              }
         | 
| 403 268 |  | 
| 404 | 
            -
             | 
| 405 | 
            -
             | 
| 406 | 
            -
                 * @param s
         | 
| 407 | 
            -
                 */
         | 
| 408 | 
            -
                public void scale(float s) {
         | 
| 269 | 
            +
             | 
| 270 | 
            +
              public void scale(float s) {
         | 
| 409 271 | 
             
                //apply(s, 0, 0, 0,  0, s, 0, 0,  0, 0, s, 0,  0, 0, 0, 1);
         | 
| 410 272 | 
             
                scale(s, s, s);
         | 
| 411 273 | 
             
              }
         | 
| 412 274 |  | 
| 413 | 
            -
             | 
| 414 | 
            -
             | 
| 415 | 
            -
                 * @param sx
         | 
| 416 | 
            -
                 * @param sy
         | 
| 417 | 
            -
                 */
         | 
| 418 | 
            -
                public void scale(float sx, float sy) {
         | 
| 275 | 
            +
             | 
| 276 | 
            +
              public void scale(float sx, float sy) {
         | 
| 419 277 | 
             
                //apply(sx, 0, 0, 0,  0, sy, 0, 0,  0, 0, 1, 0,  0, 0, 0, 1);
         | 
| 420 278 | 
             
                scale(sx, sy, 1);
         | 
| 421 279 | 
             
              }
         | 
| 422 280 |  | 
| 423 | 
            -
             | 
| 424 | 
            -
             | 
| 425 | 
            -
                 * @param x
         | 
| 426 | 
            -
                 * @param y
         | 
| 427 | 
            -
                 * @param z
         | 
| 428 | 
            -
                 */
         | 
| 429 | 
            -
                public void scale(float x, float y, float z) {
         | 
| 281 | 
            +
             | 
| 282 | 
            +
              public void scale(float x, float y, float z) {
         | 
| 430 283 | 
             
                //apply(x, 0, 0, 0,  0, y, 0, 0,  0, 0, z, 0,  0, 0, 0, 1);
         | 
| 431 284 | 
             
                m00 *= x;  m01 *= y;  m02 *= z;
         | 
| 432 285 | 
             
                m10 *= x;  m11 *= y;  m12 *= z;
         | 
| @@ -434,11 +287,8 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 434 287 | 
             
                m30 *= x;  m31 *= y;  m32 *= z;
         | 
| 435 288 | 
             
              }
         | 
| 436 289 |  | 
| 437 | 
            -
             | 
| 438 | 
            -
             | 
| 439 | 
            -
                 * @param angle
         | 
| 440 | 
            -
                 */
         | 
| 441 | 
            -
                public void shearX(float angle) {
         | 
| 290 | 
            +
             | 
| 291 | 
            +
              public void shearX(float angle) {
         | 
| 442 292 | 
             
                float t = (float) Math.tan(angle);
         | 
| 443 293 | 
             
                apply(1, t, 0, 0,
         | 
| 444 294 | 
             
                      0, 1, 0, 0,
         | 
| @@ -446,11 +296,8 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 446 296 | 
             
                      0, 0, 0, 1);
         | 
| 447 297 | 
             
              }
         | 
| 448 298 |  | 
| 449 | 
            -
             | 
| 450 | 
            -
             | 
| 451 | 
            -
                 * @param angle
         | 
| 452 | 
            -
                 */
         | 
| 453 | 
            -
                public void shearY(float angle) {
         | 
| 299 | 
            +
             | 
| 300 | 
            +
              public void shearY(float angle) {
         | 
| 454 301 | 
             
                float t = (float) Math.tan(angle);
         | 
| 455 302 | 
             
                apply(1, 0, 0, 0,
         | 
| 456 303 | 
             
                      t, 1, 0, 0,
         | 
| @@ -527,7 +374,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 527 374 |  | 
| 528 375 | 
             
              /**
         | 
| 529 376 | 
             
               * Apply the 3D equivalent of the 2D matrix supplied to the left of this one.
         | 
| 530 | 
            -
                 * @param left
         | 
| 531 377 | 
             
               */
         | 
| 532 378 | 
             
              public void preApply(PMatrix2D left) {
         | 
| 533 379 | 
             
                preApply(left.m00, left.m01, 0, left.m02,
         | 
| @@ -539,7 +385,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 539 385 |  | 
| 540 386 | 
             
              /**
         | 
| 541 387 | 
             
               * Apply another matrix to the left of this one.
         | 
| 542 | 
            -
                 * @param source
         | 
| 543 388 | 
             
               */
         | 
| 544 389 | 
             
              public void preApply(PMatrix source) {
         | 
| 545 390 | 
             
                if (source instanceof PMatrix2D) {
         | 
| @@ -552,7 +397,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 552 397 |  | 
| 553 398 | 
             
              /**
         | 
| 554 399 | 
             
               * Apply another matrix to the left of this one.
         | 
| 555 | 
            -
                 * @param left
         | 
| 556 400 | 
             
               */
         | 
| 557 401 | 
             
              public void preApply(PMatrix3D left) {
         | 
| 558 402 | 
             
                preApply(left.m00, left.m01, left.m02, left.m03,
         | 
| @@ -564,12 +408,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 564 408 |  | 
| 565 409 | 
             
              /**
         | 
| 566 410 | 
             
               * Apply the 3D equivalent of the 2D matrix supplied to the left of this one.
         | 
| 567 | 
            -
                 * @param n00
         | 
| 568 | 
            -
                 * @param n01
         | 
| 569 | 
            -
                 * @param n10
         | 
| 570 | 
            -
                 * @param n02
         | 
| 571 | 
            -
                 * @param n11
         | 
| 572 | 
            -
                 * @param n12
         | 
| 573 411 | 
             
               */
         | 
| 574 412 | 
             
              public void preApply(float n00, float n01, float n02,
         | 
| 575 413 | 
             
                                   float n10, float n11, float n12) {
         | 
| @@ -582,22 +420,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 582 420 |  | 
| 583 421 | 
             
              /**
         | 
| 584 422 | 
             
               * Apply another matrix to the left of this one.
         | 
| 585 | 
            -
                 * @param n00
         | 
| 586 | 
            -
                 * @param n01
         | 
| 587 | 
            -
                 * @param n03
         | 
| 588 | 
            -
                 * @param n02
         | 
| 589 | 
            -
                 * @param n32
         | 
| 590 | 
            -
                 * @param n10
         | 
| 591 | 
            -
                 * @param n12
         | 
| 592 | 
            -
                 * @param n23
         | 
| 593 | 
            -
                 * @param n20
         | 
| 594 | 
            -
                 * @param n11
         | 
| 595 | 
            -
                 * @param n21
         | 
| 596 | 
            -
                 * @param n13
         | 
| 597 | 
            -
                 * @param n31
         | 
| 598 | 
            -
                 * @param n22
         | 
| 599 | 
            -
                 * @param n30
         | 
| 600 | 
            -
                 * @param n33
         | 
| 601 423 | 
             
               */
         | 
| 602 424 | 
             
              public void preApply(float n00, float n01, float n02, float n03,
         | 
| 603 425 | 
             
                                   float n10, float n11, float n12, float n13,
         | 
| @@ -639,9 +461,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 639 461 | 
             
               * The result will be stored in target if target is non-null, and target
         | 
| 640 462 | 
             
               * will then be the matrix returned. This improves performance if you reuse
         | 
| 641 463 | 
             
               * target, so it's recommended if you call this many times in draw().
         | 
| 642 | 
            -
                 * @param source
         | 
| 643 | 
            -
                 * @param target
         | 
| 644 | 
            -
                 * @return 
         | 
| 645 464 | 
             
               */
         | 
| 646 465 | 
             
              public PVector mult(PVector source, PVector target) {
         | 
| 647 466 | 
             
                if (target == null) {
         | 
| @@ -680,9 +499,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 680 499 | 
             
               * null or not length 3 or 4, a new float array (length 3) will be returned.
         | 
| 681 500 | 
             
               * Supplying and recycling a target array improves performance, so it's
         | 
| 682 501 | 
             
               * recommended if you call this many times in draw.
         | 
| 683 | 
            -
                 * @param source
         | 
| 684 | 
            -
                 * @param target
         | 
| 685 | 
            -
                 * @return 
         | 
| 686 502 | 
             
               */
         | 
| 687 503 | 
             
              public float[] mult(float[] source, float[] target) {
         | 
| 688 504 | 
             
                if (target == null || target.length < 3) {
         | 
| @@ -713,9 +529,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 713 529 | 
             
              /**
         | 
| 714 530 | 
             
               * Returns the x-coordinate of the result of multiplying the point (x, y)
         | 
| 715 531 | 
             
               * by this matrix.
         | 
| 716 | 
            -
                 * @param x
         | 
| 717 | 
            -
                 * @param y
         | 
| 718 | 
            -
                 * @return 
         | 
| 719 532 | 
             
               */
         | 
| 720 533 | 
             
              public float multX(float x, float y) {
         | 
| 721 534 | 
             
                return m00*x + m01*y + m03;
         | 
| @@ -725,9 +538,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 725 538 | 
             
              /**
         | 
| 726 539 | 
             
               * Returns the y-coordinate of the result of multiplying the point (x, y)
         | 
| 727 540 | 
             
               * by this matrix.
         | 
| 728 | 
            -
                 * @param x
         | 
| 729 | 
            -
                 * @param y
         | 
| 730 | 
            -
                 * @return 
         | 
| 731 541 | 
             
               */
         | 
| 732 542 | 
             
              public float multY(float x, float y) {
         | 
| 733 543 | 
             
                return m10*x + m11*y + m13;
         | 
| @@ -737,10 +547,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 737 547 | 
             
              /**
         | 
| 738 548 | 
             
               * Returns the x-coordinate of the result of multiplying the point (x, y, z)
         | 
| 739 549 | 
             
               * by this matrix.
         | 
| 740 | 
            -
                 * @param x
         | 
| 741 | 
            -
                 * @param y
         | 
| 742 | 
            -
                 * @param z
         | 
| 743 | 
            -
                 * @return 
         | 
| 744 550 | 
             
               */
         | 
| 745 551 | 
             
              public float multX(float x, float y, float z) {
         | 
| 746 552 | 
             
                return m00*x + m01*y + m02*z + m03;
         | 
| @@ -750,10 +556,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 750 556 | 
             
              /**
         | 
| 751 557 | 
             
               * Returns the y-coordinate of the result of multiplying the point (x, y, z)
         | 
| 752 558 | 
             
               * by this matrix.
         | 
| 753 | 
            -
                 * @param x
         | 
| 754 | 
            -
                 * @param y
         | 
| 755 | 
            -
                 * @param z
         | 
| 756 | 
            -
                 * @return 
         | 
| 757 559 | 
             
               */
         | 
| 758 560 | 
             
              public float multY(float x, float y, float z) {
         | 
| 759 561 | 
             
                return m10*x + m11*y + m12*z + m13;
         | 
| @@ -763,10 +565,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 763 565 | 
             
              /**
         | 
| 764 566 | 
             
               * Returns the z-coordinate of the result of multiplying the point (x, y, z)
         | 
| 765 567 | 
             
               * by this matrix.
         | 
| 766 | 
            -
                 * @param x
         | 
| 767 | 
            -
                 * @param y
         | 
| 768 | 
            -
                 * @param z
         | 
| 769 | 
            -
                 * @return 
         | 
| 770 568 | 
             
               */
         | 
| 771 569 | 
             
              public float multZ(float x, float y, float z) {
         | 
| 772 570 | 
             
                return m20*x + m21*y + m22*z + m23;
         | 
| @@ -776,10 +574,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 776 574 | 
             
              /**
         | 
| 777 575 | 
             
               * Returns the fourth element of the result of multiplying the vector
         | 
| 778 576 | 
             
               * (x, y, z) by this matrix. (Acts as if w = 1 was supplied.)
         | 
| 779 | 
            -
                 * @param x
         | 
| 780 | 
            -
                 * @param y
         | 
| 781 | 
            -
                 * @param z
         | 
| 782 | 
            -
                 * @return 
         | 
| 783 577 | 
             
               */
         | 
| 784 578 | 
             
              public float multW(float x, float y, float z) {
         | 
| 785 579 | 
             
                return m30*x + m31*y + m32*z + m33;
         | 
| @@ -789,11 +583,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 789 583 | 
             
              /**
         | 
| 790 584 | 
             
               * Returns the x-coordinate of the result of multiplying the vector
         | 
| 791 585 | 
             
               * (x, y, z, w) by this matrix.
         | 
| 792 | 
            -
                 * @param x
         | 
| 793 | 
            -
                 * @param y
         | 
| 794 | 
            -
                 * @param z
         | 
| 795 | 
            -
                 * @param w
         | 
| 796 | 
            -
                 * @return 
         | 
| 797 586 | 
             
               */
         | 
| 798 587 | 
             
              public float multX(float x, float y, float z, float w) {
         | 
| 799 588 | 
             
                return m00*x + m01*y + m02*z + m03*w;
         | 
| @@ -803,11 +592,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 803 592 | 
             
              /**
         | 
| 804 593 | 
             
               * Returns the y-coordinate of the result of multiplying the vector
         | 
| 805 594 | 
             
               * (x, y, z, w) by this matrix.
         | 
| 806 | 
            -
                 * @param x
         | 
| 807 | 
            -
                 * @param w
         | 
| 808 | 
            -
                 * @param y
         | 
| 809 | 
            -
                 * @param z
         | 
| 810 | 
            -
                 * @return 
         | 
| 811 595 | 
             
               */
         | 
| 812 596 | 
             
              public float multY(float x, float y, float z, float w) {
         | 
| 813 597 | 
             
                return m10*x + m11*y + m12*z + m13*w;
         | 
| @@ -817,11 +601,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 817 601 | 
             
              /**
         | 
| 818 602 | 
             
               * Returns the z-coordinate of the result of multiplying the vector
         | 
| 819 603 | 
             
               * (x, y, z, w) by this matrix.
         | 
| 820 | 
            -
                 * @param x
         | 
| 821 | 
            -
                 * @param y
         | 
| 822 | 
            -
                 * @param z
         | 
| 823 | 
            -
                 * @param w
         | 
| 824 | 
            -
                 * @return 
         | 
| 825 604 | 
             
               */
         | 
| 826 605 | 
             
              public float multZ(float x, float y, float z, float w) {
         | 
| 827 606 | 
             
                return m20*x + m21*y + m22*z + m23*w;
         | 
| @@ -831,11 +610,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 831 610 | 
             
              /**
         | 
| 832 611 | 
             
               * Returns the w-coordinate of the result of multiplying the vector
         | 
| 833 612 | 
             
               * (x, y, z, w) by this matrix.
         | 
| 834 | 
            -
                 * @param x
         | 
| 835 | 
            -
                 * @param y
         | 
| 836 | 
            -
                 * @param z
         | 
| 837 | 
            -
                 * @param w
         | 
| 838 | 
            -
                 * @return 
         | 
| 839 613 | 
             
               */
         | 
| 840 614 | 
             
              public float multW(float x, float y, float z, float w) {
         | 
| 841 615 | 
             
                return m30*x + m31*y + m32*z + m33*w;
         | 
| @@ -964,13 +738,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 964 738 |  | 
| 965 739 | 
             
              // These functions should not be used, as they will be removed in the future.
         | 
| 966 740 |  | 
| 967 | 
            -
                /**
         | 
| 968 | 
            -
                 *
         | 
| 969 | 
            -
                 * @param tx
         | 
| 970 | 
            -
                 * @param ty
         | 
| 971 | 
            -
                 * @param tz
         | 
| 972 | 
            -
                 */
         | 
| 973 | 
            -
             | 
| 974 741 |  | 
| 975 742 | 
             
              protected void invTranslate(float tx, float ty, float tz) {
         | 
| 976 743 | 
             
                preApply(1, 0, 0, -tx,
         | 
| @@ -979,44 +746,29 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 979 746 | 
             
                         0, 0, 0, 1);
         | 
| 980 747 | 
             
              }
         | 
| 981 748 |  | 
| 982 | 
            -
             | 
| 983 | 
            -
             | 
| 984 | 
            -
                 * @param angle
         | 
| 985 | 
            -
                 */
         | 
| 986 | 
            -
                protected void invRotateX(float angle) {
         | 
| 749 | 
            +
             | 
| 750 | 
            +
              protected void invRotateX(float angle) {
         | 
| 987 751 | 
             
                float c = cos(-angle);
         | 
| 988 752 | 
             
                float s = sin(-angle);
         | 
| 989 753 | 
             
                preApply(1, 0, 0, 0,  0, c, -s, 0,  0, s, c, 0,  0, 0, 0, 1);
         | 
| 990 754 | 
             
              }
         | 
| 991 755 |  | 
| 992 | 
            -
             | 
| 993 | 
            -
             | 
| 994 | 
            -
                 * @param angle
         | 
| 995 | 
            -
                 */
         | 
| 996 | 
            -
                protected void invRotateY(float angle) {
         | 
| 756 | 
            +
             | 
| 757 | 
            +
              protected void invRotateY(float angle) {
         | 
| 997 758 | 
             
                float c = cos(-angle);
         | 
| 998 759 | 
             
                float s = sin(-angle);
         | 
| 999 760 | 
             
                preApply(c, 0, s, 0,  0, 1, 0, 0,  -s, 0, c, 0,  0, 0, 0, 1);
         | 
| 1000 761 | 
             
              }
         | 
| 1001 762 |  | 
| 1002 | 
            -
             | 
| 1003 | 
            -
             | 
| 1004 | 
            -
                 * @param angle
         | 
| 1005 | 
            -
                 */
         | 
| 1006 | 
            -
                protected void invRotateZ(float angle) {
         | 
| 763 | 
            +
             | 
| 764 | 
            +
              protected void invRotateZ(float angle) {
         | 
| 1007 765 | 
             
                float c = cos(-angle);
         | 
| 1008 766 | 
             
                float s = sin(-angle);
         | 
| 1009 767 | 
             
                preApply(c, -s, 0, 0,  s, c, 0, 0,  0, 0, 1, 0,  0, 0, 0, 1);
         | 
| 1010 768 | 
             
              }
         | 
| 1011 769 |  | 
| 1012 | 
            -
             | 
| 1013 | 
            -
             | 
| 1014 | 
            -
                 * @param angle
         | 
| 1015 | 
            -
                 * @param v0
         | 
| 1016 | 
            -
                 * @param v1
         | 
| 1017 | 
            -
                 * @param v2
         | 
| 1018 | 
            -
                 */
         | 
| 1019 | 
            -
                protected void invRotate(float angle, float v0, float v1, float v2) {
         | 
| 770 | 
            +
             | 
| 771 | 
            +
              protected void invRotate(float angle, float v0, float v1, float v2) {
         | 
| 1020 772 | 
             
                //TODO should make sure this vector is normalized
         | 
| 1021 773 |  | 
| 1022 774 | 
             
                float c = cos(-angle);
         | 
| @@ -1029,37 +781,13 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 1029 781 | 
             
                         0, 0, 0, 1);
         | 
| 1030 782 | 
             
              }
         | 
| 1031 783 |  | 
| 1032 | 
            -
             | 
| 1033 | 
            -
             | 
| 1034 | 
            -
                 * @param x
         | 
| 1035 | 
            -
                 * @param y
         | 
| 1036 | 
            -
                 * @param z
         | 
| 1037 | 
            -
                 */
         | 
| 1038 | 
            -
                protected void invScale(float x, float y, float z) {
         | 
| 784 | 
            +
             | 
| 785 | 
            +
              protected void invScale(float x, float y, float z) {
         | 
| 1039 786 | 
             
                preApply(1/x, 0, 0, 0,  0, 1/y, 0, 0,  0, 0, 1/z, 0,  0, 0, 0, 1);
         | 
| 1040 787 | 
             
              }
         | 
| 1041 788 |  | 
| 1042 | 
            -
             | 
| 1043 | 
            -
             | 
| 1044 | 
            -
                 * @param n00
         | 
| 1045 | 
            -
                 * @param n01
         | 
| 1046 | 
            -
                 * @param n02
         | 
| 1047 | 
            -
                 * @param n03
         | 
| 1048 | 
            -
                 * @param n10
         | 
| 1049 | 
            -
                 * @param n11
         | 
| 1050 | 
            -
                 * @param n12
         | 
| 1051 | 
            -
                 * @param n13
         | 
| 1052 | 
            -
                 * @param n20
         | 
| 1053 | 
            -
                 * @param n21
         | 
| 1054 | 
            -
                 * @param n22
         | 
| 1055 | 
            -
                 * @param n23
         | 
| 1056 | 
            -
                 * @param n30
         | 
| 1057 | 
            -
                 * @param n31
         | 
| 1058 | 
            -
                 * @param n32
         | 
| 1059 | 
            -
                 * @param n33
         | 
| 1060 | 
            -
                 * @return
         | 
| 1061 | 
            -
                 */
         | 
| 1062 | 
            -
                protected boolean invApply(float n00, float n01, float n02, float n03,
         | 
| 789 | 
            +
             | 
| 790 | 
            +
              protected boolean invApply(float n00, float n01, float n02, float n03,
         | 
| 1063 791 | 
             
                                         float n10, float n11, float n12, float n13,
         | 
| 1064 792 | 
             
                                         float n20, float n21, float n22, float n23,
         | 
| 1065 793 | 
             
                                         float n30, float n31, float n32, float n33) {
         | 
| @@ -1080,10 +808,6 @@ public final class PMatrix3D implements PMatrix /*, PConstants*/ { | |
| 1080 808 |  | 
| 1081 809 | 
             
              //////////////////////////////////////////////////////////////
         | 
| 1082 810 |  | 
| 1083 | 
            -
                /**
         | 
| 1084 | 
            -
                 *
         | 
| 1085 | 
            -
                 */
         | 
| 1086 | 
            -
             | 
| 1087 811 |  | 
| 1088 812 | 
             
              public void print() {
         | 
| 1089 813 | 
             
                /*
         |