Tagged Questions
13
votes
2answers
2k views
How to find if circle and concave polygon intersect?
I have a polygon (sometimes convex, but often concave), and a bunch of circles with different radius. How can I find out if a circle is intersecting/overlapping with the polygon?
If it makes it ...
8
votes
2answers
875 views
How do I determine if one polygon completely contains another?
I have 2 polygons. I know the vertex coordinates of both polygons. What's the best way to check if one is completely inside the other? For example, the algorithm should only recognize the black ...
8
votes
1answer
2k views
Am I going to regret using a color based collision detection system?
I'm just getting started build my first game with XNA (I'm experienced with C# but not games).
I'm building a pretty simple top down 2d shooter. I read this tutorial on using a color based collision ...
7
votes
1answer
2k views
Circle-Line Collision Detection Problem
I am currently developing a breakout clone and I have hit a roadblock in getting collision detection between a ball (circle) and a brick (convex polygon) working correctly. I am using a Circle-Line ...
6
votes
4answers
982 views
Implementing 2D CSG (for collision shapes)?
Are there any simple (or well documented) algorithms for basic CSG operations on 2D polygons?
I'm looking for a way to 'add' a number of overlapping 2D collision shapes. These may be convex or ...
5
votes
1answer
633 views
How to perform simple collision detection?
Imagine two squares sitting side by side, both level with the ground like so:
A simple way to detect if one is hitting the other is to compare the location of each side. They are touching if all of ...
5
votes
6answers
243 views
How do I calculate distance from a point to a rectangle?
I have a 2D rectangle with x, y position, height and width, and a randomly positioned point nearby.
Is there a way to check if this point might collide with the rectangle if it is closer than a ...
4
votes
3answers
242 views
How to get distance from point to line with distinction between side of line?
I'm making a 2d racing game. I'm taking the nice standard approach of having a set of points defining the center of the track and detecting whether the car is off the track by detecting its distance ...
4
votes
3answers
902 views
Point line collision reaction
I am trying to program point line segment collision detection and reaction. I am doing this for fun and to learn.
The point moves (it has a velocity, and can be controlled by the user), whilst the ...
3
votes
2answers
223 views
How to generate slopes that meet the plane, is using collision detection a good idea?
I have a terrain, which is defined by mesh. And there are a lot of other polygonal faces scattered throughout the terrain, they can be located above, or below or cutting through the terrain. You can ...
2
votes
1answer
513 views
Can Bullet Physics (or another 3d physics engine) use callbacks in my engine to check static geometry?
I'm wondering if it's possible to use or hack Bullet 3d Physics (or another free 3D physics engine) so that I don't need to "import" my static geometry into Bullet - instead I want to do it the other ...
2
votes
1answer
93 views
Finding the normals of an oriented bounding box?
Here is my problem.
I'm working on the physics for my 2D game.
All objects are oriented bounding boxes (OBB) based on the separate axis theorem.
In order to do collision resolution, I need to be ...
2
votes
2answers
73 views
Hexagon collision detection for fast moving objects?
A object has a position and a speed vector. Usually only the position is used to check if two objects collide, this is problematic for very fast moving objects as it can happen that the object moves ...
2
votes
1answer
763 views
How do I determine the collision normal in an axis aligned bounding box collision?
I have a 3d moving box and a stationary box. I can detect collisions ok but now I would like to slide the moving box against the stationary box as a collision response. For this I need the normal of ...
1
vote
6answers
303 views
Testing whether two cubes are touching in space
Does anyone have any clean ideas on testing whether two cubes in 3D space touch? By touch I mean, touch at corners or on a face or on an edge. Say that the cubes are axis aligned and there is no ...