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
2k views

How can I cancel a contact in a b2ContactListener?

To know when contacts happen we can derive from b2ContactListener and implement our own solution which is great. I'm wondering is there anyway we can cancel a contact, that is to say when we hit begin ...
1
vote
1answer
234 views

How can I know in which direction 2 balls will go in billiard game?

When a ball is struck, how can we know in which direction both balls will go when ball is struck? I know the angle at which the ball strikes the other ball matters, but how can we calculate that ...
0
votes
2answers
79 views

Floating point precision issue with Box2D

I'm using Box2D and I am putting edge tiles as b2Bodies so that the tile world can have physics: The problem is that there are 3 b2_kinematic bodies under the player right beside each other. Every ...
0
votes
1answer
142 views

Collision Detection Code Structure with Sloped Tiles

Im making a 2D tile based game with slopes, and I need help on the collision detection. This question is not about determining the vertical position of the player given the horizontal position when on ...
0
votes
2answers
651 views

Java collision detection with rectangles

I'm trying to get the collision between two squares. I've made a Rectangle object that overlays each one and updates the position every tick. Then I made a collision method that checks whether they ...
0
votes
1answer
175 views

Bounding Boxes and XNA

So heres some straight up code for you: BoundingBox b = new BoundingBox( Vector3.Up + Vector3.Right + Vector3.Forward, Vector3.Down + Vector3.Backward + Vector3.Left); BoundingBox bb = new ...
0
votes
2answers
168 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 ...
0
votes
1answer
151 views

Gravity stops when side-collision detected [closed]

Please, look at this GIF: The label on the animation says "Move button is pressed, then released". And you can see when it's pressed (and player's getCenterY() is above wall getCenterY()), gravity ...
0
votes
1answer
152 views

Binding BoundingSpheres to a world matrix in XNA

I made a program that loads the locations of items on the scene from a file like this: using (StreamReader sr = new StreamReader(OpenFileDialog1.FileName)) { ...
0
votes
2answers
3k views

Basic 3D Collision detection in XNA 4.0

I have a problem with detecting collision between 2 models using BoundingSpheres in XNA 4.0. The code I'm using i very simple: private bool IsCollision(Model model1, Matrix world1, Model model2, ...
0
votes
3answers
827 views

Checking for collisions on a 3D heightmap

I have a 3D heightmap drawn using OpenGL (which isn't important). It's represented by a 2D array of height data. To draw this I go through the array using each point as a vertex. Three vertices are ...
0
votes
2answers
449 views

Collisions not working as intended

I'm making a game, it's a terraria-like game, with 20x20 blocks, and you can place and remove those blocks. Now, I am trying to write collisions, but it isn't working as I want, the collision ...
-1
votes
1answer
71 views

Grid based Collision Detection between circles [duplicate]

I am working on a 2d arcade game where I have 5 types of circles with different sizes: The ship, the missiles, and 3 types of monsters. This is what it looks like: Currently I'm using brute force ...
-3
votes
1answer
110 views

Simple collision detection implementation [closed]

I'm making a game with C++ where the program extracts the lines out of an image (via openCV), stores them in an std::vector< std::vector< int > > and the builds a tile map out of it which is ...