From cde89dc0abfded0d100ff540fbf4c344cb1b0e3e Mon Sep 17 00:00:00 2001 From: Johnathan Fercher Date: Sat, 9 Sep 2023 16:29:13 -0300 Subject: [PATCH] Fix data inside point --- pkg/rrt/rrt.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/rrt/rrt.go b/pkg/rrt/rrt.go index 46fcbde..caf6dd3 100644 --- a/pkg/rrt/rrt.go +++ b/pkg/rrt/rrt.go @@ -120,8 +120,9 @@ func (r *RRT[T]) getRandomPoint(world [][]T, goToFinish bool) *Point[T] { } return &Point[T]{ - X: float64(x), - Y: float64(y), + X: float64(x), + Y: float64(y), + Data: world[x][y], } } @@ -141,7 +142,8 @@ func (r *RRT[T]) getFixedPoint(minDistancePoint *Point[T], newPoint *Point[T], w //fmt.Printf("Min %s, New %s, Fix %s\n", minDistancePoint.GetString(), newPoint.GetString(), world[x][y].GetString()) return &Point[T]{ - X: float64(x), - Y: float64(y), + X: float64(x), + Y: float64(y), + Data: world[x][y], } }