jonasnoki / ca_homework

Homework for Computer Animation Course
2 stars 0 forks source link

Create Circle and Do Collision Detection With it #4

Open jonasnoki opened 3 years ago

jonasnoki commented 3 years ago

The Visualization can be just like the one of the particles (except maybe larger). The Collision Detection could be done at the same time like the Plane but use the formula from the slides and implement it on the Particle.

Something like:

if (p.collisionParticleSphere(this.sphere)){
    p.correctCollisionParticlePlain(this.sphere);
    console.log("rebound = " + this.collisionCount++);
}

https://github.com/jonasnoki/ca_homework/blob/5b3c30e19848de2191ab08e49d9ce02d2f861dc3/src/Simulation.ts#L22