summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
Diffstat (limited to 'core/math')
-rw-r--r--core/math/camera_matrix.cpp5
-rw-r--r--core/math/camera_matrix.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index 9443addd22..57c53b0adb 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -710,6 +710,11 @@ void CameraMatrix::scale_translate_to_fit(const AABB &p_aabb) {
matrix[3][3] = 1;
}
+void CameraMatrix::add_jitter_offset(const Vector2 &p_offset) {
+ matrix[3][0] += p_offset.x;
+ matrix[3][1] += p_offset.y;
+}
+
CameraMatrix::operator Transform3D() const {
Transform3D tr;
const real_t *m = &matrix[0][0];
diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h
index f1aea5e4e8..a4051cee3b 100644
--- a/core/math/camera_matrix.h
+++ b/core/math/camera_matrix.h
@@ -95,6 +95,7 @@ struct CameraMatrix {
operator String() const;
void scale_translate_to_fit(const AABB &p_aabb);
+ void add_jitter_offset(const Vector2 &p_offset);
void make_scale(const Vector3 &p_scale);
int get_pixels_per_meter(int p_for_pixel_width) const;
operator Transform3D() const;