Reference
- Body Classes
-
Body Functions
- (PPBox)getHeight()
- (PPBox)getWidth()
- (PPBox)setSize()
- (PPCircle)getSize()
- (PPCircle)setSize()
- addExcludedBody()
- addForce()
- adjustAngularVelocity()
- adjustVelocity()
- applyMatrix()
- attachImage()
- dettachImage()
- getAngularVelocity()
- getImageAlpha()
- getRotation()
- getVelocityX()
- getVelocityY()
- getX()
- getY()
- isResting()
- isStatic()
- isTouchingBody()
- resetForces()
- setAngularVelocity()
- setDamping()
- setDrawable()
- setFillColor()
- setFriction()
- setGravityEffected()
- setImageAlpha()
- setMass()
- setPosition()
- setRestitution()
- setRotatable()
- setRotation()
- setRotDamping()
- setStaticBody()
- setStrokeColor()
- setStrokeWidth()
- setVelocity()
- World Classes
- World Fucntions
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.