Represents 4x4 column major matrix. Each cell can be individually accessed as a field (M<row><column>), with indexing indexxing property[row, column] or with indexing property[index]. More...
Public Member Functions | |
override Int32 | GetHashCode () |
Computes the hash code for the current instance. More... | |
FPVector3 | MultiplyPoint (FPVector3 point) |
Transforms a position by this matrix. Works with regulard 3D transformations and with projective transformations. More... | |
FPVector3 | MultiplyPoint3x4 (FPVector3 point) |
Transforms a position by this matrix. Faster than MultiplyPoint(FPVector3), but works only with regulard 3D transformations. More... | |
FPVector3 | MultiplyVector (FPVector3 vector) |
Transforms a direction by this matrix. Only rotation and scale part of the matrix is taken into account. More... | |
override String | ToString () |
Returns a string representation of the FPMatrix4x4 object. The string representation consists of the values of the matrix elements formatted as a 4x4 matrix. More... | |
Static Public Member Functions | |
static FPMatrix4x4 | FromColumns (FP m00, FP m10, FP m20, FP m30, FP m01, FP m11, FP m21, FP m31, FP m02, FP m12, FP m22, FP m32, FP m03, FP m13, FP m23, FP m33) |
Create from columns - first four values set the first colunn, second four values - second column etc. More... | |
static FPMatrix4x4 | FromRows (FP m00, FP m01, FP m02, FP m03, FP m10, FP m11, FP m12, FP m13, FP m20, FP m21, FP m22, FP m23, FP m30, FP m31, FP m32, FP m33) |
Create from rows - first four values set the first row, second four values - second row etc. More... | |
static FPMatrix4x4 | InverseLookAt (FPVector3 from, FPVector3 to, FPVector3 up) |
Creates inverse of look-at matrix, i.e. observer to world transformation. Equivalent to Unity's Matrix4x4.LookAt. More... | |
static FPMatrix4x4 | InverseTRS (FPVector3 pos, FPQuaternion q, FPVector3 s) |
Creates an inversion translation, rotation and scaling matrix. This is significantly faster than inverting TRS matrix. Can be used to create world-to-local transformations. Rotation is expected to be normalized. More... | |
static FPMatrix4x4 | LookAt (FPVector3 from, FPVector3 to, FPVector3 up) |
Creates look-at matrix, i.e. world to observer transformation. Unity's Matrix4x4.LookAt does the opposite - creates observer to world transformation. To get same behaviour use InverseLookAt(FPVector3, FPVector3, FPVector3) More... | |
static FPMatrix4x4 | operator* (FPMatrix4x4 a, FPMatrix4x4 b) |
Multiplies two matrices. More... | |
static FPMatrix4x4 | Rotate (FPQuaternion q) |
Creates a rotation matrix. Rotation is expected to be normalized. More... | |
static FPMatrix4x4 | Scale (FPVector3 scale) |
Creates a scaling matrix. More... | |
static void | Serialize (void *ptr, IDeterministicFrameSerializer serializer) |
Serializes a FPMatrix4x4 object using a given IDeterministicFrameSerializer. More... | |
static FPMatrix4x4 | Translate (FPVector3 translation) |
Creates a translation matrix. More... | |
static FPMatrix4x4 | TRS (FPVector3 pos, FPQuaternion q, FPVector3 s) |
Creates a translation, rotation and scaling matrix. Can be used to create local-to-world transformations. Rotation is expected to be normalized. More... | |
Public Attributes | |
FP | Determinant3x3 |
Calculates determinant, taking only rotation and scale parts of this matrix into account. More... | |
bool | IsIdentity |
Returns true if this matrix is equal to the Identity matrix More... | |
FP | M00 |
First row, first column More... | |
FP | M01 |
First row, second column More... | |
FP | M02 |
First row, third column More... | |
FP | M03 |
First row, fourth column More... | |
FP | M10 |
Second row, first column More... | |
FP | M11 |
Second row, second column More... | |
FP | M12 |
Second row, third column More... | |
FP | M13 |
Second row, fourth column More... | |
FP | M20 |
Third row, first column More... | |
FP | M21 |
Third row, second column More... | |
FP | M22 |
Third row, third column More... | |
FP | M23 |
Third row, fourth column More... | |
FP | M30 |
Fourth row, first column More... | |
FP | M31 |
Fourth row, second column More... | |
FP | M32 |
Fourth row, third column More... | |
FP | M33 |
Fourth row, fourth column More... | |
FPMatrix4x4 | Transposed => FromColumns(M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33) |
Creates transposed matrix. More... | |
Static Public Attributes | |
const int | SIZE = FP.SIZE * 16 |
The size of the struct in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More... | |
static FPMatrix4x4 | Zero => new FPMatrix4x4() |
Matrix with 0s in every cell. More... | |
Properties | |
FP | Determinant [get] |
Calculates determinant of this matrix. More... | |
static FPMatrix4x4 | Identity [get] |
Matrix with 1s in the main diagonal and 0s in all other cells. More... | |
FPMatrix4x4 | Inverted [get] |
Creates inverted matrix. Matrix with determinant 0 can not be inverted and result with Zero. More... | |
FPVector3 | LossyScale [get] |
Attempts to get a scale value from the matrix. More... | |
FPQuaternion | Rotation [get] |
Attempts to get a rotation quaternion from this matrix. More... | |
FP | this[int index] [get, set] |
Gets or sets cell M<index%4><index/4> More... | |
FP | this[int row, int column] [get, set] |
Gets or sets cell M<row><column>. More... | |
Represents 4x4 column major matrix. Each cell can be individually accessed as a field (M<row><column>), with indexing indexxing property[row, column] or with indexing property[index].
|
inlinestatic |
Create from rows - first four values set the first row, second four values - second row etc.
|
inlinestatic |
Create from columns - first four values set the first colunn, second four values - second column etc.
|
inlinestatic |
Creates inverse of look-at matrix, i.e. observer to world transformation. Equivalent to Unity's Matrix4x4.LookAt.
from | |
to | |
up |
|
inlinestatic |
Creates look-at matrix, i.e. world to observer transformation. Unity's Matrix4x4.LookAt does the opposite - creates observer to world transformation. To get same behaviour use InverseLookAt(FPVector3, FPVector3, FPVector3)
from | |
to | |
up |
|
static |
Creates a scaling matrix.
scale |
|
static |
Creates a translation matrix.
translation |
|
inlinestatic |
Serializes a FPMatrix4x4 object using a given IDeterministicFrameSerializer.
ptr | A pointer to the FPMatrix4x4 object to be serialized. |
serializer | The IDeterministicFrameSerializer used for serialization. |
|
inline |
Returns a string representation of the FPMatrix4x4 object. The string representation consists of the values of the matrix elements formatted as a 4x4 matrix.
|
inline |
Computes the hash code for the current instance.
|
inlinestatic |
Multiplies two matrices.
Transforms a position by this matrix. Works with regulard 3D transformations and with projective transformations.
Transforms a position by this matrix. Faster than MultiplyPoint(FPVector3), but works only with regulard 3D transformations.
Transforms a direction by this matrix. Only rotation and scale part of the matrix is taken into account.
|
inlinestatic |
Creates a translation, rotation and scaling matrix. Can be used to create local-to-world transformations. Rotation is expected to be normalized.
|
inlinestatic |
Creates an inversion translation, rotation and scaling matrix. This is significantly faster than inverting TRS matrix. Can be used to create world-to-local transformations. Rotation is expected to be normalized.
|
inlinestatic |
Creates a rotation matrix. Rotation is expected to be normalized.
|
static |
The size of the struct in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.
|
static |
Matrix with 0s in every cell.
FP Photon.Deterministic.FPMatrix4x4.M00 |
First row, first column
FP Photon.Deterministic.FPMatrix4x4.M10 |
Second row, first column
FP Photon.Deterministic.FPMatrix4x4.M20 |
Third row, first column
FP Photon.Deterministic.FPMatrix4x4.M30 |
Fourth row, first column
FP Photon.Deterministic.FPMatrix4x4.M01 |
First row, second column
FP Photon.Deterministic.FPMatrix4x4.M11 |
Second row, second column
FP Photon.Deterministic.FPMatrix4x4.M21 |
Third row, second column
FP Photon.Deterministic.FPMatrix4x4.M31 |
Fourth row, second column
FP Photon.Deterministic.FPMatrix4x4.M02 |
First row, third column
FP Photon.Deterministic.FPMatrix4x4.M12 |
Second row, third column
FP Photon.Deterministic.FPMatrix4x4.M22 |
Third row, third column
FP Photon.Deterministic.FPMatrix4x4.M32 |
Fourth row, third column
FP Photon.Deterministic.FPMatrix4x4.M03 |
First row, fourth column
FP Photon.Deterministic.FPMatrix4x4.M13 |
Second row, fourth column
FP Photon.Deterministic.FPMatrix4x4.M23 |
Third row, fourth column
FP Photon.Deterministic.FPMatrix4x4.M33 |
Fourth row, fourth column
FPMatrix4x4 Photon.Deterministic.FPMatrix4x4.Transposed => FromColumns(M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33) |
Creates transposed matrix.
bool Photon.Deterministic.FPMatrix4x4.IsIdentity |
Returns true
if this matrix is equal to the Identity matrix
FP Photon.Deterministic.FPMatrix4x4.Determinant3x3 |
Calculates determinant, taking only rotation and scale parts of this matrix into account.
|
staticget |
Matrix with 1s in the main diagonal and 0s in all other cells.
|
getset |
Gets or sets cell M<row><column>.
row | |
column |
|
getset |
Gets or sets cell M<index%4><index/4>
index |
|
get |
Attempts to get a scale value from the matrix.
|
get |
Creates inverted matrix. Matrix with determinant 0 can not be inverted and result with Zero.
|
get |
Calculates determinant of this matrix.
|
get |
Attempts to get a rotation quaternion from this matrix.