C# Class Sparrow.Geom.Matrix

The Matrix class describes an affine, 2D transformation Matrix. It provides methods to manipulate the matrix in convenient ways, and can be used to transform points. The matrix has the following form: |a c tx| |b d ty| |0 0 1|
Inheritance: SparrowSharp.Pool.PooledObject
ファイルを表示 Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Public Properties

Property Type Description
A float
B float
C float
D float
Tx float
Ty float

Public Methods

Method Description
AppendMatrix ( Matrix matrix ) : void
ConvertToMatrix4 ( ) : Matrix4

Creates and returns an OpenGL Matrix4 object based on this Matrix

ConvertToMatrix4d ( ) : System.Matrix4d

Creates and returns an OpenGL Matrix4d object based on this Matrix

CopyFromMatrix ( Matrix matrix ) : void
Create ( float a = 1.0f, float b = 0.0f, float c = 0.0f, float d = 1.0f, float tx = 0.0f, float ty = 0.0f ) : Matrix
Identity ( ) : void

Converts the matrix to an Identity matrix

Invert ( ) : void
IsEqual ( Matrix other ) : bool
PrependMatrix ( Matrix matrix ) : void
PrependTranslation ( float dx, float dy ) : void
Rotate ( float angleInRadians ) : void

Applies a rotation on the matrix (angle in radians).

Scale ( float sx, float sy ) : void
Skew ( float sx, float sy ) : void

Appends a skew transformation to a matrix (angles in radians). The skew matrix has the following form: | cos(skewY) -sin(skewX) 0 | | sin(skewY) cos(skewX) 0 | | 0 0 1 |

ToString ( ) : string
TransformPoint ( Point point ) : Point

Returns a point that is transformed by this matrix

TransformPoint ( float x, float y ) : Point
Translate ( float dx, float dy ) : void

Private Methods

Method Description
Init ( ) : Matrix
Matrix ( float a = 1.0f, float b = 0.0f, float c = 0.0f, float d = 1.0f, float tx = 0.0f, float ty = 0.0f ) : System

Method Details

AppendMatrix() public method

public AppendMatrix ( Matrix matrix ) : void
matrix Matrix
return void

ConvertToMatrix4() public method

Creates and returns an OpenGL Matrix4 object based on this Matrix
public ConvertToMatrix4 ( ) : Matrix4
return Matrix4

ConvertToMatrix4d() public method

Creates and returns an OpenGL Matrix4d object based on this Matrix
public ConvertToMatrix4d ( ) : System.Matrix4d
return System.Matrix4d

CopyFromMatrix() public method

public CopyFromMatrix ( Matrix matrix ) : void
matrix Matrix
return void

Create() public static method

public static Create ( float a = 1.0f, float b = 0.0f, float c = 0.0f, float d = 1.0f, float tx = 0.0f, float ty = 0.0f ) : Matrix
a float
b float
c float
d float
tx float
ty float
return Matrix

Identity() public method

Converts the matrix to an Identity matrix
public Identity ( ) : void
return void

Invert() public method

public Invert ( ) : void
return void

IsEqual() public method

public IsEqual ( Matrix other ) : bool
other Matrix
return bool

PrependMatrix() public method

public PrependMatrix ( Matrix matrix ) : void
matrix Matrix
return void

PrependTranslation() public method

public PrependTranslation ( float dx, float dy ) : void
dx float
dy float
return void

Rotate() public method

Applies a rotation on the matrix (angle in radians).
public Rotate ( float angleInRadians ) : void
angleInRadians float
return void

Scale() public method

public Scale ( float sx, float sy ) : void
sx float
sy float
return void

Skew() public method

Appends a skew transformation to a matrix (angles in radians). The skew matrix has the following form: | cos(skewY) -sin(skewX) 0 | | sin(skewY) cos(skewX) 0 | | 0 0 1 |
public Skew ( float sx, float sy ) : void
sx float
sy float
return void

ToString() public method

public ToString ( ) : string
return string

TransformPoint() public method

Returns a point that is transformed by this matrix
public TransformPoint ( Point point ) : Point
point Point
return Point

TransformPoint() public method

public TransformPoint ( float x, float y ) : Point
x float
y float
return Point

Translate() public method

public Translate ( float dx, float dy ) : void
dx float
dy float
return void

Property Details

A public_oe property

public float A
return float

B public_oe property

public float B
return float

C public_oe property

public float C
return float

D public_oe property

public float D
return float

Tx public_oe property

public float Tx
return float

Ty public_oe property

public float Ty
return float