Reference

applyMatrix()

Description

Set the Processing matrix at the right place for drawing the body. It represents the body's center, so you must use CENTER mode in order to use it correctly (ex.: ellipseMode(CENTER)). Useful if you want to handle drawing methods yourself. Don't forget to resetMatrix() or to use the popMatrix() and pushMatrix() function.

Exemples

pushMatrix();
myBody.applyMatrix(PApplet);
rectMode(CENTER);
rect(0,0, 50, 50); //Will draw a rectangle at the body position
popMatrix();

Syntax

applyMatrix(theApplet);

Parameters

theApplet ->

PApplet : the Processing applet on wich apply matrix transformation. Usually, use "this" for this parameter.