File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -63,20 +63,20 @@ public class Graph3D: GKGraph {
6363 }
6464
6565
66- internal func findNearestNode( to position: SIMD3 < Float > , between nodes: [ RouteVertex ] ) -> RouteVertex {
66+ public func findNearestNode( to position: SIMD3 < Float > , between nodes: [ RouteVertex ] ) -> RouteVertex {
6767 let newNode = RouteVertex ( position)
6868 return nodes. reduce ( nodes [ 0 ] ) { ( best, next) -> RouteVertex in
6969 return newNode. cost ( to: next) < newNode. cost ( to: best) ? next : best
7070 }
7171 }
7272
73- internal func findNearestNode( to position: SIMD3 < Float > ) -> RouteVertex {
73+ public func findNearestNode( to position: SIMD3 < Float > ) -> RouteVertex {
7474 return self . findNearestNode ( to: position, between: self . vertexNodes)
7575 }
7676
7777
7878 /// Find the closest point on the graph to a given point
79- internal func findPointOnEdge( from startPoint: SIMD3 < Float > ) -> ( SIMD3 < Float > , [ RouteVertex ] ) {
79+ public func findPointOnEdge( from startPoint: SIMD3 < Float > ) -> ( SIMD3 < Float > , [ RouteVertex ] ) {
8080 var closestPoint = self . vertexNodes [ edges [ 0 ] [ 0 ] ] . getVectorPos ( )
8181 var closestDistance = startPoint. distance ( to: closestPoint)
8282 var matchingNodes = [ self . vertexNodes [ edges [ 0 ] [ 0 ] ] , self . vertexNodes [ edges [ 0 ] [ 1 ] ] ]
Original file line number Diff line number Diff line change 77
88import GameplayKit. GKGraph
99
10- internal class RouteVertex : GKGraphNode3D {
10+ public class RouteVertex : GKGraphNode3D {
1111 var travelCost : [ GKGraphNode : Float ] = [ : ]
1212
1313 var simdPos : SIMD3 < Float > {
1414 return SIMD3 < Float > ( self . position)
1515 }
1616
17- convenience init ( position: [ Float ] ) {
17+ internal convenience init ( position: [ Float ] ) {
1818 self . init ( point: vector_float3 ( position) )
1919 }
2020
21- convenience init ( _ position: SIMD3 < Float > ) {
21+ internal convenience init ( _ position: SIMD3 < Float > ) {
2222 self . init ( point: vector_float3 ( position) )
2323 }
2424
25- override init ( point: vector_float3 ) {
25+ internal override init ( point: vector_float3 ) {
2626 super. init ( point: point)
2727 }
2828
You can’t perform that action at this time.
0 commit comments