dan miller wrote:
> Ethan --
>
> I know ODE pretty well but not the heightfield stuff. I need it for a
> couple projects I'm working on. I'd love to collaborate on it, or at least
> act as a beta tester. I don't have much experience with Pyrex but it looks
> straightforward enough.
>
> Please feel free to email me at danbmil99 at yahoo dot com.
How do you feel about being an alpha tester? Attached is a patch that
builds but I can't promise much more than that. Specifically it only
wraps one HeightfieldBuild function (there are two or three others)
and there aren't too many docstrings.
You should be able to use it like:
def heightback(data, x, z):
return x**3+z**3
d = ode.HeightfieldData()
d.build_callback(None, heightback, 1, 1, 8, 8, 1, 0, 1, 0)
g = ode.GeomHeightfield(d, False, space)
The parameters to build_callback are:
* data for callback
* callback, which should return a float
* width of geom
* depth of geom
* number of width samples
* number of depth samples
* scale factor applied to values computed by callback
* offset added to values computed by callback
* thickness
* whether to tile
If you can come up with a cool demo that demonstrates the code in
question, that would be a really handy example. (If you have the ODE
sources handy, there's an example in
ode-0.7/ode/test/test_heightfield.cpp.) Of course, let me know if it
doesn't work.
Ethan
|