Method: SGS::Waypoint#initialize

Defined in:
lib/sgs/waypoint.rb

#initialize(location = nil, normal = 0.0, range = 0.1, name = "", attractor = true) ⇒ Waypoint

Define a new Attractor or Repellor, based on certain parameters. The location is the centre of the waypoint. The normal is the compass angle of the start of the semicircle, and the range is the size of the arc. You can specify an optional name for the waypoint and also indicate if we should be attracted or repelled by it.



73
74
75
76
77
78
79
80
81
# File 'lib/sgs/waypoint.rb', line 73

def initialize(location = nil, normal = 0.0, range = 0.1, name = "", attractor = true)
  @location = location || Location.new
  @normal = normal
  @range = range
  @name = name
  @attractor = attractor
  @bearing = nil
  @distance = 0
end