Tagged Questions
5
votes
6answers
219 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
91 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
235 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
88 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
201 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
821 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
611 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
299 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
476 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
501 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 ...
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 ...
8
votes
1answer
1k 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
753 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
222 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 ...