particle.cpp 382 B

1234567891011121314151617
  1. /*
  2. * 2D Physic Engine
  3. * particules.cpp:
  4. * Based on pikuma.com Learn Game Physics Engine Programming course.
  5. * Copyright (c) 2022 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 07/06/2022.
  8. */
  9. #include <physics/particle.h>
  10. void particle::integrate(double dt)
  11. {
  12. this->velocity += this->acceleration * dt;
  13. this->position += this->velocity * dt;
  14. }