Skip to main content
gamedev.net
🔒 Locked

ode for 2d simulation

Started by Troodon 5 replies 1k views
Original Post
Troodon
Troodon
Hello! I have one question. Does anybody know how to use the ODE physics engine for 2D simulations? Thanks in advance!
Rob Loach
Rob Loach
Although I'm not sure if they did some work on it for ODE 0.6, you could use Plane2D. It's a major pain to use, unfortunately.
Rob Loach [Website] [Projects] [
Troodon
Troodon
Thanks for your reply! I'm using ODE 0.6 and for my understanding Plane2D only works for ODE 0.039 (or older versions). Is there any other (simple) way to make 2D simulations possible? I guess the "sandwich" approach would work but isn't very stable, or am I misstaken?
Gorax
Gorax
Google helped me dig up this. It was in these forums not too long ago, but finding things like that can be a little tedious at times. I'm not too sure about the licensing, but the engine itself doesn't look too bad.
Troodon
Troodon
Thanks! I will look in to it!
shadowisadog
shadowisadog
I got Plane2d working on ODE 0.6, once I fixed the compile errors it worked fine ;) (Took about an hour).

Plane2d isn't really that much harder to use them any other joint, it is just a pain to "install" as you have to integrate it directly with the source code.

The biggest thing was I hacked in the dVector3 stuff:

dVector3 mVec;    if (joint->row_motor_x > 0)	{		mVec[0]=Midentity[0][0];		mVec[1]=Midentity[0][1];		mVec[2]=Midentity[0][2];		joint->motor_x.addLimot(joint, info, joint->row_motor_x, mVec, 0);	}    if (joint->row_motor_y > 0)	{		mVec[0]=Midentity[1][0];		mVec[1]=Midentity[1][1];		mVec[2]=Midentity[1][2];        joint->motor_y.addLimot(joint, info, joint->row_motor_y, mVec, 0);	}    if (joint->row_motor_angle > 0)	{		mVec[0]=Midentity[2][0];		mVec[1]=Midentity[2][1];		mVec[2]=Midentity[2][2];        joint->motor_angle.addLimot (joint, info, joint->row_motor_angle, mVec, 1);	}


It is really messy but I didn't know a better way to convert the Identity matrix to a dReal3 :P. If anyone knows of a way then that would be great ;).
Troodon
Troodon
Thanks! I will try that later on today. Is it possible for you to send me the files that need to be modified?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.