Skip to content

Instantly share code, notes, and snippets.

@monkstone
Created May 8, 2021 06:49
Show Gist options
  • Save monkstone/cda89e3e8c5c143e23fb056848665bce to your computer and use it in GitHub Desktop.
Save monkstone/cda89e3e8c5c143e23fb056848665bce to your computer and use it in GitHub Desktop.
Adaptor for GMP
java_import 'java.util.ArrayList'
java_import 'processing.core.PVector'
class VectorList
attr_reader :list
def initialize
@list = ArrayList.new
end
def << (val)
list.add(PVector.new(val.x, val.y, val.z))
end
end
my_list = VectorList.new
9.times do
my_list << Vec3D.new(rand, rand, rand)
end
puts my_list.list.last.array.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment