public class Matrix2D
extends java.lang.Object
Constructor and Description |
---|
Matrix2D() |
Modifier and Type | Method and Description |
---|---|
void |
_11(double val) |
void |
_12(double val) |
void |
_13(double val) |
void |
_21(double val) |
void |
_22(double val) |
void |
_23(double val) |
void |
_31(double val) |
void |
_32(double val) |
void |
_33(double val) |
void |
identity()
Initialise the matrix to the identity matrix.
|
void |
matrixMultiply(game2dai.maths.Matrix2D.Matrix mIn)
Multiply this matrix by another
|
void |
rotate(double rot)
Rotate the matrix.
|
void |
rotate(Vector2D fwd,
Vector2D side)
Rotate the matrix based an entity's heading and side vectors
|
void |
scale(double xScale,
double yScale)
Scale the matrix in the x and y directions.
|
java.util.List<Vector2D> |
transformVector2D(java.util.List<Vector2D> vList)
Create a new list of vectors from the provided list after being transformed
by this matrix.
|
Vector2D |
transformVector2D(Vector2D vPoint)
Create a new vector from the provided vector after being transformed
by the matrix.
|
void |
translate(double x,
double y)
Translate the matrix by the amount specified in
x and y.
|
public void matrixMultiply(game2dai.maths.Matrix2D.Matrix mIn)
mIn
- the multiplying matrixpublic java.util.List<Vector2D> transformVector2D(java.util.List<Vector2D> vList)
vList
- the original list of vectorspublic Vector2D transformVector2D(Vector2D vPoint)
vPoint
- the original vectorpublic void identity()
public void translate(double x, double y)
x
- x-translation valuey
- y-translation valuepublic void scale(double xScale, double yScale)
xScale
- scale x by thisyScale
- scale y by thispublic void rotate(double rot)
rot
- angle in radians.public void rotate(Vector2D fwd, Vector2D side)
fwd
- side
- public void _11(double val)
public void _12(double val)
public void _13(double val)
public void _21(double val)
public void _22(double val)
public void _23(double val)
public void _31(double val)
public void _32(double val)
public void _33(double val)
Processing library AI_for_2D_Games by Peter Lager. (C) 2013