Skip to content

Commit

Permalink
Added functionality to save data from burrito into Waypoint protobuf …
Browse files Browse the repository at this point in the history
…format
  • Loading branch information
klingbolt committed Aug 24, 2023
1 parent 62b8373 commit b7d879d
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 194 deletions.
2 changes: 2 additions & 0 deletions Gizmo/PointEdit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ func update_point():
if self.translation != self.last_translation:
if point_type == "path" || point_type == "area":
self.object_link.set_point_position(self.object_index, self.translation)
self.object_link.update_waypoint_trail()
self.object_2d_link.points[self.object_index] = Vector2(self.translation.x, self.translation.z)
if point_type == "icon":
self.object_link.translation = self.translation
self.object_link.update_waypoint_icon()
print("update")
self.last_translation = self.translation

Expand Down
6 changes: 6 additions & 0 deletions Icon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ const Waypoint = preload("res://waypoint.gd")
var texture_path
var waypoint: Waypoint.Icon

func update_waypoint_icon():
var position = self.waypoint.position()
position.set_x(translation[0])
position.set_y(translation[1])
position.set_z(-translation[2])

func set_icon_image(texture_path: String):
self.texture_path = texture_path

Expand Down
8 changes: 8 additions & 0 deletions Route.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ var waypoint: Waypoint.Trail

var point_list := PoolVector3Array()

func update_waypoint_trail():
self.waypoint.clear_trail_data()
var trail_data = self.waypoint.new_trail_data()
for point in self.point_list:
trail_data.add_points_x(point[0])
trail_data.add_points_y(point[1])
trail_data.add_points_z(-point[2])

func create_mesh(point_list: PoolVector3Array):
self.point_list = point_list
refresh_mesh()
Expand Down
Loading

0 comments on commit b7d879d

Please sign in to comment.