Open jar2333 opened 1 year ago
This header of the ODE library provides the definitions of ODE types, which is useful to know for this project. All the dXID types are pointers, and the dReal type is either a float or double depending on the configuration or compiler definitions used when building ODE. The Quaternion, Matrix, and Vector definitions are shown in the manual, but knowledge of how these other types are implemented is assumed as well.
Once this issue is closed, the library can have its first release with barebones functionality (and bugs).
World class has been implemented
The ODE API as described in the manual is very easy to express in an object oriented way, using objects and methods. Each dXID type in the ODE API can have a corresponding X Ruby class to wrap it, with each of the API functions bound to some method of that class. These are:
The C
free
function invoked by the GC that the mruby API requires for objects of these classes can just be a simple wrapper call over the appropriate ODEdestroy
functions. As such (I expect) these do not need to be exposed. Conversely, thecreate
ODE functions are called in the corresponding Rubyinitialize
method.The mathematical primitives which are implemented in ODE as type aliases of dReal array types should also be wrapped in Ruby classes:
For pointer arguments which are used to return multiple values at once, returning a Ruby array with the values might be the most idiomatic way of returning those values (open to correction).
Class aliases and an
ode
namespace can be added if deemed convenient/useful.Ruby conventions for setters/getters should be respected.