Commit Graph

105 Commits

Author SHA1 Message Date
Karma Riuk
deeb237f45 Added a more complex starting setting 2023-05-17 15:38:05 +02:00
Karma Riuk
40dde35f19 Added restitution coefficient control (introduced a lot of unwanted
behaviour, but fixable)
2023-05-17 13:38:46 +02:00
Karma Riuk
a6c4771d1a Added gravity to polygons 2023-05-17 13:33:07 +02:00
Karma Riuk
7b5273b9bf Added gravity vector for polygons in gravity.h 2023-05-17 13:30:05 +02:00
Karma Riuk
958a784371 Reformated gravity.h 2023-05-17 13:29:38 +02:00
Karma Riuk
2bba3155da Added the gravity vector method for polygons (kinda blindly copied and
pasted it from the ball version, hope it works)
2023-05-17 13:27:11 +02:00
Karma Riuk
7df64d460c Reformated gravity.cc 2023-05-17 13:25:36 +02:00
Karma Riuk
487b5fe00b Fixed most of the bugs of the collision detection (still some cases
there)
2023-05-17 13:22:34 +02:00
Karma Riuk
b4203884ef Changed to delta so that the edge cases happen less (since the 'move
less' each frame)
2023-05-17 13:21:43 +02:00
Karma Riuk
398cae3b24 Added toString method to polygons, together with fields "label" and
"collided_with"
2023-05-17 13:21:06 +02:00
Karma Riuk
399949876f Made the draw method of vec2d const so that compiler stops complaining 2023-05-17 13:20:40 +02:00
Karma Riuk
3c2335235e Added labels to polygons to make it clear what is getting printed 2023-05-17 13:19:57 +02:00
Karma Riuk
33cbe4a683 Added the possibility to go frame by frame pressing '.' 2023-05-17 13:18:51 +02:00
Karma Riuk
37a76e3e8d Revamped collision detection, missing the vertex inside vertex case
(which is happening a bit too often imho)
2023-05-06 14:07:47 +02:00
Karma Riuk
2cfa921547 Added a general polygon to the initial state 2023-05-06 14:06:45 +02:00
Karma Riuk
c0d4343b77 Added general polygon generation WITH CORRECT INERTIA YUHUU 2023-05-06 14:05:45 +02:00
Karma Riuk
ad841588ad Refactored collision detection (last version before changing the algo) 2023-04-25 12:09:07 +02:00
Karma Riuk
6b049eb831 Added new polygons in polygons_init_state() and now drawing the point of
impact and the normal vector in that point
2023-04-25 12:05:39 +02:00
Karma Riuk
02f60aaa8a Added == operator to vec2d 2023-04-25 12:04:52 +02:00
Karma Riuk
699490fefc Added the possibility of drawing a vector 2023-04-25 12:02:56 +02:00
Karma Riuk
bf9545a7a0 Added regular polygons and started implementation of arbitrary (general)
polygons
2023-04-25 12:01:51 +02:00
Karma Riuk
4a7e5834d3 Quick refactoring and reformating 2023-04-21 09:01:35 +02:00
Karma Riuk
1c58530e98 Now the borders of the windows are walls of infinite mass 2023-04-10 14:40:16 +02:00
Karma Riuk
c7b9500bc4 Fixed inertia for rectangles 2023-04-10 14:39:36 +02:00
Karma Riuk
d0de911344 got the speed working (yay) but the angular velocity that results is superrrr low, thus not creating any rotation after impact, wierd... 2023-04-02 21:53:21 +02:00
Karma Riuk
7dc54ddfe5 Made the angular speed a double 2023-03-25 14:03:07 +01:00
Karma Riuk
4d14f2a30b Added wall bouncing logic (flawed); added bounding box computation and display 2023-03-25 10:57:32 +01:00
Karma Riuk
d6bf526459 Generator now makes the polygons origin at their center of mass, easier for rotation 2023-03-20 15:33:35 +01:00
Karma Riuk
e6a3979de1 Added a generator for polygons to make the init easier 2023-03-14 23:10:31 +01:00
Karma Riuk
48a1b3ade4 Added the possibility to set the fields of the polygon class in a functional programming style 2023-03-14 23:09:48 +01:00
Karma Riuk
37198d4669 fixed implementaion mistake 2023-03-14 22:00:55 +01:00
Karma Riuk
9fd87b7f29 Simple implementation of polygons, you can create them in the init and draw them 2023-03-14 21:46:36 +01:00
Karma Riuk
7a5bf13575 Added a way to output vec2d in an easy way 2023-03-14 21:45:44 +01:00
Karma Riuk
d0670178c0 Reformated main.cc and spaceship.cc 2023-03-14 21:45:20 +01:00
Karma Riuk
af31bc7148 Added entries to gitignore 2023-03-10 21:31:52 +01:00
Antonio Carzaniga
c1dc49a9dc GUI controls for restitution coefficient and gravity field 2022-12-28 18:50:12 +01:00
Antonio Carzaniga
19125826bd added game pause/resume toggle 2022-12-28 12:42:14 +01:00
Antonio Carzaniga
6078f57647 Merge branch 'inelastic-collisions' into c++-port 2022-12-28 11:47:05 +01:00
Antonio Carzaniga
5a6fea0522 no penetration also for central gravity ball 2022-12-27 18:26:03 +01:00
Antonio Carzaniga
db219a255a inelastic collisions, controllable restitution coefficient 2022-12-27 17:54:40 +01:00
Antonio Carzaniga
f30ca5e594 collision check enabled by default using simple check. 2022-06-10 12:47:33 +02:00
Antonio Carzaniga
94ec166a4a fix variable renaming in ball_elastic_collision. 2022-06-10 12:47:03 +02:00
Antonio Carzaniga
4725f1eb6a more meaningful variable names in elastic collision for balls 2022-06-01 13:06:55 +02:00
Antonio Carzaniga
7064eb5174 2D vector objects for positions, velocities, etc. 2022-06-01 11:09:35 +02:00
Antonio Carzaniga
2240ba1b69 basic modularization of ball and ball_face classes 2022-05-30 18:05:53 +02:00
Antonio Carzaniga
139d8d2997 fix: using CXX also as linker. 2022-05-30 18:03:41 +02:00
Antonio Carzaniga
8f9a8b71c9 cleared unused game framework declarations. 2022-05-30 16:02:25 +02:00
Antonio Carzaniga
4c2273d271 first, basic transition to C++ 2022-05-30 15:59:45 +02:00
Antonio Carzaniga
f2203cfa00 (new_ball_face) fixed memory leak for cairo patterns. 2021-12-12 11:54:43 +01:00
Antonio Carzaniga
53e71fa27d (gravity) added radial, Newtonian (1/r^2) force field 2021-12-12 00:36:07 +01:00