All Questions
7
questions
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?...
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 ...
5
votes
0
answers
238
views
Spacial hashing Library
Old code
...
2
votes
2
answers
2k
views
High performance, branchless Intersection testing: sphere-aabb & aabb-aabb
From my tests:
AABB-Sphere: 2954.8 tests per ms.
AABB-AABB: 1087.0 tests per ms.
The sphere test is almost 3 times faster, but the two intersection tests seem to perform about the same number ...
11
votes
1
answer
586
views
Bounding volume hierarchy
I'm building a bounding volume hierarchy in Golang. I can tell my code works because I did some test on it and it gives the same results as the brute force implementation (brute force is to test all ...
9
votes
1
answer
13k
views
Line segment to circle collision algorithm
I've written a function (in Python 3) which computes if a line segment (constraint) and a circle (body) collide, and returns the point of intersection (closest point to the centre of the circle):
<...
3
votes
1
answer
675
views
Intersection-detection algorithm
This is an intersection-detection algorithm I developed as an alternative method to the one developed for my coursework. I won't post some of the other functions as they are used in the coursework too,...