summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-10 11:13:20 +0200
committerGitHub <noreply@github.com>2019-05-10 11:13:20 +0200
commitecceabea7e74b56080c8deacc4323ac18b4b47c9 (patch)
treef324aa633ef7bb6bdd5f1873e8963a73c44aa51c /scene
parent7112a45d9928562722e6b91d3482b29df8ed5ff8 (diff)
parent9e97bac0cf4baeb6576874bc5ab877f57433a86d (diff)
Merge pull request #28800 from JFonS/fix_clipped_camera
Fixes to ClippedCamera
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/camera.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 54d7681a3a..8b91f56344 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -722,8 +722,9 @@ void ClippedCamera::set_process_mode(ProcessMode p_mode) {
if (process_mode == p_mode) {
return;
}
- set_process_internal(p_mode == CLIP_PROCESS_IDLE);
- set_physics_process_internal(p_mode == CLIP_PROCESS_PHYSICS);
+ process_mode = p_mode;
+ set_process_internal(process_mode == CLIP_PROCESS_IDLE);
+ set_physics_process_internal(process_mode == CLIP_PROCESS_PHYSICS);
}
ClippedCamera::ProcessMode ClippedCamera::get_process_mode() const {
return process_mode;
@@ -786,7 +787,7 @@ void ClippedCamera::_notification(int p_what) {
float csafe, cunsafe;
if (dspace->cast_motion(pyramid_shape, xf, cam_pos - ray_from, margin, csafe, cunsafe, exclude, collision_mask, clip_to_bodies, clip_to_areas)) {
- clip_offset = cam_pos.distance_to(ray_from + (cam_pos - ray_from).normalized() * csafe);
+ clip_offset = cam_pos.distance_to(ray_from + (cam_pos - ray_from) * csafe);
}
_update_camera();