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
Afficher le fichier Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Méthodes publiques

Свойство Type Description
A float
B float
C float
D float
Tx float
Ty float

Méthodes publiques

Méthode 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

Méthode 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 méthode

public AppendMatrix ( Matrix matrix ) : void
matrix Matrix
Résultat void

ConvertToMatrix4() public méthode

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

ConvertToMatrix4d() public méthode

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

CopyFromMatrix() public méthode

public CopyFromMatrix ( Matrix matrix ) : void
matrix Matrix
Résultat void

Create() public static méthode

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
Résultat Matrix

Identity() public méthode

Converts the matrix to an Identity matrix
public Identity ( ) : void
Résultat void

Invert() public méthode

public Invert ( ) : void
Résultat void

IsEqual() public méthode

public IsEqual ( Matrix other ) : bool
other Matrix
Résultat bool

PrependMatrix() public méthode

public PrependMatrix ( Matrix matrix ) : void
matrix Matrix
Résultat void

PrependTranslation() public méthode

public PrependTranslation ( float dx, float dy ) : void
dx float
dy float
Résultat void

Rotate() public méthode

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

Scale() public méthode

public Scale ( float sx, float sy ) : void
sx float
sy float
Résultat void

Skew() public méthode

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
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

TransformPoint() public méthode

Returns a point that is transformed by this matrix
public TransformPoint ( Point point ) : Point
point Point
Résultat Point

TransformPoint() public méthode

public TransformPoint ( float x, float y ) : Point
x float
y float
Résultat Point

Translate() public méthode

public Translate ( float dx, float dy ) : void
dx float
dy float
Résultat void

Property Details

A public_oe property

public float A
Résultat float

B public_oe property

public float B
Résultat float

C public_oe property

public float C
Résultat float

D public_oe property

public float D
Résultat float

Tx public_oe property

public float Tx
Résultat float

Ty public_oe property

public float Ty
Résultat float