• Advertisement
Sign in to follow this  

Physics engine - easy to implement with other SDKs?

This topic is 3874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been looking for a simple physics engine/library I can use in C++ with the new Blitz3D SDK. The big problem is: I took a look at the Newton, ODE, and Tokamak libraries, and the tutorials are too hard for me to substitute with my current SDK. What I mean is, they all use plain DirectX or OpenGL code to generate some kind of mesh/shape to use as an example. I don't really know what to change for it to work with the SDK. Any suggestions? Kinda stuck here and the SDK wasn't exactly cheap, so I'm not even thinking of a new solution. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
There's nothing in any of those libraries which ties you to plain DirectX or OpenGL code. Just grab the transformation from each body on the physics side and put it in the corresponding object on the graphics side. The only tricky part is converting between the different matrix formats.

Share this post


Link to post
Share on other sites
Well, Newton uses a row-vector form with postmultiplication-based transformations. I'm pretty sure ODE uses a column-vector form with premultiplication-based transformation. I don't know what Tokamak uses. If your physics system and your graphics system use the same convention, just copy over the matrix element-wise. Otherwise, you need to transpose it. And if you don't know what some of the words I've used mean, you need to learn more about linear algebra and affine transformations before doing this stuff.

Share this post


Link to post
Share on other sites
Quote:
Original post by IKG
I've been looking for a simple physics engine/library I can use in C++ with the new Blitz3D SDK. The big problem is: I took a look at the Newton, ODE, and Tokamak libraries, and the tutorials are too hard for me to substitute with my current SDK.

What I mean is, they all use plain DirectX or OpenGL code to generate some kind of mesh/shape to use as an example. I don't really know what to change for it to work with the SDK.

Any suggestions? Kinda stuck here and the SDK wasn't exactly cheap, so I'm not even thinking of a new solution.

Thanks!


Integrate? Do what I do, create the objects in the physics sdk then get their transformation and rotations every step and apply them to your 3D model.

So if you have a box mesh thats 2x2x2 create a geom (in Ode for instance) of a box thats 2x2x2 then make the transformation and rotation of the box mesh to that of the Ode geom.

Anyway, if you need to convert matrix formats and whatnot look here (it's for directx but it should give you a start): http://opende.sourceforge.net/wiki/index.php/FAQ#Can_I_use_ODE_with_DirectX.3F

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement