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

learn more… | top users | synonyms (2)

1
vote
1answer
614 views

3D Collision help

I'm having difficulties with my project. I'm quite new in XNA. Anyway, I'm trying to make 3D game and I'm already stuck on one basic thing. I have terrain made from a heightmap, and an avatar model. I ...
1
vote
2answers
1k views

Reflect angle on pong clone [duplicate]

I'm working on collision detection for a pong clone. I've calculated the angle of incidence but I can't find any information on how to specular reflect the angle I found. The code for calculating the ...
0
votes
1answer
2k views

AS3 hittest with a tweening movieclip, what is the best way?

I'm making a simple game. The character is movable with the arrow keys. The enemies are moving around the screen with a (classic) tween. I want to detect collision between the character and the ...
6
votes
3answers
2k views

How can I do fast Triangle/Square vs Triangle collision detection?

I have a game world where the objects are in a grid based environment with the following restrictions. All of the triangles are 45-90-45 triangles that are unit length. They can only rotate 90°. The ...
3
votes
1answer
265 views

Collision Detection Efficiency

I've just written my first successful collision detection code, and it works great for a small scene of actors (player + 4-5 obstacles). However, I realize that since it checks every possible ...
1
vote
2answers
3k views

Sprite collisions in android andengine

I'm developing a simple game by andengine. I have 10 balls which are moving randomly on screen.i'm importing the balls as picture in sprites.if they move at the same coordinate , they pass though ...
0
votes
1answer
251 views

Change of direction after Collision

I am having a pickup image which is moving at random direction and have to change the direction after collision with some tiles, which are a rectangle. I've my own algorithm for detecting the ...
2
votes
2answers
964 views

How to calculate the direction a ball must bounce

I have a tile engine I have made. I can detect collision between the ball(the player) and the tiles. When a collision is detected all the colliding tiles are stored inside a list. My question now is, ...
3
votes
1answer
397 views

SAT and then what?

I am on my way to make another Arkanoid game but this time I decided that I want it a little bit more realistic than just checking intersections between AABB and inverting one vector's component on ...
2
votes
1answer
824 views

Problems with moving 2D circle/box collision detection

This is my first game ever and I'm a newbie in computer physics. I've got this code for the collision detection and it works fine for BOTTOM and TOP collision.It miss the collision detection with the ...
2
votes
0answers
92 views

What is the most effective way to create a set of collision points for an aribitrary mesh?

In my project I am working on automatically deforming an arbitrary mesh with respect to another arbitrary mesh, within the context of user generated content, similar to this deformer being developed ...
0
votes
2answers
1k views

Detecting if line crosses rectangle in python. Need speed boost

I am currently writing a top down man vs robot shooter. The game works now, but if I have a decent sized level it runs slowly when you are being chased by robots. While just roaming around it can go ...
6
votes
3answers
4k views

Implementing Separating Axis Theorem (SAT) and Minimum Translation Vector (MTV)

I was following codezealot's tutorial on SAT and MTV and trying to implement it myself but I've come a cropper when it comes to getting the correct MTV. Here is my example: (Cue pretty pictures...) ...
1
vote
1answer
684 views

C# OpenTK - Getting world coordinates of points that are altered by matrices

I have written a skeletal animation system for a game i am working on. To draw lines that represent a skeleton, i use the GL matrix, and multiply it by each bone a long the body. For example before ...
2
votes
1answer
321 views

What broad-phase collision algorithms are suited to a static tiled world with dynamic objects of different sizes?

Sorry for this routine question, but I can't think of what broad-phase collision algorithms really work in the following, reasonably standard, setup: 2D tile based world, consisting of objects that ...
2
votes
3answers
1k views

How will the velocities of two moving objects change once they collide?

I'm making a small game where things can fly around and collide. Things like boxes and so on. For each object, I have an array of all forces acting upon it, I have it's mass, it's position and it's ...
2
votes
1answer
552 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. ...
3
votes
2answers
919 views

In Box2D, how can I check for bodies within a circle?

I'm trying to sample random positions to find one that is sufficiently far from other bodies. Hence I'd need to test for bodies within a given circle. So far, I've used b2World::QueryAABB around my ...
0
votes
2answers
3k views

Android Java rectangle collision detection not working

I had been hard coding a collision detection system which was buggy. Then I came across using rectangles for collsion detection. So I put it all in and it does not work, I put a log in and it never ...
9
votes
3answers
2k views

Isometric Collision Detection

I am having some issues with trying to detect collision of two isometric tile. I have tried plotting the lines between each point on the tile and then checking for line intercepts however that didn't ...
2
votes
1answer
515 views

Pixel Collision - Detecting corners

How would I go about detecting the corners of a texture when I use pixel collision detection? I read about corner collision with rectangles, but I am unsure how to adapt it to my situation. Right now ...
1
vote
1answer
573 views

2D Tile based Game Collision problem

I've been trying to program a tile based game, and I'm stuck at the collision detection. Here is my code (not the best ^^): void checkTile(Character *c, int **map) { int x1,x2,y1,y2; /* ...
0
votes
1answer
292 views

Incorrect results for frustum cull

Previously, I had a problem with my frustum culling producing too optimistic results- that is, including many objects that were not in the view volume. Now I have refactored that code and produced a ...
4
votes
4answers
949 views

More efficient in range checking

I am going to use a specific example in my question, but overall it is pretty general. I use java and libgdx. I have a ship that moves through space. In space there is debris that the ship can ...
3
votes
2answers
286 views

Unsure how to decide ray intersection interval

I'm coding an intersection algorithm with AABB, as found here. However, I'm absolutely unsure what to pass in as t0 and t1. The paper states that it's a ray intersection interval, but the only ...
1
vote
1answer
498 views

How to handle circle penetration

I've been working on cirlce to circle collision and have gotten the intersection method working correctly, but I'm having problems using the returned values to actually seperate the circles from one ...
8
votes
3answers
3k views

Finding the contact point with SAT

The Separating Axis Theorem (SAT) makes it simple to determine the Minimum Translation Vector, i.e., the shortest vector that can separate two colliding objects. However, what I need is the vector ...
50
votes
6answers
11k views

How does a collision engine work?

How exactly does a collision engine work? This is an extremely broad question. What code keeps things bouncing against each other, what code makes the player walk into a wall instead of walk through ...
1
vote
1answer
1k views

Circle to Circle collision, checking each circle against all others

I'm currently coding a little circle to circle collision demo but I've got a little stuck. I think I currently have the code to detect collision but I'm not sure how to loop through my list of circles ...
1
vote
0answers
241 views

Debugging Minimum Translation Vector [closed]

I implemented the minimum translation vector from codezealot's tutorial on SAT (Separating Axis Theorem) but I'm having an issue I can't quite figure out. Here's the example I have: As you can see ...
2
votes
2answers
205 views

How to do reflective collisions with particles hitting background tiles?

In my 2d pixel old-school platformer, I'm looking for methods for bouncing particles off of background tiles. Particles aren't affected by gravity and collisions are "reflective". By that I mean a ...
-1
votes
1answer
143 views

Modifying SAT Code To Obtain Penertration Vector [duplicate]

Possible Duplicate: SAT, How Do I Find The Penetration Vector? Hi how could I modify my SAT code and visual debug it to find the penetration vector of the two Entities so I can separate ...
10
votes
4answers
2k views

Collision rectangle response

I'm having difficulties getting a moveable rectangle to collide with more than one rectangle. I'm using SFML and it has a handy function called intersects which takes 2 rectangles and returns the ...
3
votes
2answers
2k views

2D Collision masks for handling slopes

I've been looking at the example at: http://create.msdn.com/en-US/education/catalog/tutorial/collision_2d_perpixel and am trying to figure out how to adjust the sprite once a collision has been ...
3
votes
1answer
1k views

Resultant Vector Algorithm for 2D Collisions

I am making a Pong based game where a puck hits a paddle and bounces off. Both the puck and the paddles are Circles. I came up with an algorithm to calculate the resultant vector of the puck once it ...
5
votes
1answer
917 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 ...
3
votes
3answers
418 views

How do I approach this collision model?

This is the game level prototype I have already implemented. It has few objects per room to allow me to finally add some collision detection/response code into it. VIDEO As you can probably see, ...
7
votes
1answer
1k views

AABB - AABB Collision, which face do I hit?

To allow my objects to slide when they collide, I need to : Know which face of the AABB they collide with. Calculate the normal to that face. Return the normal and calculate the impulse that to ...
7
votes
1answer
3k views

Sidescroller variable terrain heightmap for walking/collision

I've been fooling around with moving on sloped tiles in XNA and it is semi-working but not completely satisfactory. I also have been thinking that having sets of predetermined slopes might not give me ...
1
vote
2answers
376 views

improve Collision detection memory usage (blocks with bullets)

i am making a action platform 2D game, something like Megaman. I am using XNA to make it. already made player phisics,collisions, bullets, enemies and AIs, map editor, scorolling X Y camera (about 75% ...
6
votes
1answer
769 views

When to detect collisions in game loop

My game loop uses a fixed time step to do "physics" updates, say every 20 ms. In here I move objects. I draw frames as frequently as possible. I work out a value between 0 and 1 to represent the ...
-5
votes
4answers
3k views

How to implement a 2d collision detection for Android

I am making a 2d space shooter using opengl ES. Can someone please show me how to implement a collision detection between the enemy ship and player ship. The code for the two classes are below: ...
1
vote
1answer
380 views

Collision within a poly

For an html5 engine I'm making, for speed I'm using a path poly. I'm having trouble trying to find ways to get collision with the walls of the poly. To make it simple I just have a vector for the ...
2
votes
1answer
665 views

Where should I place my reaction code in Per-Pixel Collision Detection?

I have this collision detection code: public bool PerPixelCollision(Player player, Game1 dog) { Matrix atob = player.Transform * Matrix.Invert(dog.Transform); Vector2 stepX = ...
1
vote
2answers
3k views

Breakout collision using 2D Rectangles?

Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; namespace BreakOut { class Field { public static ...
6
votes
2answers
3k views

Bounding boxes in octrees

I've seen that octrees are often used for things like frustum culling and collision detection in 3D. But I'm just not sure how the algorithm works at all. Surely the whole principle of the octree ...
6
votes
5answers
900 views

Need some advice regarding collision detection with the sprite changing its width and height

So I'm messing around with collision detection in my tile-based game and everything works fine and dandy using this method. However, now I am trying to implement sprite sheets so my character can have ...
2
votes
4answers
668 views

How to detect what portion of a rectangle a point is in?

Say I have a rectangle and a point inside the rectangle. If the rectangle was split up diagonally, how could I tell which portion the point is in? Here is a cute little mspaint diagram, where the ...
2
votes
2answers
769 views

SAT, How Do I Find The Penetration Vector?

I've just successfully implemented Separating Axis Theorem (SAT) in my game but I was wondering how do I find the penetration vector? I heard it can be useful for collision response. e.g. The harder ...
2
votes
3answers
2k views

Line segment and Sphere intersect

How can I check it if a line3D/ or ray is intersecting a sphere?