Skip to main content

Questions tagged [collision]

In collision detection problems, the challenge is to determine when shapes intersect each other.

5 votes
2 answers
499 views

OBBs intersection improvement for AABBs-OBBs

I'm trying to code some intersection codes for Oriented Bounding Boxes (OBBs) and axis-aligned bounding boxes (AABBs). I have the OBB-OBB intersection using the Separating Axis Theorem (SAT) and I'm ...
Carlos Hdez Barbera's user avatar
4 votes
1 answer
3k views

Circle - Line segment collision

I wrote an implementation of circle - line segment collision detection algorithm. Here is quick demonstration how it works: And here is my implementation in Javascript using HTML canvas: index.html ...
Tomek's user avatar
  • 315
4 votes
1 answer
901 views

Simple class game hierarchy with collision detection

I'm trying to make the transition from the 'understand how standalone features work' phase to writing.. more 'complex' code that could actually see use in real life, so I've been trying find some neat,...
string_loginUsername's user avatar
7 votes
2 answers
8k views

Find the intersect area of two overlapping rectangles

This is my solution to find the coordinates of 2 overlapped rectangles implemented in JavaScript. Each rectangle is represented by 2 points, each with 2 (x,y) coordinates. Can this code be improved?...
Achref Boukhili's user avatar
4 votes
1 answer
598 views

Octree Implementation

The fn_AABB struct represents an axis aligned bounding box, by a center(position) and half lengths(hwidth). They also contain a set of planes for use in collision but that is not important to the ...
J. H's user avatar
  • 199
6 votes
1 answer
404 views

Handling collision on a turn-based 2D game

I have implemented a collision check algorithm that I have created for my game, and the algorithm uses recursion. Now it all works fine, and I thought to myself, what if there was a way to solve this ...
Ben Beri's user avatar
4 votes
1 answer
378 views

Spatial Hash for optimizing AABB collisions

grid.h ...
J. H's user avatar
  • 199
5 votes
0 answers
238 views

Spacial hashing Library

Old code ...
Tobi's user avatar
  • 241
1 vote
1 answer
86 views

Collision manager

I have a chunk of code that's working properly but it's way too complicated to read: ...
Tiago Marinho's user avatar
5 votes
1 answer
347 views

Collision detection method

I think everyone has some code they are embarrassed and not proud of and today I have decided to show mine. I'm not sure how to go about making this more efficient. At the time I was just happy it did ...
SJJ's user avatar
  • 51
-2 votes
1 answer
6k views

C++ Erasing an object from vector of pointers

I am making this simple game in SFML and I have this vector of pointers std::vector<Brick*> bricks; which stores objects of class ...
user avatar
3 votes
2 answers
737 views

Maximize the number of PyGame sprites, with collision detection

I was trying to see what is the highest number of moving and colliding boxes (sprites) I could get in pygame? So that I could start working on game I want, I searched google and I found different ...
مهند عبد الجليل's user avatar
2 votes
2 answers
669 views

Checking whether a bullet has hit a Space Invader

I just (almost) finished a Space-Invaders game in Javascript. I have a few bugs to clear out of the way but meanwhile I wanted to ask how I can improve the method I use to test if one of my 'Bullets' ...
Guy W's user avatar
  • 21
1 vote
2 answers
395 views

Javascript collision check

I have code to find images in my selections. But when nothing in selection (loop FOR) and selection is kinda big, it's kinda laggy. How can I improve my code? ...
Vito24's user avatar
  • 11
5 votes
0 answers
275 views

2D Game - Ray-cast collision handling

This code is an excerpt from an infinite platformer I'm working on for fun. It belongs to the class GameObject from which every object i.e platforms, player, ...
kainev's user avatar
  • 301

15 30 50 per page
1 2
3
4 5
8