|
|
@ -34,6 +34,7 @@ func _ready(): |
|
|
|
timer = get_node("ResetTimer") |
|
|
|
path = get_node("Path") |
|
|
|
path.curve = path.curve.duplicate() |
|
|
|
path.curve.set_bake_interval(0.05) |
|
|
|
follow = get_node("Path/PathFollow") |
|
|
|
|
|
|
|
func _physics_process(delta): |
|
|
@ -45,9 +46,10 @@ func _physics_process(delta): |
|
|
|
# curve |
|
|
|
if has_next && (path.curve.get_point_count() == 0 || follow.get_unit_offset() >= 1.0): |
|
|
|
has_next = false |
|
|
|
if path.curve.get_point_count() > 0: |
|
|
|
path.curve.clear_points() |
|
|
|
if path.curve == null: |
|
|
|
path.curve = Curve3D.new() |
|
|
|
|
|
|
|
path.curve.set_bake_interval(0.05) |
|
|
|
for i in range(buffered_curve.get_point_count()): |
|
|
|
var _pos = buffered_curve.get_point_position(i) |
|
|
|
var _in = buffered_curve.get_point_in(i) |
|
|
@ -64,8 +66,8 @@ func _physics_process(delta): |
|
|
|
road_index = get_road().get_index() |
|
|
|
|
|
|
|
print(buffered_translate) |
|
|
|
print(buffered_curve.get_baked_length()) |
|
|
|
print(path.curve.get_baked_length()) |
|
|
|
print(buffered_curve.get_point_count()) |
|
|
|
print(path.curve.get_point_count()) |
|
|
|
if get_road() != null: |
|
|
|
var road = get_road() |
|
|
|
var penalty_index = road.penalty_index(follow.get_offset(), current_speed) |
|
|
|