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 {
63
63
}
64
64
65
65
66
- internal func findNearestNode( to position: SIMD3 < Float > , between nodes: [ RouteVertex ] ) -> RouteVertex {
66
+ public func findNearestNode( to position: SIMD3 < Float > , between nodes: [ RouteVertex ] ) -> RouteVertex {
67
67
let newNode = RouteVertex ( position)
68
68
return nodes. reduce ( nodes [ 0 ] ) { ( best, next) -> RouteVertex in
69
69
return newNode. cost ( to: next) < newNode. cost ( to: best) ? next : best
70
70
}
71
71
}
72
72
73
- internal func findNearestNode( to position: SIMD3 < Float > ) -> RouteVertex {
73
+ public func findNearestNode( to position: SIMD3 < Float > ) -> RouteVertex {
74
74
return self . findNearestNode ( to: position, between: self . vertexNodes)
75
75
}
76
76
77
77
78
78
/// 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 ] ) {
80
80
var closestPoint = self . vertexNodes [ edges [ 0 ] [ 0 ] ] . getVectorPos ( )
81
81
var closestDistance = startPoint. distance ( to: closestPoint)
82
82
var matchingNodes = [ self . vertexNodes [ edges [ 0 ] [ 0 ] ] , self . vertexNodes [ edges [ 0 ] [ 1 ] ] ]
Original file line number Diff line number Diff line change 7
7
8
8
import GameplayKit. GKGraph
9
9
10
- internal class RouteVertex : GKGraphNode3D {
10
+ public class RouteVertex : GKGraphNode3D {
11
11
var travelCost : [ GKGraphNode : Float ] = [ : ]
12
12
13
13
var simdPos : SIMD3 < Float > {
14
14
return SIMD3 < Float > ( self . position)
15
15
}
16
16
17
- convenience init ( position: [ Float ] ) {
17
+ internal convenience init ( position: [ Float ] ) {
18
18
self . init ( point: vector_float3 ( position) )
19
19
}
20
20
21
- convenience init ( _ position: SIMD3 < Float > ) {
21
+ internal convenience init ( _ position: SIMD3 < Float > ) {
22
22
self . init ( point: vector_float3 ( position) )
23
23
}
24
24
25
- override init ( point: vector_float3 ) {
25
+ internal override init ( point: vector_float3 ) {
26
26
super. init ( point: point)
27
27
}
28
28
You can’t perform that action at this time.
0 commit comments