MCPcopy Index your code
hub / github.com/processing/processing / checkMatrix

Method checkMatrix

core/src/processing/core/PShape.java:3326–3337  ·  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

3324 * that can handle <em>at least</em> the specified number of dimensions.
3325 */
3326 protected void checkMatrix(int dimensions) {
3327 if (matrix == null) {
3328 if (dimensions == 2) {
3329 matrix = new PMatrix2D();
3330 } else {
3331 matrix = new PMatrix3D();
3332 }
3333 } else if (dimensions == 3 && (matrix instanceof PMatrix2D)) {
3334 // time for an upgrayedd for a double dose of my pimpin'
3335 matrix = new PMatrix3D(matrix);
3336 }
3337 }
3338
3339
3340 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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