38 lines
719 B
GDScript
38 lines
719 B
GDScript
extends Reference
|
|
class_name SummerDayZRange
|
|
|
|
|
|
signal changed_from_external
|
|
|
|
|
|
var listed: bool = false
|
|
var index: int setget _set_index, _get_index
|
|
var _index: int
|
|
|
|
var real_z_rear_limit: float
|
|
var real_z_front_limit: float
|
|
|
|
var squished_z_rear_limit: float
|
|
var squished_z_front_limit: float
|
|
|
|
|
|
func _set_index(value: int):
|
|
if listed:
|
|
SummerDay.z_space_manager.move_z_range(self, value)
|
|
_index = value
|
|
else:
|
|
_index = value
|
|
SummerDay.z_space_manager.add_z_range(self)
|
|
listed = true
|
|
|
|
|
|
func _get_index():
|
|
return _index
|
|
|
|
|
|
# Only returns the z row of rotation Transform. + Translation, right?
|
|
func _get_rotation(rotation: Quat) -> Vector3:
|
|
var basis = Basis(rotation)
|
|
var z_row = basis.z
|
|
return Vector3.ZERO
|