Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Camera2D limits drawing #102868

Merged
merged 1 commit into from
Feb 15, 2025
Merged

Conversation

arkology
Copy link
Contributor

Camera2D limits drawing should not be affected by skew and rotation.
Discovered during #101427 (comment)

Before:

Godot_v4.4-beta3_win64_D03QmMH2ps.mp4

After:

godot.windows.editor.dev.x86_64_qTjKNvXSZU.mp4

@arkology arkology requested a review from a team as a code owner February 14, 2025 17:32
@KoBeWi KoBeWi added this to the 4.4 milestone Feb 14, 2025
@Lazy-Rabbit-2001
Copy link
Contributor

Lazy-Rabbit-2001 commented Feb 15, 2025

what if the camera really needs to be rotated? e.g. rotated camera to make rotated visual effect for a level.
it makes sense to me to ban skew on camera, but it doesn't to disallow rotation 🤔
meanwhile, there is a fact that the limits rect is transformed as the camera rotates with rotate_camera(iirc) on. so disallowing this seems to be conflict against the feature..

@arkology
Copy link
Contributor Author

arkology commented Feb 15, 2025

what if the camera really needs to be rotated? e.g. rotated camera to make rotated visual effect for a level. it makes sense to me to ban skew on camera, but it doesn't to disallow rotation 🤔 meanwhile, there is a fact that the limits rect is transformed as the camera rotates with rotate_camera(iirc) on. so disallowing this seems to be conflict against the feature..

This PR doesn't break anything in that area (does not change actual behavior, only drawing). Reality is that rotated camera still stays in the same limits as unrotated camera. And this is another bug.

godot.windows.editor.dev.x86_64_9TJzepjNkl.mp4

@Lazy-Rabbit-2001
Copy link
Contributor

Maybe it was me that didn't make you sense of what I had meant. I meant that when ignore_rotation is turned off, the rectangle of the limits in the game runtime will also be transformed. For example:
image.png
This will become
image.png
So if the limits rotation is fixed in the editor side, users cannot make sure the accurate boundary, which is inconsistent with what it runs like in the runtime and makes inconsistent and inaccurate sense to users.

@arkology
Copy link
Contributor Author

arkology commented Feb 15, 2025

I meant that when ignore_rotation is turned off, the rectangle of the limits in the game runtime will also be transformed.

If so, I think something is wrong with camera work, it should not be different in-editor and in-game.
But this is not in the scope of current PR, because with this PR camera limits drawn in the editor now match real camera limits in editor.

@akien-mga akien-mga merged commit f0f65af into godotengine:master Feb 15, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@arkology arkology deleted the camera_2_unlimited branch February 16, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants