8
votes
1answer
450 views

How do I make a curved surface out of rectangular blocks?

For a Peggle-like game, I want to make blocks that follow a curve, like this: The blocks would then disappear as the ball hits them. I managed to draw some horizontally, but I'm having trouble ...
2
votes
1answer
91 views

How do I compute the point of a triangle-ray intersection?

I have a line (the direction vector of the player) and a triangle representing the face of a model (so composed of 3 points). I can't find the mathematical operation to check if that vector is ...
4
votes
2answers
283 views

Allowing a player to walk up and down slopes without resistance

I am trying to implement a platformer where both the player and the level are made up of arbitary polygons. One requirement is that the player can stand still on slopes, and walk up and down them ...
27
votes
6answers
2k 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 ...
7
votes
5answers
757 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 ...
2
votes
1answer
141 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 ...
4
votes
3answers
297 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 ...
1
vote
1answer
104 views

Intersection of player and mesh

I have a 3D scene, and a player that can move about in it. In a time-step the player can move from point A to point B. The player should follow the terrain height but slow going up cliffs and then ...
1
vote
2answers
311 views

Separation of axis theorem implementation

I have been following the this guide to implement this. My current implementation is the following: class SAT { SAT(); bool collides(Rectangle rect1, Rectangle rect2){ var axises = [ ...
8
votes
2answers
2k 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 ...
5
votes
1answer
776 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 ...
1
vote
6answers
363 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 ...
0
votes
2answers
523 views

Ways to define a curve

I'm trying to give shapes in my physics engine roundness/ curvature. I am aware of various methods for mathematically defining curves; such as bezier-cruves, ellipses, etc. However I am not sure ...
2
votes
1answer
601 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 ...
9
votes
1answer
3k 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 ...
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 ...
2
votes
1answer
884 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 ...
3
votes
2answers
239 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 ...
1
vote
2answers
2k views

Voronoi regions of a (convex) polygon

I'm looking to add circle-polygon collisions to my Separating Axis Theorem collision detection. The metanet software tutorial (http://www.metanetsoftware.com/technique/tutorialA.html#section3) on ...
14
votes
2answers
3k 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 ...
4
votes
3answers
1k 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 ...
7
votes
4answers
1k 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 ...