Questions tagged [collision]
In collision detection problems, the challenge is to determine when shapes intersect each other.
106
questions
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 ...
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
...
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,...
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?...
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 ...
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 ...
4
votes
1
answer
378
views
Spatial Hash for optimizing AABB collisions
grid.h
...
5
votes
0
answers
238
views
Spacial hashing Library
Old code
...
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:
...
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 ...
-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 ...
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 ...
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' ...
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?
...
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, ...