setCameraModelMatrix method

  1. @override
Future setCameraModelMatrix(
  1. List<double> matrix
)
override

Sets the camera model matrix.

Implementation

@override
Future setCameraModelMatrix(List<double> matrix) async {
  assert(matrix.length == 16, "Matrix must have 16 elements");
  final ptr = _module._malloc(16 * 8) as JSNumber;
  for (int i = 0; i < 16; i++) {
    _module.setValue(
        (ptr.toDartInt + (i * 8)).toJS, matrix[i].toJS, "double");
  }
  _module.ccall("set_camera_model_matrix", "void",
      ["void*".toJS, "float*".toJS].toJS, [_viewer!, ptr].toJS, null);
  _module._free(ptr);
}