Created
May 8, 2021 06:49
-
-
Save monkstone/cda89e3e8c5c143e23fb056848665bce to your computer and use it in GitHub Desktop.
Adaptor for GMP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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