Skip to content

Commit

Permalink
Fixed jitter for none physics object (#179)
Browse files Browse the repository at this point in the history
* Update README.md

* Added a checker for PCam Host when a PCam exits the scene (#175)

* Fixed jitter for none physics object

---------

Co-authored-by: Marcus Skov <Hello@MarcusSkov.com>
  • Loading branch information
P5ina and ramokz committed Mar 20, 2024
1 parent e687bce commit 3e42908
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ var _prev_camera_h_offset: float
var _prev_camera_v_offset: float
var _prev_camera_fov: float

var _should_refresh_transform: bool
var _active_pcam_2D_glob_transform: Transform2D
var _active_pcam_3D_glob_transform: Transform3D

Expand Down Expand Up @@ -322,21 +321,13 @@ func _get_pcam_host_group() -> Array[Node]:
func _process(delta):
if not is_instance_valid(_active_pcam): return

if _should_refresh_transform:
# _refresh_transform()
if _is_2D:
_active_pcam_2D_glob_transform = _active_pcam.get_global_transform()
else:
_active_pcam_3D_glob_transform = _active_pcam.get_global_transform()

_should_refresh_transform = false
if _is_2D:
_active_pcam_2D_glob_transform = _active_pcam.get_global_transform()
else:
_active_pcam_3D_glob_transform = _active_pcam.get_global_transform()

_process_pcam(delta)


func _physics_process(delta: float) -> void:
_should_refresh_transform = true

#endregion


Expand Down

0 comments on commit 3e42908

Please sign in to comment.