I'm wrapping a C physics library called Newton Game Dynamics (http:// www.newtondynamics.com/) and I'm having trouble with a callback that I must set. The callback is being called, but it gpfaults after returning. I'm sure about the calling conventions and parameters it receives, it's really driving me crazy... I know that a few people here use this library, so, if you can take a look, it would be great ;-)
This is the workspace code I'm trying:
world := NewtonWorld new. collision := NewtonCollision box: 1 @ 1 @ 1 on: world. location := MATRIX identity _42: 10. "set the Y position at 10 meters" box := NewtonBody newOn: world withCollision: collision. box onForceAndTorqueCallbackDo: [:newtonBody | newtonBody force: 0 @ (newtonBody mass * 9.81) @ 0. Transcript show: 'Callback called!'; cr]. box mass: 1 inertia: 1 @ 1 @ 1. box matrix: location. world update: 0.01
What game engine or 3d renderer are you using to display 3d graphics? I have successfully gotten Tv3d to work with Dolphin and am playing around with that, but also Unstdio has openGl support in it although it wasn't designed for 3d yet (though maybe it's an easy leap to make if you know what you are doing).
Thanks for making your package available, I'll definitely check it out. -Jacob
Like Unstdio I'm actually working in 2D, I'm wrapping a game engine called HGE: http://hge.relishgames.com I started wrapping NGD as I wanted to add physics to it, but I'm afraid that my NGD wrapper is stalled because of the ExternalCallback gpfault =( The problem seems to be random, but when it doesn't gpfaults I can assure you that it's really impressive to see NGD working together with HGE! Anyway, if you want to check my HGE wrapper it's hosted at Google code: http://code.google.com/p/hgetalk (you've to check out the project using svn as I didn't made any download files yet). I've ported the first 7 tutorials as workspace code so you can clearly see the differences between the C and the Smalltalk versions.
I never heard of Tv3D, I'll take a look to it; but a 3D rendering engine I was looking at is Horde3D (http://www.horde3d.org). It has a plain C API accessible through a DLL, so making the bindings for Dolphin shouldn´t be a problem.
> Like Unstdio I'm actually working in 2D, I'm wrapping a game engine > called HGE:http://hge.relishgames.com > I started wrapping NGD as I wanted to add physics to it, but I'm > afraid that my NGD wrapper is stalled because of the ExternalCallback > gpfault =( > The problem seems to be random, but when it doesn't gpfaults I can > assure you that it's really impressive to see NGD working together > with HGE! > Anyway, if you want to check my HGE wrapper it's hosted at Google > code:http://code.google.com/p/hgetalk(you've to check out the > project using svn as I didn't made any download files yet). I've > ported the first 7 tutorials as workspace code so you can clearly see > the differences between the C and the Smalltalk versions.
> I never heard of Tv3D, I'll take a look to it; but a 3D rendering > engine I was looking at is Horde3D (http://www.horde3d.org). It has a > plain C API accessible through a DLL, so making the bindings for > Dolphin shouldn´t be a problem.
> Thank you for your kind words and best regards,
> Federico Omoto
Hi Federico, I have emailed your federico.omoto email which is hosting the HGE/dolphin project in google code. I had I think the exact same problem, maybe this will help: If you are running the callback code and for some reason you hit a debug error (like a bug in your code), I need to completely shut down Dolphin Smalltalk and then re-start it again before I can reload the callback code. This is what I need to do with Tv3d, but other than that it works perfectly. I will be moving to a 2d engine soon, however, preferably in Dolphin so I am quite interested in your project =)
Sorry for the delay in the answer and thank you for your interest in my project! I'm afraid I'm not investing my time as I did before trying to release a NGD wrapper for Dolphin, it's really difficult to say what's going on, where the problem is and what IS the problem when NGD calls my ExternalCallbacks. It's frustrating not having the source code so I can solve this problem (being it at the NGD side, or at the Dolphin side if it ends up being my fault...). I had some inconvenients when I started with my HGE wrapper, particullary when I tried to make the C++ objects finalizable; but as the HGE source code is available it just was a matter of hacking the HGE code to make it Smalltalk friendly ;) Said that, I continue to adding functionality to my accelerated 2D Smalltalk game engine, but whithout physics support :(
I've also sent you an email with my thoughts on why you're able to run just the first tutorial of the HGE wapper, hope it helped you, but if not just tell me!
Regards,
Fede
On 24 jul, 17:01, zenchess <zenchessn...@gmail.com> wrote:
> Hi Federico, I have emailed your federico.omoto email which is hosting > the HGE/dolphin project in google code. > I had I think the exact same problem, maybe this will help: > If you are running the callback code and for some reason you hit a > debug error (like a bug in your code), I need > to completely shut down Dolphin Smalltalk and then re-start it again > before I can reload the callback code. This is > what I need to do with Tv3d, but other than that it works perfectly. > I will be moving to a 2d engine soon, > however, preferably in Dolphin so I am quite interested in your > project =)