feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -31,7 +31,7 @@
|
|||
#include "camera_2d.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "scene/main/window.h"
|
||||
#include "scene/main/viewport.h"
|
||||
|
||||
bool Camera2D::_is_editing_in_editor() const {
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
|
@ -115,11 +115,11 @@ void Camera2D::set_zoom(const Vector2 &p_zoom) {
|
|||
Point2 old_smoothed_camera_pos = smoothed_camera_pos;
|
||||
_update_scroll();
|
||||
smoothed_camera_pos = old_smoothed_camera_pos;
|
||||
};
|
||||
}
|
||||
|
||||
Vector2 Camera2D::get_zoom() const {
|
||||
return zoom;
|
||||
};
|
||||
}
|
||||
|
||||
Transform2D Camera2D::get_camera_transform() {
|
||||
if (!get_tree()) {
|
||||
|
|
@ -277,7 +277,7 @@ void Camera2D::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
case NOTIFICATION_READY: {
|
||||
if (Engine::get_singleton()->is_editor_hint() && is_part_of_edited_scene()) {
|
||||
if (is_part_of_edited_scene()) {
|
||||
ProjectSettings::get_singleton()->connect(SNAME("settings_changed"), callable_mp(this, &Camera2D::_project_settings_changed));
|
||||
}
|
||||
} break;
|
||||
|
|
@ -300,8 +300,10 @@ void Camera2D::_notification(int p_what) {
|
|||
// Force the limits etc. to update.
|
||||
_interpolation_data.xform_curr = get_camera_transform();
|
||||
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
|
||||
_update_process_callback();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_SUSPENDED:
|
||||
case NOTIFICATION_PAUSED: {
|
||||
if (is_physics_interpolated_and_enabled()) {
|
||||
_update_scroll();
|
||||
|
|
@ -314,7 +316,9 @@ void Camera2D::_notification(int p_what) {
|
|||
}
|
||||
if (is_physics_interpolated_and_enabled()) {
|
||||
_ensure_update_interpolation_data();
|
||||
_interpolation_data.xform_curr = get_camera_transform();
|
||||
if (Engine::get_singleton()->is_in_physics_frame()) {
|
||||
_interpolation_data.xform_curr = get_camera_transform();
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
|
|
@ -387,7 +391,7 @@ void Camera2D::_notification(int p_what) {
|
|||
inv_camera_transform.xform(Vector2(0, screen_size.height))
|
||||
};
|
||||
|
||||
Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space
|
||||
Transform2D inv_transform = get_global_transform().affine_inverse(); // Undo global space.
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i + 1) % 4]), area_axis_color, area_axis_width);
|
||||
|
|
@ -401,13 +405,13 @@ void Camera2D::_notification(int p_what) {
|
|||
limit_drawing_width = 3;
|
||||
}
|
||||
|
||||
Vector2 camera_origin = get_global_position();
|
||||
Vector2 camera_scale = get_global_scale().abs();
|
||||
Transform2D inv_transform = get_global_transform().affine_inverse();
|
||||
|
||||
Vector2 limit_points[4] = {
|
||||
(Vector2(limit[SIDE_LEFT], limit[SIDE_TOP]) - camera_origin) / camera_scale,
|
||||
(Vector2(limit[SIDE_RIGHT], limit[SIDE_TOP]) - camera_origin) / camera_scale,
|
||||
(Vector2(limit[SIDE_RIGHT], limit[SIDE_BOTTOM]) - camera_origin) / camera_scale,
|
||||
(Vector2(limit[SIDE_LEFT], limit[SIDE_BOTTOM]) - camera_origin) / camera_scale
|
||||
inv_transform.xform(Vector2(limit[SIDE_LEFT], limit[SIDE_TOP])),
|
||||
inv_transform.xform(Vector2(limit[SIDE_RIGHT], limit[SIDE_TOP])),
|
||||
inv_transform.xform(Vector2(limit[SIDE_RIGHT], limit[SIDE_BOTTOM])),
|
||||
inv_transform.xform(Vector2(limit[SIDE_LEFT], limit[SIDE_BOTTOM]))
|
||||
};
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
|
@ -432,7 +436,7 @@ void Camera2D::_notification(int p_what) {
|
|||
inv_camera_transform.xform(Vector2((screen_size.width / 2) - ((screen_size.width / 2) * drag_margin[SIDE_LEFT]), (screen_size.height / 2) + ((screen_size.height / 2) * drag_margin[SIDE_BOTTOM])))
|
||||
};
|
||||
|
||||
Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space
|
||||
Transform2D inv_transform = get_global_transform().affine_inverse(); // Undo global space.
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
draw_line(inv_transform.xform(margin_endpoints[i]), inv_transform.xform(margin_endpoints[(i + 1) % 4]), margin_drawing_color, margin_drawing_width);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue