Method: Fox::FXGLPoint#initialize

Defined in:
lib/fox16/glshapes.rb

#initialize(*args) ⇒ FXGLPoint

Returns an initialized FXGLPoint instance. If no arguments are passed to #new, the initial point position is (0.0, 0.0, 0.0). You can specify a different initial position by passing in the x, y and z coordinates individually:

aPoint = FXGLPoint.new(x, y, z)

or as a 3-element array:

aPoint = FXGLPoint.new([x, y, z])


28
29
30
31
32
33
34
35
36
37
# File 'lib/fox16/glshapes.rb', line 28

def initialize(*args)
  super()
  if args.length == 0
    @pos = [0.0, 0.0, 0.0]
  elsif args.length == 3
    @pos = [args[0], args[1], args[2]]
  else
    @pos = args[0]
  end
end