Skip to main content

All Questions

5 votes
1 answer
197 views

Convex polygon-polygon swept collision test

Currently working on a pre-solve collision library. My goal is to have it be potentially usable in potential video game projects of mine, so time constraint is small as this should be used in a game ...
sfbea's user avatar
  • 61
3 votes
1 answer
1k views

Simple geometry problems involving rectangles and circles in Python 3

I'm working with some simple geometry problems featuring rectangles and circles. My code is as follows: ...
SassySamurai's user avatar
7 votes
1 answer
186 views

Kattis "Hitting the Targets" utilizing a polymorphic relashionship

In order to learn C++ I have written a solution to this Kattis "Hitting the Targets" problem Basically the program is to accept some shapes (circles and rectangles) on std in and a set of points and ...
Bomaz's user avatar
  • 297
6 votes
2 answers
1k views

Rectangle-segment collision detection

I am working with C++ and SDL, hoping to create a game later. I am implementing the collision detection between rectangles and segments. I found this (NateS user's solution) about line-rectangle ...
Lasoloz's user avatar
  • 257
2 votes
1 answer
83 views

Find cells crossed by a line

This method find cells that are crossed by line A-B and adds them to one vector. I have got some duplicates here and some lines of code are very similiar but they differ in one variable. Should this ...
Mateusz's user avatar
  • 259
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): <...
Tochi Obudulu's user avatar
4 votes
1 answer
385 views

Ray→plane and ray→quad intersection

This checks the intersection between a Ray and a Plane and between a Ray and a ...
MaiaVictor's user avatar
  • 1,101
10 votes
2 answers
584 views

Finding the nearest polygon

Finding the nearest polygon out of a list of polygons seems to be quite a challenge on performance, due to lack of optimization. Consider the following image: I'll give the concept behind this. The "...
FatalSleep's user avatar
7 votes
1 answer
3k views

Implementation of SAT (Separating axis theorem)

A project I was working on required the usage of the Separating Axis Theorem to detect collisions between two convex polygons in real time. So I implemented a basic class (...
Alfonzo LeFred's user avatar
32 votes
3 answers
44k views

Overlapping rectangles

I received the following question in a technical interview today (for a devops/SRE position): Write a function which returns true if the two rectangles passed to it as arguments would overlap if ...
Jim Dennis's user avatar
10 votes
2 answers
365 views

Artifact collision in plane module

Here's something I tried putting together as I'm learning. Critiques on anything are welcome. There's also a logic bug in the Plane module I can't identify. The long and the short are that it takes ...
Jimmy Hoffa's user avatar
  • 1,545