Okay, I've really lapsed with ruby in so many ways :(
What are people using for math in ruby? I have a cpp file full of math stuff that I use for anything cpp related are people doing this in ruby itself or is there a tasty gem out there that can help?
I would have thought lots of vectors/calculas and even things like square roots would take its toll on ruby? (not used 1.9) square roots are expensive in cpp as it is. An A* thing I did in ruby couldn't handle all the square roots so I faked it.
I know Gosu has rotations and translate. but I need MORE!!!
oh that is cool :D
Until you want to deploy it I guess. Wow, that sounds like hell. :D
I have put RubyInline code into an Ocra executable and it would work fine for other people who don't have the devkit! You just have to ensure that the inline dll cache is saved locally, rather than in the default and include that with Ocra. Remember, you only need the dev-kit or to recompile if the source files change!
(Use "ENV['INLINEDIR']" to tell RubyInline where to save/load the compiled code somewhere inside your project)
Hmm, so it is perfectly usable for Windows/Linux then, but not in OS X until the gem gets compiled into the Gosu .app. Has potential, anyway!
Even then it would only work on Mac systems with Xcode installed. But maybe you could enable the DLL cache and run it both in 32-bit and 64-bit mode on a Mac, just like with the Windows version.
I don't think square roots are a big problem nowadays, except on platforms without a real FPU such as the iOS devices. The allocation of Float objects, which live on the heap and garbage-collected, plus the general overhead of calling a function in Ruby are probably much worse.
no FPU on iPhone etc. hmmm. oh well.
It isn't just sqrt but alot of maths in general. I have to do a lot of lighting and physics this year, and Ruby/Gosu would be good for prototyping some of this stuff (so no need to worry about other people), felt the maths would be slowing some of this down.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill