Skip to main content

All Questions

Tagged with
6 votes
3 answers
248 views

Calculate next position and velocity after "bounce"

Intro and code I have the following function that calculates an object's "next" position and velocity (in 1 dimension) given a boundary [0, max]. ...
geofflittle's user avatar
7 votes
1 answer
2k views

2D colliding disks in JavaScript (ideal billiard balls)

I am implementing a simulation of colliding disks (ideal 2D billiard balls) in JavaScript. I follow an event-driven algorithm that avoids discretizing time; the algorithm goes as follows at each step:...
Maxim's user avatar
  • 173
11 votes
1 answer
359 views

Basketball Collisions with Box2d

I'm working on a new prototype that is a simple drag and shoot arcade basketball game. For this project I am working with LibGDX and the Box2d physics library. You can play the game here: Play ...
bazola's user avatar
  • 8,569
7 votes
1 answer
944 views

Quad Tree and Collision Detection Implementation

I have an implementation of a quad tree and abstract collision detection classes. The code works but looks very ugly, but I don't know what I could change to make it better. The reason I used two ...
T_01's user avatar
  • 173
17 votes
1 answer
4k views

Bouncing stacking boxes

I'm not sure if it would be better to make the envelope into an extension of the Rectangle constructor. The physics seem a bit dodgy, it works well most of the time, but sometimes the boxes overlap ...
Tom's user avatar
  • 431