C# Класс 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|
Наследование: SparrowSharp.Pool.PooledObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
A float
B float
C float
D float
Tx float
Ty float

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

AppendMatrix() публичный Метод

public AppendMatrix ( Matrix matrix ) : void
matrix Matrix
Результат void

ConvertToMatrix4() публичный Метод

Creates and returns an OpenGL Matrix4 object based on this Matrix
public ConvertToMatrix4 ( ) : Matrix4
Результат Matrix4

ConvertToMatrix4d() публичный Метод

Creates and returns an OpenGL Matrix4d object based on this Matrix
public ConvertToMatrix4d ( ) : System.Matrix4d
Результат System.Matrix4d

CopyFromMatrix() публичный Метод

public CopyFromMatrix ( Matrix matrix ) : void
matrix Matrix
Результат void

Create() публичный статический Метод

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
Результат Matrix

Identity() публичный Метод

Converts the matrix to an Identity matrix
public Identity ( ) : void
Результат void

Invert() публичный Метод

public Invert ( ) : void
Результат void

IsEqual() публичный Метод

public IsEqual ( Matrix other ) : bool
other Matrix
Результат bool

PrependMatrix() публичный Метод

public PrependMatrix ( Matrix matrix ) : void
matrix Matrix
Результат void

PrependTranslation() публичный Метод

public PrependTranslation ( float dx, float dy ) : void
dx float
dy float
Результат void

Rotate() публичный Метод

Applies a rotation on the matrix (angle in radians).
public Rotate ( float angleInRadians ) : void
angleInRadians float
Результат void

Scale() публичный Метод

public Scale ( float sx, float sy ) : void
sx float
sy float
Результат void

Skew() публичный Метод

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
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

TransformPoint() публичный Метод

Returns a point that is transformed by this matrix
public TransformPoint ( Point point ) : Point
point Point
Результат Point

TransformPoint() публичный Метод

public TransformPoint ( float x, float y ) : Point
x float
y float
Результат Point

Translate() публичный Метод

public Translate ( float dx, float dy ) : void
dx float
dy float
Результат void

Описание свойств

A публичное свойство

public float A
Результат float

B публичное свойство

public float B
Результат float

C публичное свойство

public float C
Результат float

D публичное свойство

public float D
Результат float

Tx публичное свойство

public float Tx
Результат float

Ty публичное свойство

public float Ty
Результат float