Empeld
Empeld plugin documentation.
pluginbase.Helpers.Computative.MatrixExtensions Class Reference

Static Public Member Functions

static Matrix4 CreateRotationAroundPointX (float radians, Vector3 pt)
 
static Matrix4 CreateRotationAroundUnitCenterX (float radians)
 
static Matrix4 CreateRotationAroundPointY (float radians, Vector3 pt)
 
static Matrix4 CreateRotationAroundUnitCenterY (float radians)
 
static Matrix4 CreateRotationScaleAroundPointZ (Vector3 scale, float radians, Vector3 pt)
 
static Matrix4 CreateRotationAroundPointZ (float radians, Vector3 pt)
 
static Matrix4 CreateRotationAroundUnitCenterZ (float radians)
 
static unsafe void DownCast (ref Matrix4d matrix, out Matrix4 outMatrix)
 Fast downcast of double-matrix using pointers More...
 

Member Function Documentation

◆ CreateRotationAroundPointX()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundPointX ( float  radians,
Vector3  pt 
)
static
9  {
10  Matrix4 ret = Matrix4.CreateTranslation(-pt);
11  ret *= Matrix4.CreateRotationX(radians);
12  ret *= Matrix4.CreateTranslation(pt);
13  return ret;
14  }

◆ CreateRotationAroundPointY()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundPointY ( float  radians,
Vector3  pt 
)
static
22  {
23  Matrix4 ret = Matrix4.CreateTranslation(-pt);
24  ret *= Matrix4.CreateRotationY(radians);
25  ret *= Matrix4.CreateTranslation(pt);
26  return ret;
27  }

◆ CreateRotationAroundPointZ()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundPointZ ( float  radians,
Vector3  pt 
)
static
44  {
45  Matrix4 ret = Matrix4.CreateTranslation(-pt);
46  ret *= Matrix4.CreateRotationZ(radians);
47  ret *= Matrix4.CreateTranslation(pt);
48  return ret;
49  }

◆ CreateRotationAroundUnitCenterX()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundUnitCenterX ( float  radians)
static
17  {
18  return CreateRotationAroundPointX(radians, new Vector3(0.5f, 0.5f, 0.5f));
19  }
static Matrix4 CreateRotationAroundPointX(float radians, Vector3 pt)
Definition: MatrixExtensions.cs:8

◆ CreateRotationAroundUnitCenterY()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundUnitCenterY ( float  radians)
static
30  {
31  return CreateRotationAroundPointY(radians, new Vector3(0.5f, 0.5f, 0.5f));
32  }
static Matrix4 CreateRotationAroundPointY(float radians, Vector3 pt)
Definition: MatrixExtensions.cs:21

◆ CreateRotationAroundUnitCenterZ()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationAroundUnitCenterZ ( float  radians)
static
52  {
53  return CreateRotationAroundPointZ(radians, new Vector3(0.5f, 0.5f, 0f));
54  }
static Matrix4 CreateRotationAroundPointZ(float radians, Vector3 pt)
Definition: MatrixExtensions.cs:43

◆ CreateRotationScaleAroundPointZ()

static Matrix4 pluginbase.Helpers.Computative.MatrixExtensions.CreateRotationScaleAroundPointZ ( Vector3  scale,
float  radians,
Vector3  pt 
)
static
35  {
36  Matrix4 ret = Matrix4.CreateTranslation(-pt);
37  ret *= Matrix4.CreateScale(scale);
38  ret *= Matrix4.CreateRotationZ(radians);
39  ret *= Matrix4.CreateTranslation(pt);
40  return ret;
41  }

◆ DownCast()

static unsafe void pluginbase.Helpers.Computative.MatrixExtensions.DownCast ( ref Matrix4d  matrix,
out Matrix4  outMatrix 
)
static

Fast downcast of double-matrix using pointers

Parameters
matrixMatrix.
outMatrixOut matrix.

Attribute: 0] = (float)iPtr[0

;

Attribute: 1] = (float)iPtr[1

;

Attribute: 2] = (float)iPtr[2

;

Attribute: 3] = (float)iPtr[3

;

Attribute: 4] = (float)iPtr[4

;

Attribute: 5] = (float)iPtr[5

;

Attribute: 6] = (float)iPtr[6

;

Attribute: 7] = (float)iPtr[7

;

Attribute: 8] = (float)iPtr[8

;

Attribute: 9] = (float)iPtr[9

;

Attribute: 10] = (float)iPtr[10

;

Attribute: 11] = (float)iPtr[11

;

Attribute: 12] = (float)iPtr[12

;

Attribute: 13] = (float)iPtr[13

;

Attribute: 14] = (float)iPtr[14

;

Attribute: 15] = (float)iPtr[15

;

62  {
63  outMatrix = new Matrix4();
64  fixed(double* iPtr = &matrix.Row0.X)
65  fixed(float* oPtr = &outMatrix.Row0.X)
66  {
67  oPtr[0] = (float)iPtr[0];
68  oPtr[1] = (float)iPtr[1];
69  oPtr[2] = (float)iPtr[2];
70  oPtr[3] = (float)iPtr[3];
71 
72  oPtr[4] = (float)iPtr[4];
73  oPtr[5] = (float)iPtr[5];
74  oPtr[6] = (float)iPtr[6];
75  oPtr[7] = (float)iPtr[7];
76 
77  oPtr[8] = (float)iPtr[8];
78  oPtr[9] = (float)iPtr[9];
79  oPtr[10] = (float)iPtr[10];
80  oPtr[11] = (float)iPtr[11];
81 
82  oPtr[12] = (float)iPtr[12];
83  oPtr[13] = (float)iPtr[13];
84  oPtr[14] = (float)iPtr[14];
85  oPtr[15] = (float)iPtr[15];
86  }
87  }

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