AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.maths.Matrix2D Class Reference

Classes

class  Matrix
 

Public Member Functions

void matrixMultiply (final Matrix mIn)
 
List< Vector2DtransformVector2D (final List< Vector2D > vList)
 
Vector2D transformVector2D (final Vector2D vPoint)
 
void identity ()
 
void translate (double x, double y)
 
void scale (double xScale, double yScale)
 
void rotate (final double rot)
 
void rotate (final Vector2D fwd, final Vector2D side)
 
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)
 

Private Attributes

Matrix matrix
 

Detailed Description

Class to represent a 2D matrix that can be used to create transformed Vector2D objects.

Author
Peter Lager

Member Function Documentation

◆ identity()

void game2dai.maths.Matrix2D.identity ( )

Initialise the matrix to the identity matrix. This will erase the previous matrix element data.

◆ matrixMultiply()

void game2dai.maths.Matrix2D.matrixMultiply ( final Matrix  mIn)

Multiply this matrix by another

Parameters
mInthe multiplying matrix

◆ rotate() [1/2]

void game2dai.maths.Matrix2D.rotate ( final double  rot)

Rotate the matrix.

Parameters
rotangle in radians.

◆ rotate() [2/2]

void game2dai.maths.Matrix2D.rotate ( final Vector2D  fwd,
final Vector2D  side 
)

Rotate the matrix based an entity's heading and side vectors

Parameters
fwd
side

◆ scale()

void game2dai.maths.Matrix2D.scale ( double  xScale,
double  yScale 
)

Scale the matrix in the x and y directions.

Parameters
xScalescale x by this
yScalescale y by this

◆ transformVector2D() [1/2]

List< Vector2D > game2dai.maths.Matrix2D.transformVector2D ( final List< Vector2D vList)

Create a new list of vectors from the provided list after being transformed by this matrix.

Parameters
vListthe original list of vectors
Returns
a list of transformed vectors.

◆ transformVector2D() [2/2]

Vector2D game2dai.maths.Matrix2D.transformVector2D ( final Vector2D  vPoint)

Create a new vector from the provided vector after being transformed by the matrix.

Parameters
vPointthe original vector
Returns
the transformed vector

◆ translate()

void game2dai.maths.Matrix2D.translate ( double  x,
double  y 
)

Translate the matrix by the amount specified in x and y.

Parameters
xx-translation value
yy-translation value

The documentation for this class was generated from the following file: