diff --git a/impeller/scene/camera.h b/impeller/scene/camera.h index a8b2eb7b541d0..0b31e4f89ad28 100644 --- a/impeller/scene/camera.h +++ b/impeller/scene/camera.h @@ -24,8 +24,8 @@ class Camera { Vector3 position_ = Vector3(); Vector3 target_ = Vector3(0, 0, -1); Vector3 up_ = Vector3(0, -1, 0); - Scalar z_near_ = 0.1; - Scalar z_far_ = 1000; + Scalar z_near_ = 0.1f; + Scalar z_far_ = 1000.0f; mutable std::optional transform_; }; diff --git a/lib/ui/painting/scene/scene_node.cc b/lib/ui/painting/scene/scene_node.cc index 914dd2c94a5f6..bb18de7bc7805 100644 --- a/lib/ui/painting/scene/scene_node.cc +++ b/lib/ui/painting/scene/scene_node.cc @@ -100,10 +100,22 @@ std::string SceneNode::initFromAsset(const std::string& asset_name, } static impeller::Matrix ToMatrix(const tonic::Float64List& matrix4) { - return impeller::Matrix(matrix4[0], matrix4[1], matrix4[2], matrix4[3], // - matrix4[4], matrix4[5], matrix4[6], matrix4[7], // - matrix4[8], matrix4[9], matrix4[10], matrix4[11], // - matrix4[12], matrix4[13], matrix4[14], matrix4[15]); + return impeller::Matrix(static_cast(matrix4[0]), + static_cast(matrix4[1]), + static_cast(matrix4[2]), + static_cast(matrix4[3]), + static_cast(matrix4[4]), + static_cast(matrix4[5]), + static_cast(matrix4[6]), + static_cast(matrix4[7]), + static_cast(matrix4[8]), + static_cast(matrix4[9]), + static_cast(matrix4[10]), + static_cast(matrix4[11]), + static_cast(matrix4[12]), + static_cast(matrix4[13]), + static_cast(matrix4[14]), + static_cast(matrix4[15])); } void SceneNode::initFromTransform(const tonic::Float64List& matrix4) { diff --git a/lib/ui/painting/scene/scene_shader.cc b/lib/ui/painting/scene/scene_shader.cc index 67a5ed87fada1..05382d628f779 100644 --- a/lib/ui/painting/scene/scene_shader.cc +++ b/lib/ui/painting/scene/scene_shader.cc @@ -41,10 +41,22 @@ void SceneShader::Create(Dart_Handle wrapper, Dart_Handle scene_node_handle) { void SceneShader::SetCameraTransform(const tonic::Float64List& matrix4) { camera_transform_ = - impeller::Matrix(matrix4[0], matrix4[1], matrix4[2], matrix4[3], // - matrix4[4], matrix4[5], matrix4[6], matrix4[7], // - matrix4[8], matrix4[9], matrix4[10], matrix4[11], // - matrix4[12], matrix4[13], matrix4[14], matrix4[15]); + impeller::Matrix(static_cast(matrix4[0]), + static_cast(matrix4[1]), + static_cast(matrix4[2]), + static_cast(matrix4[3]), + static_cast(matrix4[4]), + static_cast(matrix4[5]), + static_cast(matrix4[6]), + static_cast(matrix4[7]), + static_cast(matrix4[8]), + static_cast(matrix4[9]), + static_cast(matrix4[10]), + static_cast(matrix4[11]), + static_cast(matrix4[12]), + static_cast(matrix4[13]), + static_cast(matrix4[14]), + static_cast(matrix4[15])); } static impeller::Matrix DefaultCameraTransform() { @@ -52,7 +64,7 @@ static impeller::Matrix DefaultCameraTransform() { // make the DlSceneColorSource camera transform optional and // defer this default (or parameterize the camera instead). return impeller::Matrix::MakePerspective( - impeller::Degrees(45), impeller::ISize{800, 600}, 0.1, 1000) * + impeller::Degrees(45), impeller::ISize{800, 600}, 0.1f, 1000) * impeller::Matrix::MakeLookAt({0, 0, -5}, {0, 0, 0}, {0, 1, 0}); }