Skip to content

Commit

Permalink
Merge pull request godotengine#28800 from JFonS/fix_clipped_camera
Browse files Browse the repository at this point in the history
Fixes to ClippedCamera
  • Loading branch information
akien-mga authored May 10, 2019
2 parents 7112a45 + 9e97bac commit ecceabe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scene/3d/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ecceabe

Please sign in to comment.