encodeMatrix4 static method

List<double>? encodeMatrix4(
  1. Matrix4? value
)

Encodes the value to a Matrix4. This will encode the value into a 16 element List of double.

The array takes the following format:

[
  x0,
  x1,
  x2,
  x3,
  y0,
  y1,
  y2,
  y3,
  z0,
  z1,
  z2,
  z3,
  w0,
  w1,
  w2,
  w3
]

Implementation

static List<double>? encodeMatrix4(Matrix4? value) {
  List<double>? result;

  if (value != null) {
    result = [
      value.row0.x,
      value.row1.x,
      value.row2.x,
      value.row3.x,
      value.row0.y,
      value.row1.y,
      value.row2.y,
      value.row3.y,
      value.row0.z,
      value.row1.z,
      value.row2.z,
      value.row3.z,
      value.row0.w,
      value.row1.w,
      value.row2.w,
      value.row3.w,
    ];
  }

  return result;
}