2D Collisions and Physics

Started by
6 comments, last by oliii 16 years, 11 months ago
Are there any good, free 2d physics and collision-response engines out there for C#? I'm looking to start my next game in XNA soon, and 2d physics are a must. I've seen the Farseer engine, but it seems rather incomplete at the moment. Wrapping an engine that was made for a different language is also an option for me, I have plenty of time for this project. On another note... would it be hard to create my own 2d physics engine? My math skills are decent, but I'm not sure how I would go about creating it. For my game, I am aiming for Breakquest-ish physics (www.nurium.com). All suggestions and advice are welcome.
Advertisement
from personnal experience, it should be feasable to write your own. I've got demoes, if only I could access my webspace... :/

Everything is better with Metal.

Do you know of any tutorials, books, or articles that could help me get started?

Demos would be great. Unfortunately, after I downloaded one from your website, I now get "The web site you are trying to access has exceeded its allocated data transfer" when I try to download a second one.

Thanks for the response.
If you enjoy this type of thing, check out N Tutorials' collision detection and response page. It provides a fantastic way to really understand what's happening. It skimps out a bit on the math side, but there's already more than enough info out on the web about vectors.

Or, you could use a 3D engine. They're pretty easy to get working in just 2D with no real performance issues. That's what I'm doing for my game. I just set forces, velocities, and positions to have no z component (or no x and y component for rotation and torques) every frame. No issues.
I haven't tried it, but you might want to look at Physics2D.Net.

As for engines NOT in C#, there's Erin Catto's Box2D. Considering the fact that it only handles boxes, it's pretty impressive that it's been shown at GDC twice.

And inspired by Box2D, we also have Chipmunk. Chipmunk is written for the mac, but the videos are worth taking a look at :D

Hope this helps.

I found these at gphysics.com

- edit -

Hi, Oliii.
There is a nice one using C# and xna called Farseer Physics Engine

http://www.codeplex.com/FarseerPhysics
I think you'd be best trying a 3rd party engine. Getting into the physics / collision will take lots of your time.

still can't access my webspace... maybe too much traffic.

Everything is better with Metal.

Here's a little discussion about sphere / box collision. And also collision response with rigid body dynamics, all in one code block.

http://www.gamedev.net/community/forums/topic.asp?topic_id=440708

It's based on Chris Hecker's physics tutorials, and a simple intersection detection algo.

another discussion talking about the swept SAT, more precise collision test.

http://www.gamedev.net/community/forums/topic.asp?topic_id=346956

It's based on this tutorial for polygon intersection detection

http://www.harveycartel.org/metanet/tutorials.html

Everything is better with Metal.

This topic is closed to new replies.

Advertisement