Tagged Questions
43
votes
7answers
3k views
2D Platformer AABB collision problems
I have a problem with AABB collision resolution.
I resolve AABB intersection by resolving the X axis first, then the Y axis.
This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png
...
25
votes
3answers
3k views
2D water with dynamic waves
New Super Mario Bros has really cool 2D water that I'd like to learn how to create.
Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
22
votes
4answers
2k views
Momentum and order of update problems in my physics engine
This question is a "follow-up" question from my previous one, regarding collision detection and resolution, which you can find here.
If you don't want to read the previous question, here's a ...
10
votes
7answers
9k views
How do you calculate where a ball should go when it bounces off the bar?
I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a breakout clone.
Keep in mind that I ...
9
votes
6answers
2k views
Ball Physics : Smoothing the final bounces as the ball comes to rest
I've come against another issue in my little bouncing ball game.
My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
9
votes
1answer
932 views
Adding air drag to a golf ball trajectory equation
I'm developing a 2D golf game in VB.NET 2005, but I am stuck on how to implement air or wind drag that should affect the ball.
Already I have these equations for projectile:
Vo ...
9
votes
2answers
751 views
Simulating an object floating on water
I'm working on a top down fishing game. I want to implement some physics and collision detection regarding the boat moving around the lake. I would like for be able to implement thrust from either the ...
8
votes
2answers
2k views
Why use Runge Kutta Integration over Improved Euler Integration?
I was reading these slides (very good by the way!), and if you skip all the way to the end the author compares all the different integrators presented.
In one way or another, they all fall short ...
7
votes
3answers
2k views
2D Spatial partitioning alternatives to spatial hashes and quadtrees
I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and quadtrees aren't what I'm looking for.
My level size is not supposed to have a limit (only Int32 ...
6
votes
5answers
1k views
Why do objects interpenetrate in this simple collision solver?
The code below is from a Microsoft XNA sample here.
This is quite a simple rigid body simulation that ignores many physical effects (such as angular momentum), but it does try to push objects ...
5
votes
3answers
1k views
2D Platformer Collision/Physics Problems
I'm making a 2D platformer similar to Terraria, although I'm having some problems with some collision detection code. I'm using the code from the AppHub Platformer sample, but tweaked so it fits with ...
5
votes
1answer
209 views
Splitting an object into two
I'm using Farseer physics engine.
I have a simple rectangle body and would like it to split into two pieces given a starting coordinate (where the bullet enters the object) and ending coordinate ...
4
votes
2answers
235 views
Ball bouncing infinitely and constantly
Alright, so I've got hold of some simple physics mechanics, and am currently trying to implement bouncing. Based on the first answer of this question, I've developed the following algorithm:
...
4
votes
1answer
338 views
How to balance a ball on a rotating plane?
I'm doing some research and I really don't want a physics engine when a simple mechanism will do. I have a ball that will be balanced on a plane. The ball will always be "stuck" to the plane and ...
4
votes
2answers
507 views
Get collision details from Rectangle.Intersects()
I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this:
// Ball class
rectangle.Intersects(paddle.Rectangle);
Is there any ...