I'm happy to announce an initial (alpha) version of luaODE which
provides Lua bindings for the Open Dynamics Engine. It's built as a
Lua binary module and is currently OSX only although it is UB. luaODE
currently binds the majority of the ODE 0.7 library in a 1:1 manner
with the API functions, so there are no higher-level constructs
provided beyond what ODE offers.
As an example, here's how parameters of a World in luaODE are initialized:
ode.dWorldSetGravity(w, 0., -9.8, 0.)
Aside from making a few very very basic examples, luaODE has not
really been testedso please report any bugs. In the download on my
C74 share site (https://cycling74.com/twiki/bin/view/Share/WesleySmith)
there is the module (ode.so) and an example script and patch. luaODE
can be used inside Max/Jitter with the jit.gl.lua object also
available on my share site, which provides a low-level interface to
OpenGL and now has the ability to run physics simulations.
The example patch is really simple and crude, so I hope to add some
more examples in the near future. For documentation, the best place
to look is the latest ODE userguide
With very few
exceptions, the functions found in there correspond to the functions
in luaODE, taking the same arguments. The main exception is that
enums have been changed to strings in the Lua interface as can be
found in the example script. I've also added a dContactGroup type for
collision detection. An example of how to use it can also be found in
the example script.
One final note ... if you downloaded jit.gl.lua in the first few weeks
after I uploaded it, you may need to redownload it. I forgot to setup
the loading of binary modules in my original upload, so if you get an
error that looks something like "dynamic loading not enabled",
download the version currently on my share site and it will be fixed.
And don't forget that Lua modules go in the C74/lua/luamods directory.
jit.gl.lua won't be able to find it anywhere else.