mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Merge pull request #101884 from aaronp64/camera_gizmo_fov_fix
Fix `Camera3D` gizmo representation to accurately reflect FOV
This commit is contained in:
commit
b40e6a55ac
@ -180,7 +180,13 @@ void Camera3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
|
||||
|
||||
const float hsize = Math::sin(Math::deg_to_rad(fov));
|
||||
const float depth = -Math::cos(Math::deg_to_rad(fov));
|
||||
Vector3 side = Vector3(hsize * size_factor.x, 0, depth);
|
||||
|
||||
Vector3 side;
|
||||
if (camera->get_keep_aspect_mode() == Camera3D::KEEP_WIDTH) {
|
||||
side = Vector3(hsize * size_factor.x, 0, depth * size_factor.x);
|
||||
} else {
|
||||
side = Vector3(hsize * size_factor.x, 0, depth * size_factor.y);
|
||||
}
|
||||
Vector3 nside = Vector3(-side.x, side.y, side.z);
|
||||
Vector3 up = Vector3(0, hsize * size_factor.y, 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user