MCPcopy Index your code
hub / github.com/benfry/processing4 / checkMatrix

Method checkMatrix

core/src/processing/core/PShape.java:3416–3427  ·  view source on GitHub ↗

Make sure that the shape's matrix is 1) not null, and 2) has a matrix that can handle at least the specified number of dimensions.

(int dimensions)

Source from the content-addressed store, hash-verified

3414 * that can handle <em>at least</em> the specified number of dimensions.
3415 */
3416 protected void checkMatrix(int dimensions) {
3417 if (matrix == null) {
3418 if (dimensions == 2) {
3419 matrix = new PMatrix2D();
3420 } else {
3421 matrix = new PMatrix3D();
3422 }
3423 } else if (dimensions == 3 && (matrix instanceof PMatrix2D)) {
3424 // time for an upgrayedd for a double dose of my pimpin'
3425 matrix = new PMatrix3D(matrix);
3426 }
3427 }
3428
3429
3430 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 5

translateMethod · 0.95
rotateMethod · 0.95
scaleMethod · 0.95
resetMatrixMethod · 0.95
applyMatrixMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected