In recent weeks I've changed the default mode of ruby-processing from using the included jruby-complete by default to using an external (system installed) jruby. So the --jruby flag is now deprecated (it doesn't do anything) and is replaced by the --nojruby flag which causes the installed jruby-complete to be used instead of the system version. The jruby-complete is retained for the following uses:-
- To support application export
- To run certain sketches (mainly GLSL shader sketches) that wont run with installed jruby
- For people without an installed jruby (for whatever reason), make sure and use --nojruby flag.
Anyway I've also revisited, some of the samples with a view to introducing some more idiomatic ruby, and one thing I came up with was the idea to replace the heavyweight PVector class with a lightweight Struct alternative when the PVector class was being used as a repository for x, y, z values.
Vect = Struct.new(:x, :y, :z) do
def add v
self.x += v.x
self.y += v.y
self.z += v.z
end
end
No comments:
Post a Comment