Jump to content
  • Advertisement
Sign in to follow this  
suliman

2D rigid bodies - working tutorial?

This topic is 3985 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

ive found several tutorials but gotten none of them to compile due to the fact that all needed libs are never included, and when i find the libs and headers it needs they are wrong versions etc etc. So: 1. Is there any code doing box-box rigid body example that included ALL it needs to be compiled? (so i can start to disect and understand) 2. How hard is it to make it myself? What i need is cars (rectangles) bumping into other cars, trees etc. I realize its much more simple if i skip rotation + consider all bodies circular... thanks a lot E

Share this post


Link to post
Share on other sites
Advertisement
1. Box2D

2. That really depends on your level of math and your comprehension of physics.

May I say, you are very unlikely to understand what is going on just by looking at the code. You'll need to read the tutorial on the website, and its rather math heavy. Good calculus and linear algebra basics at least.

Share this post


Link to post
Share on other sites
thanks Steadtler, the precompiled is very clear and just what im after. It doesnt compile though...



E:\GDC2006_ErinCatto\Box2D\World.cpp(19) : error C2653: 'set<struct Arbiter,struct std::less<struct Arbiter>,class std::allocator<struct Arbiter> >' : is not a class or namespace name
E:\GDC2006_ErinCatto\Box2D\World.cpp(19) : error C2146: syntax error : missing ';' before identifier 'ArbIter'
E:\GDC2006_ErinCatto\Box2D\World.cpp(19) : fatal error C1004: unexpected end of file found


//And loads of this:
E:\GDC2006_ErinCatto\Box2D\World.cpp(114) : error C2374: 'i' : redefinition; multiple initialization



am i doing something wrong? Thanks for your help

Share this post


Link to post
Share on other sites
What compiler are you using? This version of Box2D is known to compile on VS2003, 2005, and on Linux with GCC (with small changes):

Latest Box2D

Share this post


Link to post
Share on other sites
vc++ 6.0
see above for what errors it gives me. Should i just include all files and make a project of it or what? Thats what i did and it produced those errors.

If i try with the lite it instead:

_CRTIMP __declspec(noreturn) void __cdecl exit(__in int _Code);

//compiler complains about that line
box2d_lite\glut.h(147) : error C2065: '__in' : undeclared identifier




Plz help :)

Share this post


Link to post
Share on other sites
Quote:
Original post by suliman
vc++ 6.0

Plz help :)


Get rid of 6.0. It's a horrible compiler that can't compile valid code. Upgrade to MSVC 2005 express edition (and install the PlatformSDK too). It's free and a good compiler

That's why nothing is compiling for you. Your compiler is broken.

Example (this is illegal in 6.0 but is perfectly correct code

for ( int i = 0; i < something; ++i )
{
}

for ( int i = 0; i < something; ++i )
{
}



it thinks that i is declared one level of scope up, instead of inside the for loop scope. That's what all those duplicate errors are about.

-me

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!