# Tagged Questions

Collision detection is the determination of whether or not two or more entities make contact with each other during gameplay.

548 views

### How to detect if a ball will collide with another, and the normal vector of the collision?

So I have a 2D game involving balls (circles) colliding. I want to be able to detect if two balls will collide before it happens, and the normal vector of the collision if a collision is going to ...
1k views

### Trouble with AABB collision response and physics

I have been racking my brain trying to figure out a problem I am having with physics and basic AABB collision response. I am fairly close as the physics are mostly right. Gravity feels good and ...
2k views

### How do I detect multiple sprite collisions when there are >10 sprites?

I making a small program to animate the astar algorithm. If you look at the image, there are lots of yellow cars moving around. Those can collide at any moment, could be just one or all of them could ...
1k views

### Using uniform grids for collision detection - Efficient way to keep track of what a cell contains

I was looking for an efficient way to implement collision detection in a 2D game. A way that won't result in an O(n^2) level of complexity. A lot of people recommend to use Uniform Grids for this ...
808 views

### Collision detection in libgdx

I am currently writing a little zelda like game and have a little bit of a problem with collision detection. It works but the the character stands to far away from the object. Here is my player ...
653 views

### 3D RTS pathfinding

I understand the A* algorithm, but I have some trouble doing it in 3D to suit the needs of my RTS Basically, in the game I'm making, there will be agents with different sizes of OBB collision boxes. ...
370 views

### Tools to generate convex collision geometry

Does anyone know tools to generate convex collision geometry from given 3D model? For example, UDK's Static Mesh Editor can do this; Valve instead recommends to use smoothing in 3D editor. Desired ...
771 views

### Collision Detection Problems

So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below. One problem I'm ...
814 views

### How does the SAT collision detection algorithm work

There are a lot of tutorials and sample code available showing how to implement the SAT collision detection algorithm. But can someone explain, without math or code, what are the general principls ...
163 views

### Storing rigid body collision shapes in local or world coordinates

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
456 views

### How can we match polygon data structure with a background image

I am referring to this fireball game. The ball will collide with background, which is in polygon form. I was wondering, how I can match my polygon data structure with the background image. Say, I ...
192 views

### Voxel terrain collision detection with AABBs

I'm working on implementing collision detection on voxel terrain (Like Minecraft) with AABBS. Right now, I have it so I can tell if a point is within a voxel or not, I do this by having a 2D byte ...
166 views

### AABB collision resolution issues

I'm trying to make a character collide with some tiled terrain. I have an issue with the collision resolution, and after days of shooting in the dark ant not finding any relevant help online, I'm no ...
3k views

### How to detect which edges of a rectange touch when they collide in iOS

I'm creating a basic "game" in iOS 4.1. The premise is simple, there is a green rectangle ("disk") that moves/bounces around the screen, and red rectangle ("bump") that is stationary. The user can ...
991 views

### How to detect screen boundary using AndEngine GLES1?

I am using the AnalogOnScreenControl to move my sprite around the screen. I would like to restrict the sprite so it can not move outside the screen boundaries. I have tried putting a line at the ...
2k views

### implementing collision detection and handling for tiled 2D world with smooth wall sliding

Im using SFML 2.1 for graphics and my game structure follows SFML book quite closely (SceneGraph implementation etc) My world consists mostly of characters (around 1-400, moving around) and tiles (...
3k views

### Platformer raycast collision detection

I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
493 views

### JBullet - Detecting when 2 objects collide?

How can I detect when 2 collision objects collide with JBullet? Currently, all body types are going to be of type RigidBody. I have quite literally been trying to find the answer of this for over 2 ...
455 views

### How can I determine which direction a 2D collision is occurring from?

The problem is as follows: Think 2D Zelda (Links Awakening, A Link to the Past) style movement where you can run into walls from any of the four cardinal directions, or basically up, down, left, and ...
1k views

### Collision detection optimization for a top down shooter

I'm relatively new to game development and have been trying to learn how collision detection is coded. I mostly work with Actionscript 3, but I'm learning C++ on the side. I've been wondering how "...
300 views

### Roguelike 2D Collision Detection

I'm just a normal guy trying to do some basic collision detection but I suck at it. I either get stuck in a wall or I go in reverse in the wrong direction trying to update the player position to a non ...
3k views

### Why do we use physics engines for collision testing or raycasting?

There is a thing I don't understand about game engines: why it is so common to use physics engines to do raycasting or collision testing? Say that you have a 3D scene loaded in your scene manager (...
2k views

### Effects of collisons: broken glass, damaged cars, how are they created?

My question is related in particular to achieving the effects of collision in game engine, how is this done? I have searched a bit, read from the internet and went through a few tutorials, and saw ...
1k views

### Closest point on an ellipsoid

I need to know how to get the closest point on the surface of an ellipsoid to another point. I had an idea, but apparently i was wrong, and oversimplfying. What i did was squash the ellipsoid and ...
1k views

### Collision Filtering in Box2D

I have four bodies in my Box2D World. Each are polygon shape, with some physics parameters. Now when the game start, I need one of the bodies from the World (BodyA) to not be allowed to collide with ...
1k views

### I need help with 2D collision response (of stacking rotating polygons, with friction and gravity, for a game)

Hi I am looking for suggestions on how to write a collision response for game programming purpose (so not a scientific simulation). I am dealing with 2D polygons that are rotating, and I want them to ...
2k views

### Collision Detection problems in Voxel Engine (XNA)

I am creating a minecraft like terrain engine in XNA and have had some collision problems for quite some time. I have checked and changed my code based on other peoples collision code and I still have ...
4k views

### Circle-Rectangle collision resolution

I have a non axis aligned rectangle, like a car, in my game. I have to check and resolve the collision between the rectangle and circle, which is stationary. I have found lots of ways to determine ...
2k views

### Create bullet physics rigid body along the vertices of a blender model

I am working on my first 3D game, for iphone, and I am using Blender to create models, Cocos3D game engine and Bullet for physics simulation. I am trying to learn the use of physics engine. What I ...
3k views

### 2d Collision detecton axis aligned boxes

I have recently run into some trouble with my collision detection. My game is composed of a map made out of axis aligned squares. The player has an x and y velocity, and I want to know how I can find ...
642 views

### Collision detection - make sure the player touches the object exactly

I know this is really something I should be able to figure out on my own, but a solution is evading me. Okay, here are a few relevant parts of my code. bool Game::Col(int x1,int y1,int w1,int h1, ...
4k views

### Unity, changing gravity game & stopping character when he hit a wall

i am currently working on a 2d puzzle game in the unity engine. One of the aspect of this game is the possibility to rotate the level of 90°. It also rotate the gravity. The main character is not ...
307 views

### How do I detect a line collison in LIBGDX?

I am drawing a continuous line using Pixmap. I want to check for a collision / intersection of my line with the already drawn line.
684 views

### Fast 2D collision detection in an unbounded space

I'm trying to do collision detection on a large number of entities of greatly varying size in an unbounded space. The entities are circles, so it's relatively easy to check if two are colliding. ...
1k views

### 2D platformer multiple rectangle collision cause jitter

I posted this question two weeks ago: 2D platformer corner collision and I implemented NoobsArePeople2's solution. Problem is, when player intersects two rectangles that are inside each other, he ...
397 views

### Tile map collision is not working properly

I am having problems setting collision between my sprite and the tiles. I have only done the code for colision for moving upwards but some places on the map it moves up and some places it doesn't. ...
144 views

### Rendering after interpolating, renders inside/outside other objects

So, we're working out our interpolated render-coordinates during our render call and it's doing a fantastic job of smoothing everything out. All is great and collision detection is working to a ...
996 views

### Tile based map and collision; getting stuck

I'm trying to make my character move around a tile map with collisions. Everything works fine except for one thing. I show you a picture with the problem: http://i.stack.imgur.com/ZWI7x.jpg That is, ...
1k views

### Collision Detection for a 2D RPG

First of all, I have done some research on this topic before asking, and I'm asking this question as a mean to get some opinions on this topic, so I don't make a decision only on my own, but taking ...
6k views

### When would a mesh collider be better than primitive colliders

I have been reading through the Unity Manual and have come across some interesting information about mesh colliders and primitive colliders. It got me wondering if using many primitive colliders would ...
811 views

### Checking Collisions In 2D Platformer With Tiles

My team and I are developing a 2D platformer with C++/SDL/OpenGL, and we already defined a collision system, but we have a problem checking collisions with the tilemap. The tiles of the tilemap are ...
161 views

### Collision detection between axis-aligned bounding box and bitmap (pixel perfect) terrain

Working on a Worms-type game, I have my objects in bounding boxes and they sit on the pixel terrain. Currently I am able to successfully do the collision detection for objects when they enter the ...
5k views

### How do I detect pixel-level collision using andEngine?

I'm developing a game for Android using andEngine, and I need to detect collisions only when two objects visually collide (not in blank space of the image). In J2ME, I'm able to do that using ...
762 views

### Color based collision detection

I am making a game where you fly a ship around some randomly generated planets. Since I am using a for loop to draw over 5000 planets, using the rectangle class or an oval-type class for this is not ...
186 views

### Farseer Physics EndContact events don't fire for all registered delegates

Here's my situation: I have several objects that contain a body and a fixture. They are set to sensor = true; atmosphere = BodyFactory.CreateCircle(world, atmosphereRadius / Level.METER_IN_PIXELS, ...
616 views

### How to identify whether the boundingvolume intersects with walls or floor when it doesnt return normals?

My game in jMonkey is the kind that use will have to place objects in a scene (which consist of walls and slabs and floor). All my models are centered at origin. When the user click a point I use ray ...
41 views

### Cell height with heightmap for collision detection

Hello everyone I'm programming a game with c++ and openGL. My world is generated from a heightmap (100x100 matrix with values 0-255) and now I need a function that returns the actual height based on ...
241 views

### Draw Rectangle To All Dimensions of Image

I have some rudimentary collision code: public class Collision { static boolean isColliding = false; static Rectangle player; static Rectangle female; public static void collision(){ Rectangle ...