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

A rotating Camera2D #11

Merged
merged 2 commits into from
Feb 13, 2014
Merged

Conversation

rafalcieslak
Copy link
Contributor

These changes add a new Camera2D.Rotating property. By default this setting is off, and such default behaviour is exactly the same as before these changes.

When on, the camera will follow it's global rotation, so that one can change its orientation if desired.
In some cases rotating the camera makes not much sense, for example when it is a child of a movable character in a side-scrolling platform game - it should follow that character, but never rotate, so that game's top is always camera's top.

However, there is a number of cases when we would like to rotate the view.

  • Any kind of 2D top-down games, where the player sees the surroundings from above, like a flat map - in such case the camera should follow character's orientation, so that screen's top is the character's front. For example, top-down driving/racing game's controls are much less confusing when if the camera rotates [to enable view from vehicle's perspective one might simply reparent the camera to the vehicle node, and enable Centered and Rotating properties.].
  • Some animations/effect may include a wiggling camera.
  • Games with perspective changes, (where e.g. one can change gravity orientation) may want to rotate the camera instead of rotating the whole world, as this approach is simpler and probably more efficient.

The way I have implemented this feature makes it fully compatible with other camera properties, including Camera2D.Centered, Camera2D.Zoom, Camera2D.Offset, drag margin, etc.

It does not break existing scenes, as it is an optional feature that is turned off by default.

I have tested it in a number of different use cases [following cam, dragged cam, static camera, multiple cameras and animated camera movement], with desired results, but if you notice anything wrong, I will be happy to fix it.

godotengine pushed a commit that referenced this pull request Feb 13, 2014
@godotengine godotengine merged commit 4e2c81b into godotengine:master Feb 13, 2014
@draxdeveloper draxdeveloper mentioned this pull request Aug 31, 2015
hungrymonkey referenced this pull request in hungrymonkey/godot Sep 30, 2017
luiscla27 added a commit to luiscla27/godot that referenced this pull request Dec 30, 2020
lawnjelly added a commit to lawnjelly/godot that referenced this pull request Mar 30, 2023
Fix audio mute state in running projects
YeldhamDev pushed a commit to YeldhamDev/godot that referenced this pull request Jul 21, 2023
Allow rendering of 3d content at lower resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants