-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from klingbolt/update_waypoints
Waypoint data the source of truth for position of icons and trails
- Loading branch information
Showing
5 changed files
with
199 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
extends Line2D | ||
|
||
func new_point_after(midpoint: Vector3, index: int): | ||
var midpoint2d: Vector2 = Vector2(midpoint.x, midpoint.z) | ||
var start: Vector2 = self.get_point_position(index) | ||
|
||
if self.get_point_count() > index+1: | ||
var end: Vector2 = self.get_point_position(index+1) | ||
midpoint2d = ((start-end)/2) + end | ||
add_point(midpoint2d, index+1) | ||
const Waypoint = preload("res://waypoint.gd") | ||
var waypoint: Waypoint.Trail | ||
|
||
func remove_point(index: int): | ||
self.remove_point(index) | ||
|
||
func reverse(): | ||
self.points.invert() | ||
func refresh_points(): | ||
var path_points := PoolVector2Array() | ||
var trail_data = self.waypoint.get_trail_data() | ||
for index in range(0, trail_data.get_points_z().size()): | ||
path_points.append(Vector2(trail_data.get_points_x()[index], -trail_data.get_points_z()[index])) | ||
self.points = path_points |
Oops, something went wrong.