getCameraProjectionMatrix method

  1. @override
Future<Matrix4> getCameraProjectionMatrix()
override

I don't think these two methods are accurate - don't rely on them, use the Frustum values instead. I think because we use setLensProjection and setScaling together, this projection matrix doesn't accurately reflect the field of view (because it's using an additional scaling matrix). Also, the near/far planes never seem to get updated (which is what I would expect to see when calling getCameraCullingProjectionMatrix)

Implementation

@override
Future<Matrix4> getCameraProjectionMatrix() async {
  if (_viewer == null) {
    throw Exception("No viewer available");
  }

  var arrayPtr = get_camera_projection_matrix(_viewer!);
  var doubleList = arrayPtr.asTypedList(16);
  var projectionMatrix = Matrix4.fromList(doubleList);
  thermion_flutter_free(arrayPtr.cast<Void>());
  return projectionMatrix;
}