Skip to content

Commit

Permalink
Add option to disable y axis shifting in FloatingOrigin.
Browse files Browse the repository at this point in the history
  • Loading branch information
addmix committed Dec 3, 2023
1 parent c69e91a commit a1bb493
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nodes/3d/floating_origin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ signal pre_origin_shift
signal origin_shifted

@export var disabled : bool = false
@export var disable_y_shift : bool = false
@export var shift_threshold : float = 1024.0
@export var shift_cooldown : float = 5.0
var _can_shift : bool = true
Expand Down Expand Up @@ -33,7 +34,10 @@ func shift_origin(_position : Vector3) -> void:
change_in_cells.y = int(_position.y) / int(shift_threshold)
@warning_ignore("integer_division")
change_in_cells.z = int(_position.z) / int(shift_threshold)


if disable_y_shift:
change_in_cells.y = 0

pre_origin_shift.emit(Vector3(change_in_cells) * shift_threshold)

#we'll see how well shifting the root node only will work
Expand Down

0 comments on commit a1bb493

Please sign in to comment.